wt1.1.1 translation fixes
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -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) {
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user