From 6f0a2514b90c9766ac29d0175f4c0a8f1126c759 Mon Sep 17 00:00:00 2001 From: Ming Ming Date: Tue, 29 Aug 2023 21:19:12 +0800 Subject: [PATCH] Use generated locale list --- app/l10n.yaml | 1 + app/lib/widget/my_app.dart | 20 +------------------- 2 files changed, 2 insertions(+), 19 deletions(-) diff --git a/app/l10n.yaml b/app/l10n.yaml index 148a1fbd..606fab31 100644 --- a/app/l10n.yaml +++ b/app/l10n.yaml @@ -2,3 +2,4 @@ arb-dir: lib/l10n template-arb-file: app_en.arb output-localization-file: app_localizations.dart untranslated-messages-file: lib/l10n/untranslated-messages.txt +preferred-supported-locales: [en] diff --git a/app/lib/widget/my_app.dart b/app/lib/widget/my_app.dart index ceeb4a96..0872c419 100644 --- a/app/lib/widget/my_app.dart +++ b/app/lib/widget/my_app.dart @@ -146,25 +146,7 @@ class _WrappedAppState extends State<_WrappedApp> scaffoldMessengerKey: _scaffoldMessengerKey, locale: state.language.locale, localizationsDelegates: AppLocalizations.localizationsDelegates, - supportedLocales: const [ - // 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"), - ], + supportedLocales: AppLocalizations.supportedLocales, builder: (context, child) { MyApp._globalContext = context; return _ThemedMyApp(child: child!);