wt1.1.1 ExercisePlan + ExercisePlan detail, Trainee

This commit is contained in:
Bossanyi Tibor
2020-09-16 15:41:39 +02:00
parent f0ba820385
commit 0b4ff2fb7f
54 changed files with 2985 additions and 313 deletions
+9 -4
View File
@@ -20,19 +20,24 @@ class AppLanguage{
Future<void> fetchLocale() async {
var prefs = await SharedPreferences.getInstance();
if (prefs.getString('language_code') == null) {
String langCode = prefs.getString('language_code');
print(" ---- lang code $langCode");
if ( langCode == null) {
_appLocale = Locale('en');
} else {
_appLocale = Locale(prefs.getString('language_code'));
_appLocale = Locale(langCode);
}
print(" ---- Fetched lang: " + _appLocale.toString());
}
getLocale(SharedPreferences prefs) {
if (prefs.getString('language_code') == null) {
String langCode = prefs.getString('language_code');
if ( langCode == null) {
_appLocale = Locale('en');
}
_appLocale = Locale(prefs.getString('language_code'));
_appLocale = Locale(langCode);
print(" ---- Get lang: " + _appLocale.toString() + " lang code $langCode");
}
+1
View File
@@ -28,6 +28,7 @@ class AppLocalizations {
Future<bool> load() async {
// Load the language JSON file from the "lang" folder
print(" -- load language pieces " + locale.languageCode);
String jsonString =
await rootBundle.loadString('i18n/${locale.languageCode}.json');
Map<String, dynamic> jsonMap = json.decode(jsonString);