Fixed/Added/Reordered supported languages.

This commit is contained in:
Yannick Mauray 2021-12-09 21:56:29 +01:00
parent 75e5e825ce
commit 118d39659c
No known key found for this signature in database
GPG Key ID: 67C4AAC5E99CB909
1 changed files with 7 additions and 5 deletions

View File

@ -51,6 +51,7 @@ class _AppState extends State<App> with PreferencesMixin {
* but are present in fr.po, the missing translations will not be picked up from fr.po, * but are present in fr.po, the missing translations will not be picked up from fr.po,
* and thus will show up in english. * and thus will show up in english.
*/ */
Locale('cs_CZ'),
Locale('cy'), Locale('cy'),
Locale('de'), Locale('de'),
Locale('en'), Locale('en'),
@ -58,10 +59,9 @@ class _AppState extends State<App> with PreferencesMixin {
Locale('fr', 'CH'), Locale('fr', 'CH'),
Locale('gd'), Locale('gd'),
Locale('it'), Locale('it'),
Locale('cs_CZ'),
Locale('oc'),
Locale('nl'), Locale('nl'),
Locale('no'), Locale('no'),
Locale('oc'),
Locale('ru'), Locale('ru'),
], ],
localizationsDelegates: [ localizationsDelegates: [
@ -72,12 +72,14 @@ class _AppState extends State<App> with PreferencesMixin {
localeListResolutionCallback: (locales, supportedLocales) { localeListResolutionCallback: (locales, supportedLocales) {
if (locales != null) { if (locales != null) {
for (var locale in locales) { for (var locale in locales) {
var supportedLocale = var supportedLocale = supportedLocales.where((element) =>
supportedLocales.where((element) => element.languageCode == locale.languageCode && element.countryCode == locale.countryCode); element.languageCode == locale.languageCode &&
element.countryCode == locale.countryCode);
if (supportedLocale.isNotEmpty) { if (supportedLocale.isNotEmpty) {
return supportedLocale.first; return supportedLocale.first;
} }
supportedLocale = supportedLocales.where((element) => element.languageCode == locale.languageCode); supportedLocale = supportedLocales.where((element) =>
element.languageCode == locale.languageCode);
if (supportedLocale.isNotEmpty) { if (supportedLocale.isNotEmpty) {
return supportedLocale.first; return supportedLocale.first;
} }