wt1.1.1 translation fixes
This commit is contained in:
@@ -42,28 +42,35 @@ class SettingsBloc extends Bloc<SettingsEvent, SettingsState> {
|
||||
}
|
||||
|
||||
Future<void> _changeLang( String lang ) async{
|
||||
|
||||
print("_change to $lang");
|
||||
switch ( lang ) {
|
||||
case "English":
|
||||
case "en":
|
||||
case "Angol":
|
||||
_locale = Locale('en');
|
||||
break;
|
||||
case "Hungarian":
|
||||
case "Magyar":
|
||||
case "hu":
|
||||
_locale = Locale('hu');
|
||||
break;
|
||||
}
|
||||
this.language = lang;
|
||||
final AppLanguage appLanguage = AppLanguage();
|
||||
appLanguage.changeLanguage(_locale);
|
||||
AppLanguage().changeLanguage(_locale);
|
||||
await loadLang();
|
||||
}
|
||||
|
||||
Future<void> loadLang() async{
|
||||
print (" -- Loading lang $_locale");
|
||||
if ( context != null ) {
|
||||
AppLocalizations.of(context).setLocale(_locale);
|
||||
await AppLocalizations.of(context).load();
|
||||
if ( _locale != null ) {
|
||||
print(" -- Loading lang $_locale");
|
||||
if (context != null) {
|
||||
AppLocalizations.of(context).setLocale(_locale);
|
||||
await AppLocalizations.of(context).load();
|
||||
} else {
|
||||
print("no context, does not load");
|
||||
}
|
||||
} else {
|
||||
print("no locale, does not load");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user