From c429f0358b959f8ba9515d24cadac46fce4d77e0 Mon Sep 17 00:00:00 2001
From: blavenie <benoit.lavenier@e-is.pro>
Date: Fri, 29 Jul 2016 11:48:10 +0200
Subject: [PATCH] Move locales label into UIUtils

---
 www/js/controllers/settings-controllers.js | 5 +----
 www/js/services/utils-services.js          | 6 +++++-
 2 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/www/js/controllers/settings-controllers.js b/www/js/controllers/settings-controllers.js
index 855d6963..e61e916e 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 7819181b..f61c9dd8 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'}
+    ]
   };
 })
 
-- 
GitLab