Fixed an issue where selected locale was not used
This commit is contained in:
@@ -15,7 +15,6 @@ class LocaleController extends ChangeNotifier {
|
||||
_current = _fromString(saved) ?? LanguagePref.system;
|
||||
|
||||
_applyToSlang(_current);
|
||||
notifyListeners();
|
||||
}
|
||||
|
||||
/// Sprache ändern (persistieren + sofort anwenden)
|
||||
@@ -23,18 +22,15 @@ class LocaleController extends ChangeNotifier {
|
||||
_current = lang;
|
||||
await _prefs.setString(_key, lang.name);
|
||||
|
||||
print(lang);
|
||||
|
||||
_applyToSlang(lang);
|
||||
notifyListeners();
|
||||
}
|
||||
|
||||
void _applyToSlang(LanguagePref pref) {
|
||||
if (pref == LanguagePref.system) {
|
||||
LocaleSettings.useDeviceLocale();
|
||||
return;
|
||||
}
|
||||
|
||||
final code = pref.code;
|
||||
if (code == null) {
|
||||
if (pref == LanguagePref.system || code == null) {
|
||||
LocaleSettings.useDeviceLocale();
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user