mirror of
https://github.com/jagandeepbrar/lunasea.git
synced 2026-08-30 20:24:25 +00:00
fix(Locale): Set Intl locale to currently set language in LunaSea
This commit is contained in:
@@ -15,6 +15,7 @@
|
||||
|
||||
#### FIXES
|
||||
|
||||
- `[Locale]` Ensure that the date formatter uses the currently set locale
|
||||
- `[Search]` Indexers would not load in some cases when the headers map was null/empty
|
||||
- `[Settings]` (Connection Test) Connection test could fail unexpectedly
|
||||
- `[Sonarr]` (Edit) Grey screen could be shown when a user has no tags
|
||||
|
||||
@@ -10,11 +10,13 @@ Future<void> main() async {
|
||||
runZonedGuarded(
|
||||
() async {
|
||||
await _init();
|
||||
LunaLocalization localization = LunaLocalization();
|
||||
return runApp(
|
||||
EasyLocalization(
|
||||
supportedLocales: LunaLocalization().supportedLocales,
|
||||
path: LunaLocalization().fileDirectory,
|
||||
fallbackLocale: LunaLocalization().fallbackLocale,
|
||||
supportedLocales: localization.supportedLocales,
|
||||
path: localization.fileDirectory,
|
||||
fallbackLocale: localization.fallbackLocale,
|
||||
startLocale: localization.fallbackLocale,
|
||||
useFallbackTranslations: true,
|
||||
child: LunaBIOS(),
|
||||
),
|
||||
@@ -91,6 +93,8 @@ class _State extends State<LunaBIOS> {
|
||||
_firebaseOnMessageOpenedAppListener =
|
||||
LunaFirebaseMessaging().onMessageOpenedAppListener();
|
||||
// Remaining boot sequence
|
||||
Intl.defaultLocale =
|
||||
LunaLanguage.ENGLISH.fromLocale(context.locale)?.languageTag ?? 'en';
|
||||
LunaQuickActions().initialize();
|
||||
LunaChangelog().checkAndShowChangelog();
|
||||
LunaFirebaseAnalytics().appOpened();
|
||||
|
||||
@@ -62,7 +62,10 @@ class _State extends State<_Widget> with LunaScrollControllerMixin {
|
||||
onTap: () async {
|
||||
Tuple2<bool, LunaLanguage> result =
|
||||
await SettingsDialogs().changeLanguage(context);
|
||||
if (result.item1) result.item2.use(context);
|
||||
if (result.item1) {
|
||||
result.item2.use(context);
|
||||
Intl.defaultLocale = result.item2?.languageTag;
|
||||
}
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user