Quantcast
Channel: Ionic Forum - Latest posts
Viewing all articles
Browse latest Browse all 230101

$translate.use(lang) take the app to different state

$
0
0

Hello,

I’m developing a multilanguage app on ionic 1, when I change the app language on runtime, the app changes the language correctly, but it moves to another state. what cause this behavious? and how to prevent it?

here is piece of my code:

angular.module(‘starter’).controller(‘SettingsCtrl’,function($scope, $state, $translate) {

        $scope.changeCurrentLanguage = function(lang){


			localStorage.setItem("preferredLanguage", lang);

           $translate.use(lang);

        }


});

Thanks


Viewing all articles
Browse latest Browse all 230101

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>