Skip to content

Commit

Permalink
fix: load locales when opening languages page (#455)
Browse files Browse the repository at this point in the history
  • Loading branch information
poppingmoon authored Oct 28, 2024
1 parent db6d953 commit a8306cd
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions lib/view/page/settings/languages_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -100,9 +100,7 @@ class LanguagesPage extends ConsumerWidget {
groupValue: locale,
onChanged: (_) {
ref
.read(
generalSettingsNotifierProvider.notifier,
)
.read(generalSettingsNotifierProvider.notifier)
.setLocale(null);
LocaleSettings.useDeviceLocale();
},
Expand All @@ -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();
Expand Down

0 comments on commit a8306cd

Please sign in to comment.