mirror of
https://github.com/wger-project/flutter.git
synced 2026-02-18 00:17:48 +01:00
Remove manual workaround for missing locales
This commit is contained in:
@@ -2,3 +2,4 @@ arb-dir: lib/l10n
|
||||
template-arb-file: app_en.arb
|
||||
output-localization-file: app_localizations.dart
|
||||
nullable-getter: false
|
||||
preferred-supported-locales: [ en ]
|
||||
@@ -158,21 +158,6 @@ class MyApp extends StatelessWidget {
|
||||
},
|
||||
localizationsDelegates: AppLocalizations.localizationsDelegates,
|
||||
supportedLocales: AppLocalizations.supportedLocales,
|
||||
|
||||
// Workaround for https://github.com/flutter/flutter/issues/100857
|
||||
localeResolutionCallback: (deviceLocale, supportedLocales) {
|
||||
if (deviceLocale != null) {
|
||||
for (final supportedLocale in supportedLocales) {
|
||||
// Since we currently don't support any country specific locales
|
||||
// such as de-DE and de-AT, it's sufficient to just check it like
|
||||
// this. Otherwise we will need more logic with .countryCode
|
||||
if (supportedLocale.languageCode == deviceLocale.languageCode) {
|
||||
return supportedLocale;
|
||||
}
|
||||
}
|
||||
}
|
||||
return const Locale('en');
|
||||
},
|
||||
),
|
||||
),
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user