diff --git a/www/js/controllers/settings-controllers.js b/www/js/controllers/settings-controllers.js index 855d69636fcb7e82550c856d369dad657f5e0e3e..e61e916ec715a0deb29e57c3eaf80d06bac43fb6 100644 --- a/www/js/controllers/settings-controllers.js +++ b/www/js/controllers/settings-controllers.js @@ -23,15 +23,12 @@ angular.module('cesium.settings.controllers', ['cesium.services', 'cesium.curren function SettingsController($scope, $state, UIUtils, Wallet, $translate, BMA, $q, $ionicPopup, $timeout, localStorage) { 'ngInject'; - $scope.locales = [ - {id:'fr-FR', label:'Français'}, - {id:'en', label:'English'} - ]; $scope.formData = angular.copy(Wallet.defaultSettings); $scope.loading = true; $scope.$on('$ionicView.enter', function(e, $state) { $scope.loading = true; // to avoid the call of Wallet.store() + $scope.locales = UIUtils.locales; $scope.formData.locale = _.findWhere($scope.locales, {id: $translate.use()}); angular.merge($scope.formData, Wallet.data.settings); if (Wallet.data.settings.locale && Wallet.data.settings.locale.id) { diff --git a/www/js/services/utils-services.js b/www/js/services/utils-services.js index 7819181b43fea6b592313946a6f7f8b1ca9b8c60..f61c9dd8c805fd47dff2954a2cb38246bcea8805 100644 --- a/www/js/services/utils-services.js +++ b/www/js/services/utils-services.js @@ -326,7 +326,11 @@ angular.module('cesium.utils.services', ['ngResource']) resizeSrc: resizeImageFromSrc, fromAttachment: imageFromAttachment, toAttachment: imageToAttachment - } + }, + locales: [ + {id:'fr-FR', label:'Français'}, + {id:'en', label:'English'} + ] }; })