mirror of https://github.com/BTCPrivate/copay.git
mark default language in options
This commit is contained in:
parent
caa25a5124
commit
006c46c91a
|
@ -1055,9 +1055,11 @@ angular.module('copayApp.controllers').controller('indexController', function($r
|
|||
};
|
||||
|
||||
self.setUxLanguage = function() {
|
||||
var userLang = uxLanguage.update();
|
||||
uxLanguage.update(function(lang) {
|
||||
var userLang = lang;
|
||||
self.defaultLanguageIsoCode = userLang;
|
||||
self.defaultLanguageName = uxLanguage.getName(userLang);
|
||||
});
|
||||
};
|
||||
|
||||
self.initGlidera = function(accessToken) {
|
||||
|
@ -1216,13 +1218,14 @@ angular.module('copayApp.controllers').controller('indexController', function($r
|
|||
});
|
||||
|
||||
$rootScope.$on('Local/LanguageSettingUpdated', function() {
|
||||
self.setUxLanguage();
|
||||
self.setUxLanguage(function() {
|
||||
self.updateRemotePreferences({
|
||||
saveAll: true
|
||||
}, function() {
|
||||
$log.debug('Remote preferences saved')
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
$rootScope.$on('Local/GlideraUpdated', function(event, accessToken) {
|
||||
self.initGlidera(accessToken);
|
||||
|
@ -1391,7 +1394,7 @@ angular.module('copayApp.controllers').controller('indexController', function($r
|
|||
self.noFocusedWallet = true;
|
||||
self.isComplete = null;
|
||||
self.walletName = null;
|
||||
self.setUxLanguage();
|
||||
self.setUxLanguage(function() {});
|
||||
profileService.isDisclaimerAccepted(function(v) {
|
||||
if (v) {
|
||||
go.path('import');
|
||||
|
@ -1401,7 +1404,7 @@ angular.module('copayApp.controllers').controller('indexController', function($r
|
|||
});
|
||||
|
||||
$rootScope.$on('Local/NewFocusedWallet', function() {
|
||||
self.setUxLanguage();
|
||||
self.setUxLanguage(function() {});
|
||||
self.setFocusedWallet();
|
||||
self.debounceUpdateHistory();
|
||||
self.isDisclaimerAccepted();
|
||||
|
|
|
@ -85,7 +85,7 @@ angular.module('copayApp.services')
|
|||
});
|
||||
};
|
||||
|
||||
root.update = function() {
|
||||
root.update = function(cb) {
|
||||
var userLang = configService.getSync().wallet.settings.defaultLanguage;
|
||||
|
||||
if (!userLang) {
|
||||
|
@ -96,8 +96,13 @@ angular.module('copayApp.services')
|
|||
if (userLang != root.currentLanguage) {
|
||||
root._set(lang);
|
||||
}
|
||||
return userLang;
|
||||
return cb(userLang);
|
||||
});
|
||||
} else {
|
||||
if (userLang != root.currentLanguage) {
|
||||
root._set(userLang);
|
||||
}
|
||||
return cb(userLang);
|
||||
}
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in New Issue