Update Stocks example using i18n tool (#44223)

* Use l10n tool to generate stocks i18n files

* Rename *_en_EN.arb to *_en_US.arb

* Fix l10n script
This commit is contained in:
Shi-Hao Hong
2019-11-06 12:52:03 -08:00
committed by GitHub
parent 383e90eb13
commit 3e4bf5757d
12 changed files with 188 additions and 134 deletions

View File

@@ -99,7 +99,7 @@ class _@classNameDelegate extends LocalizationsDelegate<@className> {
Future<@className> load(Locale locale) => @className.load(locale);
@override
bool isSupported(Locale locale) => [@supportedLanguageCodes].contains(locale.languageCode);
bool isSupported(Locale locale) => <String>[@supportedLanguageCodes].contains(locale.languageCode);
@override
bool shouldReload(_@classNameDelegate old) => false;
@@ -236,7 +236,7 @@ String genPluralMethod(Map<String, dynamic> bundle, String key) {
}
String genSupportedLocaleProperty(Set<LocaleInfo> supportedLocales) {
const String prefix = 'static const List<Locale> supportedLocales = <Locale>[ \n Locale(''';
const String prefix = 'static const List<Locale> supportedLocales = <Locale>[\n Locale(''';
const String suffix = '),\n ];';
String resultingProperty = prefix;
@@ -289,7 +289,7 @@ bool _isDirectoryReadableAndWritable(String statString) {
String _importFilePath(String path, String fileName) {
final String replaceLib = path.replaceAll('lib/', '');
return '$replaceLib/$fileName.dart';
return '$replaceLib/$fileName';
}
Future<void> main(List<String> args) async {