From 22fcff73bd3aa0ec2b3e4c1239c1fe6716860a8e Mon Sep 17 00:00:00 2001 From: Mathis Kirchner Date: Fri, 2 Jan 2026 21:11:37 +0100 Subject: [PATCH] configure en locale as fallback --- lib/main.dart | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/lib/main.dart b/lib/main.dart index 0f3b6b0..a232256 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -20,9 +20,21 @@ class GameTracker extends StatelessWidget { @override Widget build(BuildContext context) { + print(AppLocalizations.supportedLocales.first); return MaterialApp( localizationsDelegates: AppLocalizations.localizationsDelegates, supportedLocales: AppLocalizations.supportedLocales, + localeResolutionCallback: (locale, supportedLocales) { + for (final supportedLocale in supportedLocales) { + if (supportedLocale.languageCode == locale?.languageCode) { + return supportedLocale; + } + } + return supportedLocales.firstWhere( + (locale) => locale.languageCode == 'en', + orElse: () => supportedLocales.first, + ); + }, debugShowCheckedModeBanner: false, title: 'Game Tracker', darkTheme: ThemeData.dark(),