Skip to content
Snippets Groups Projects
Commit c429f035 authored by Benoit Lavenier's avatar Benoit Lavenier
Browse files

Move locales label into UIUtils

parent 71a1f9f2
No related branches found
No related tags found
No related merge requests found
...@@ -23,15 +23,12 @@ angular.module('cesium.settings.controllers', ['cesium.services', 'cesium.curren ...@@ -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) { function SettingsController($scope, $state, UIUtils, Wallet, $translate, BMA, $q, $ionicPopup, $timeout, localStorage) {
'ngInject'; 'ngInject';
$scope.locales = [
{id:'fr-FR', label:'Français'},
{id:'en', label:'English'}
];
$scope.formData = angular.copy(Wallet.defaultSettings); $scope.formData = angular.copy(Wallet.defaultSettings);
$scope.loading = true; $scope.loading = true;
$scope.$on('$ionicView.enter', function(e, $state) { $scope.$on('$ionicView.enter', function(e, $state) {
$scope.loading = true; // to avoid the call of Wallet.store() $scope.loading = true; // to avoid the call of Wallet.store()
$scope.locales = UIUtils.locales;
$scope.formData.locale = _.findWhere($scope.locales, {id: $translate.use()}); $scope.formData.locale = _.findWhere($scope.locales, {id: $translate.use()});
angular.merge($scope.formData, Wallet.data.settings); angular.merge($scope.formData, Wallet.data.settings);
if (Wallet.data.settings.locale && Wallet.data.settings.locale.id) { if (Wallet.data.settings.locale && Wallet.data.settings.locale.id) {
......
...@@ -326,7 +326,11 @@ angular.module('cesium.utils.services', ['ngResource']) ...@@ -326,7 +326,11 @@ angular.module('cesium.utils.services', ['ngResource'])
resizeSrc: resizeImageFromSrc, resizeSrc: resizeImageFromSrc,
fromAttachment: imageFromAttachment, fromAttachment: imageFromAttachment,
toAttachment: imageToAttachment toAttachment: imageToAttachment
} },
locales: [
{id:'fr-FR', label:'Français'},
{id:'en', label:'English'}
]
}; };
}) })
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment