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
+2 -4
View File
@@ -38,12 +38,11 @@ mixin Common {
}
String getDateLocale( DateTime datetime, bool timeDisplay ) {
AppLanguage appLanguage = AppLanguage();
var date = datetime;
String dateName = DateFormat(DateFormat.YEAR_MONTH_DAY, appLanguage.appLocal.toString()).format(date.toUtc());
String dateName = DateFormat(DateFormat.YEAR_MONTH_DAY, AppLanguage().appLocal.toString()).format(date.toUtc());
if ( timeDisplay ) {
dateName += " " +DateFormat(DateFormat.HOUR_MINUTE, appLanguage.appLocal.toString()).format(date.toUtc());
dateName += " " +DateFormat(DateFormat.HOUR_MINUTE, AppLanguage().appLocal.toString()).format(date.toUtc());
}
return dateName;
@@ -74,5 +73,4 @@ mixin Common {
return _passwordRegExp.hasMatch(password);
}
}
+4 -5
View File
@@ -17,7 +17,6 @@ class Session {
Future<SharedPreferences> _prefs = SharedPreferences.getInstance();
SharedPreferences _sharedPreferences;
final AppLanguage appLanguage = AppLanguage();
fetchSessionAndNavigate( ) async {
print (" -- Session: await prefs..");
@@ -27,11 +26,11 @@ class Session {
if ( Cache().firstLoad ) {
print (" -- Session: fetch locale..");
await appLanguage.getLocale(_sharedPreferences);
await AppLocalizations.delegate.load(appLanguage.appLocal);
await AppLanguage().getLocale(_sharedPreferences);
await AppLocalizations.delegate.load(AppLanguage().appLocal);
print (" -- Session: fetch token..");
await _fetchToken(_sharedPreferences);
initDeviceLocale();
//initDeviceLocale();
// PushNotificationsManager().init();
}
@@ -69,7 +68,7 @@ class Session {
Cache.password
);
int customerId = 0;
print("--- Lang: " + appLanguage.appLocal.toString());
print("--- Lang: " + AppLanguage().appLocal.toString());
if(responseJson['error'] != null) {
print("************** Here big error - no authentication");
} else if (responseJson['token'] != null) {
+13
View File
@@ -0,0 +1,13 @@
import 'package:aitrainer_app/localization/app_localization.dart';
import 'package:flutter/cupertino.dart';
mixin Trans {
BuildContext context;
void setContext(BuildContext context) {
this.context = context;
}
String t(String text) {
return AppLocalizations.of(context).translate(text);
}
}