From a8306cd2bdc88f1014fa768250d58aa85c0daad6 Mon Sep 17 00:00:00 2001 From: poppingmoon <63451158+poppingmoon@users.noreply.github.com> Date: Tue, 29 Oct 2024 07:31:39 +0900 Subject: [PATCH] fix: load locales when opening languages page (#455) --- 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();