From fcead1288826d26ba7f3e32851a596fc08c6f554 Mon Sep 17 00:00:00 2001 From: Roland Geider Date: Mon, 5 Jun 2023 17:05:36 +0200 Subject: [PATCH] Remove manual workaround for missing locales --- l10n.yaml | 1 + lib/main.dart | 15 --------------- 2 files changed, 1 insertion(+), 15 deletions(-) diff --git a/l10n.yaml b/l10n.yaml index b1cc1414..3c41bfca 100644 --- a/l10n.yaml +++ b/l10n.yaml @@ -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 ] \ No newline at end of file diff --git a/lib/main.dart b/lib/main.dart index 90dadd90..54350763 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -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'); - }, ), ), );