2015-04-22 15:19:08 -03:00
|
|
|
'use strict';
|
|
|
|
|
|
|
|
|
|
angular.module('copayApp.controllers').controller('preferencesLanguageController',
|
2015-08-27 12:07:13 -03:00
|
|
|
function($scope, $log, $timeout, configService, go, uxLanguage) {
|
2015-04-22 15:19:08 -03:00
|
|
|
|
2015-08-27 12:07:13 -03:00
|
|
|
this.availableLanguages = uxLanguage.getLanguages();
|
|
|
|
|
|
|
|
|
|
console.log('[preferencesLanguage.js.7]', this.availableLanguages); //TODO
|
2015-04-22 15:19:08 -03:00
|
|
|
this.save = function(newLang) {
|
2015-06-29 21:46:34 -03:00
|
|
|
|
|
|
|
|
var opts = {
|
|
|
|
|
wallet: {
|
|
|
|
|
settings: {
|
|
|
|
|
defaultLanguage: newLang
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
configService.set(opts, function(err) {
|
|
|
|
|
if (err) $log.warn(err);
|
|
|
|
|
$scope.$emit('Local/LanguageSettingUpdated');
|
|
|
|
|
$timeout(function() {
|
|
|
|
|
go.preferences();
|
|
|
|
|
}, 100);
|
|
|
|
|
});
|
2015-04-22 15:19:08 -03:00
|
|
|
};
|
|
|
|
|
});
|