From 61590c18ccce55f530d67add6d462167d07b3a85 Mon Sep 17 00:00:00 2001 From: poppingmoon <63451158+poppingmoon@users.noreply.github.com> Date: Tue, 29 Oct 2024 06:54:46 +0900 Subject: [PATCH] fix: load locales opening languages page --- lib/view/page/settings/languages_page.dart | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/lib/view/page/settings/languages_page.dart b/lib/view/page/settings/languages_page.dart index 9f9f1529..c2c92e8f 100644 --- a/lib/view/page/settings/languages_page.dart +++ b/lib/view/page/settings/languages_page.dart @@ -100,9 +100,7 @@ class LanguagesPage extends ConsumerWidget { groupValue: locale, onChanged: (_) { ref - .read( - generalSettingsNotifierProvider.notifier, - ) + .read(generalSettingsNotifierProvider.notifier) .setLocale(null); LocaleSettings.useDeviceLocale(); }, @@ -117,17 +115,17 @@ class LanguagesPage extends ConsumerWidget { ) .map( (appLocale) => RadioListTile( - title: Text( - appLocale.translations.misskey.lang__, + title: FutureBuilder( + future: LocaleSettings.instance.loadLocale(appLocale), + builder: (context, snapshot) => + Text(appLocale.translations.misskey.lang__), ), subtitle: Text(appLocale.languageTag), value: appLocale, groupValue: locale, onChanged: (locale) { ref - .read( - generalSettingsNotifierProvider.notifier, - ) + .read(generalSettingsNotifierProvider.notifier) .setLocale(locale); if (locale == null) { LocaleSettings.useDeviceLocale();