diff --git a/lib/app/view/app.dart b/lib/app/view/app.dart index e57f3138d..717ebc442 100644 --- a/lib/app/view/app.dart +++ b/lib/app/view/app.dart @@ -27,6 +27,9 @@ class App extends StatefulWidget { class _AppState extends State { StreamSubscription _signedOutEvent; StreamSubscription _signedInEvent; + static const List supportedLocales = [ + Locale('en'), + ]; @override void initState() { @@ -78,7 +81,16 @@ class _AppState extends State { theme: lightTheme, darkTheme: dartTheme, debugShowCheckedModeBanner: false, - supportedLocales: AppLocalizations.supportedLocales, + supportedLocales: supportedLocales, + localeListResolutionCallback: (locales, supportedLocales) { + for (Locale locale in locales) { + if (supportedLocales.contains(locale)) { + return locale; + } + } + // if device language is not supported by the app, use en as default + return const Locale('en'); + }, localizationsDelegates: AppLocalizations.localizationsDelegates, routes: _getRoutes, ), @@ -90,7 +102,16 @@ class _AppState extends State { theme: lightThemeData, darkTheme: darkThemeData, debugShowCheckedModeBanner: false, - supportedLocales: AppLocalizations.supportedLocales, + supportedLocales: supportedLocales, + localeListResolutionCallback: (locales, supportedLocales) { + for (Locale locale in locales) { + if (supportedLocales.contains(locale)) { + return locale; + } + } + // if device language is not supported by the app, use en as default + return const Locale('en'); + }, localizationsDelegates: const [ AppLocalizations.delegate, GlobalMaterialLocalizations.delegate, diff --git a/pubspec.yaml b/pubspec.yaml index 82a6184a6..12754986e 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,6 +1,6 @@ name: ente_auth description: ente two-factor authenticator -version: 1.0.24+24 +version: 1.0.25+25 publish_to: none environment: