Use generated locale list

This commit is contained in:
Ming Ming 2023-08-29 21:19:12 +08:00
parent 866720fa3a
commit 6f0a2514b9
2 changed files with 2 additions and 19 deletions

View file

@ -2,3 +2,4 @@ arb-dir: lib/l10n
template-arb-file: app_en.arb template-arb-file: app_en.arb
output-localization-file: app_localizations.dart output-localization-file: app_localizations.dart
untranslated-messages-file: lib/l10n/untranslated-messages.txt untranslated-messages-file: lib/l10n/untranslated-messages.txt
preferred-supported-locales: [en]

View file

@ -146,25 +146,7 @@ class _WrappedAppState extends State<_WrappedApp>
scaffoldMessengerKey: _scaffoldMessengerKey, scaffoldMessengerKey: _scaffoldMessengerKey,
locale: state.language.locale, locale: state.language.locale,
localizationsDelegates: AppLocalizations.localizationsDelegates, localizationsDelegates: AppLocalizations.localizationsDelegates,
supportedLocales: const [ supportedLocales: AppLocalizations.supportedLocales,
// the order here doesn't matter, except for the first one, which
// must be en
Locale("en"),
Locale("el"),
Locale("es"),
Locale("fr"),
Locale("ru"),
Locale("de"),
Locale("cs"),
Locale("fi"),
Locale("pl"),
Locale("pt"),
Locale.fromSubtags(languageCode: "zh", scriptCode: "Hans"),
Locale.fromSubtags(languageCode: "zh", scriptCode: "Hant"),
Locale("it"),
Locale("nl"),
Locale("ca"),
],
builder: (context, child) { builder: (context, child) {
MyApp._globalContext = context; MyApp._globalContext = context;
return _ThemedMyApp(child: child!); return _ThemedMyApp(child: child!);