l10n tool improvements, stocks app i18n refresh (#44473)

* Add check for placeholders being an empty map

* Remove unnecessary properties from en_ES.arb in the stocks example

* Use getter instead of methods in the stocks example

* Fixed "annotating types for function expression parameters" lint issue from generated localizations delegate code
This commit is contained in:
Shi-Hao Hong
2019-11-11 14:42:29 -08:00
committed by GitHub
parent 9307a83f7c
commit 159a47da64
6 changed files with 20 additions and 44 deletions

View File

@@ -79,7 +79,7 @@ class @className {
static Future<@className> load(Locale locale) {
return initializeMessages(locale.toString())
.then<@className>((void _) => @className(locale));
.then<@className>((_) => @className(locale));
}
static @className of(BuildContext context) {
@@ -168,8 +168,10 @@ List<String> genIntlMethodArgs(Map<String, dynamic> bundle, String key) {
}
if (attributesMap.containsKey('placeholders')) {
final Map<String, dynamic> placeholders = attributesMap['placeholders'];
final String args = placeholders.keys.join(', ');
attributes.add('args: <Object>[$args]');
if (placeholders.isNotEmpty) {
final String args = placeholders.keys.join(', ');
attributes.add('args: <Object>[$args]');
}
}
}
return attributes;