Unverified Commit fbf90448 authored by Hans Muller's avatar Hans Muller Committed by GitHub

Update translation descriptions: alertDialogLabel, searchFieldLabel (#19234)

parent cc122f16
......@@ -8,6 +8,7 @@ import 'dart:io';
/// Sanity checking of the @foo metadata in the English translations,
/// material_en.arb.
///
/// - For each foo, resource, there must be a corresponding @foo.
/// - For each @foo resource, there must be a corresponding foo, except
/// for plurals, for which there must be a fooOther.
/// - Each @foo resource must have a Map value with a String valued
......@@ -23,6 +24,24 @@ String validateEnglishLocalizations(File file) {
}
final Map<String, dynamic> bundle = json.decode(file.readAsStringSync());
for (String resourceId in bundle.keys) {
if (resourceId.startsWith('@'))
continue;
if (bundle['@$resourceId'] != null)
continue;
bool checkPluralResource(String suffix) {
final int suffixIndex = resourceId.indexOf(suffix);
return suffixIndex != -1 && bundle['@${resourceId.substring(0, suffixIndex)}'] != null;
}
if (<String>['Zero', 'One', 'Two', 'Few', 'Many', 'Other'].any(checkPluralResource))
continue;
errorMessages.writeln('A value was not specified for @$resourceId');
}
for (String atResourceId in bundle.keys) {
if (!atResourceId.startsWith('@'))
continue;
......
......@@ -197,12 +197,12 @@
},
"alertDialogLabel": "Alert",
"@dialogLabel": {
"@alertDialogLabel": {
"description": "The audio announcement made when an AlertDialog is opened."
},
"searchFieldLabel": "Search",
"@dialogLabel": {
"description": "Label indicating that a text field is a search field. This will be used as a hint text in the text field."
}
"@searchFieldLabel": {
"description": "Label indicating that a text field is a search field. This will be used as a hint text in the text field."
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment