From 92c3f2f7d30741ac708dd18deddfaecd9e0e34d5 Mon Sep 17 00:00:00 2001 From: pliablepixels Date: Wed, 25 May 2016 21:04:25 -0400 Subject: #261 - option to switch languages Former-commit-id: 3d0903622ca447f8c58b7bcc409df57e7b07d4a2 --- www/js/FirstUseCtrl.js | 39 ++++++++++++++++++++++++++++++++++++++- 1 file changed, 38 insertions(+), 1 deletion(-) (limited to 'www/js/FirstUseCtrl.js') diff --git a/www/js/FirstUseCtrl.js b/www/js/FirstUseCtrl.js index 2e0d5c85..b9031309 100644 --- a/www/js/FirstUseCtrl.js +++ b/www/js/FirstUseCtrl.js @@ -2,7 +2,7 @@ /* jslint browser: true*/ /* global cordova,StatusBar,angular,console */ -angular.module('zmApp.controllers').controller('zmApp.FirstUseCtrl', ['$scope','$ionicSideMenuDelegate', 'zm', '$stateParams', '$ionicHistory','$state', function ($scope,$ionicSideMenuDelegate,zm, $stateParams, $ionicHistory, $state) { +angular.module('zmApp.controllers').controller('zmApp.FirstUseCtrl', ['$scope','$ionicSideMenuDelegate', 'zm', '$stateParams', '$ionicHistory','$state', 'ZMDataModel', '$rootScope', '$ionicPopup', '$translate', function ($scope,$ionicSideMenuDelegate,zm, $stateParams, $ionicHistory, $state, ZMDataModel, $rootScope, $ionicPopup, $translate) { $scope.openMenu = function () { $ionicSideMenuDelegate.toggleLeft(); }; @@ -19,6 +19,43 @@ $scope.openMenu = function () { }); + $scope.switchLang = function() + { + $scope.lang = ZMDataModel.getLanguages(); + $scope.myopt = {lang:""}; + + $rootScope.zmPopup = $ionicPopup.show({ + scope: $scope, + template: ' {{item.text}} ', + + + title: $translate.instant('kSelectLanguage'), + + buttons: [ + { + text: $translate.instant('kButtonCancel'), + onTap: function (e) { + //return "CANCEL"; + } + + }, + { + text: $translate.instant('kButtonOk'), + onTap: function (e) { + ZMDataModel.zmLog("Language selected:"+$scope.myopt.lang); + ZMDataModel.setDefaultLanguage($scope.myopt.lang, true); + + + //return "OK"; + + } + } + ] + }); + + + }; + $scope.goToLogin = function() { $ionicHistory.nextViewOptions({ -- cgit v1.2.3