mark default language in options
This commit is contained in:
parent
caa25a5124
commit
006c46c91a
2 changed files with 20 additions and 12 deletions
|
|
@ -1055,9 +1055,11 @@ angular.module('copayApp.controllers').controller('indexController', function($r
|
||||||
};
|
};
|
||||||
|
|
||||||
self.setUxLanguage = function() {
|
self.setUxLanguage = function() {
|
||||||
var userLang = uxLanguage.update();
|
uxLanguage.update(function(lang) {
|
||||||
self.defaultLanguageIsoCode = userLang;
|
var userLang = lang;
|
||||||
self.defaultLanguageName = uxLanguage.getName(userLang);
|
self.defaultLanguageIsoCode = userLang;
|
||||||
|
self.defaultLanguageName = uxLanguage.getName(userLang);
|
||||||
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
self.initGlidera = function(accessToken) {
|
self.initGlidera = function(accessToken) {
|
||||||
|
|
@ -1216,11 +1218,12 @@ angular.module('copayApp.controllers').controller('indexController', function($r
|
||||||
});
|
});
|
||||||
|
|
||||||
$rootScope.$on('Local/LanguageSettingUpdated', function() {
|
$rootScope.$on('Local/LanguageSettingUpdated', function() {
|
||||||
self.setUxLanguage();
|
self.setUxLanguage(function() {
|
||||||
self.updateRemotePreferences({
|
self.updateRemotePreferences({
|
||||||
saveAll: true
|
saveAll: true
|
||||||
}, function() {
|
}, function() {
|
||||||
$log.debug('Remote preferences saved')
|
$log.debug('Remote preferences saved')
|
||||||
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
@ -1391,7 +1394,7 @@ angular.module('copayApp.controllers').controller('indexController', function($r
|
||||||
self.noFocusedWallet = true;
|
self.noFocusedWallet = true;
|
||||||
self.isComplete = null;
|
self.isComplete = null;
|
||||||
self.walletName = null;
|
self.walletName = null;
|
||||||
self.setUxLanguage();
|
self.setUxLanguage(function() {});
|
||||||
profileService.isDisclaimerAccepted(function(v) {
|
profileService.isDisclaimerAccepted(function(v) {
|
||||||
if (v) {
|
if (v) {
|
||||||
go.path('import');
|
go.path('import');
|
||||||
|
|
@ -1401,7 +1404,7 @@ angular.module('copayApp.controllers').controller('indexController', function($r
|
||||||
});
|
});
|
||||||
|
|
||||||
$rootScope.$on('Local/NewFocusedWallet', function() {
|
$rootScope.$on('Local/NewFocusedWallet', function() {
|
||||||
self.setUxLanguage();
|
self.setUxLanguage(function() {});
|
||||||
self.setFocusedWallet();
|
self.setFocusedWallet();
|
||||||
self.debounceUpdateHistory();
|
self.debounceUpdateHistory();
|
||||||
self.isDisclaimerAccepted();
|
self.isDisclaimerAccepted();
|
||||||
|
|
|
||||||
|
|
@ -85,7 +85,7 @@ angular.module('copayApp.services')
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
root.update = function() {
|
root.update = function(cb) {
|
||||||
var userLang = configService.getSync().wallet.settings.defaultLanguage;
|
var userLang = configService.getSync().wallet.settings.defaultLanguage;
|
||||||
|
|
||||||
if (!userLang) {
|
if (!userLang) {
|
||||||
|
|
@ -96,8 +96,13 @@ angular.module('copayApp.services')
|
||||||
if (userLang != root.currentLanguage) {
|
if (userLang != root.currentLanguage) {
|
||||||
root._set(lang);
|
root._set(lang);
|
||||||
}
|
}
|
||||||
return userLang;
|
return cb(userLang);
|
||||||
});
|
});
|
||||||
|
} else {
|
||||||
|
if (userLang != root.currentLanguage) {
|
||||||
|
root._set(userLang);
|
||||||
|
}
|
||||||
|
return cb(userLang);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue