wt1.1.1 translation fixes

This commit is contained in:
Bossanyi Tibor
2020-09-19 08:09:43 +02:00
parent eb2e8e7171
commit 4a193e085f
31 changed files with 585 additions and 599 deletions
+14 -7
View File
@@ -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");
}
}
}