Update translation descriptions: alertDialogLabel, searchFieldLabel (#19234)
diff --git a/dev/tools/localizations_validator.dart b/dev/tools/localizations_validator.dart
index f73cfc1..11a6909 100644
--- a/dev/tools/localizations_validator.dart
+++ b/dev/tools/localizations_validator.dart
@@ -8,6 +8,7 @@
/// 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 @@
}
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;
diff --git a/packages/flutter_localizations/lib/src/l10n/material_en.arb b/packages/flutter_localizations/lib/src/l10n/material_en.arb
index 23b1a14..5a6d308 100644
--- a/packages/flutter_localizations/lib/src/l10n/material_en.arb
+++ b/packages/flutter_localizations/lib/src/l10n/material_en.arb
@@ -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."
+ }
}