From abd60c6af8f7ebcedc1c115d55c61d778b2588c9 Mon Sep 17 00:00:00 2001 From: Felix Kirchner Date: Fri, 13 Jun 2025 17:48:46 +0200 Subject: [PATCH] Hotfix: app appears in english, when anything other than german system language is selected --- lib/main.dart | 8 ++++++++ pubspec.yaml | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/lib/main.dart b/lib/main.dart index eb3d022..27c3835 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -56,6 +56,14 @@ class _AppState extends State with WidgetsBindingObserver { Locale('en'), // English Locale('de'), // German ], + localeResolutionCallback: (locale, supportedLocales) { + for (final supportedLocale in supportedLocales) { + if (supportedLocale.languageCode == locale?.languageCode) { + return supportedLocale; + } + } + return supportedLocales.first; + }, theme: CupertinoThemeData( brightness: Brightness.dark, primaryColor: CustomTheme.primaryColor, diff --git a/pubspec.yaml b/pubspec.yaml index 5874a43..e389608 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -2,7 +2,7 @@ name: cabo_counter description: "Mobile app for the card game Cabo" publish_to: 'none' -version: 0.3.0+233 +version: 0.3.0+237 environment: sdk: ^3.5.4