You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

17 lines
486 B

7 years ago
  1. angular.module('app.settings', ['pascalprecht.translate'])
  2. .controller('SettingsCtrl', function($scope, $stateParams, $translate) {
  3. if(localStorage.getItem('lang'))//initialization
  4. {
  5. $scope.lang=localStorage.getItem('lang');
  6. }else{
  7. localStorage.setItem('lang', 'english');
  8. $scope.lang=localStorage.getItem('lang');
  9. }
  10. $scope.langChange = function(lang){
  11. console.log(lang);
  12. window.localStorage.setItem('lang', lang);
  13. $translate.use(lang);
  14. };
  15. });