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

**URL:** <https://forum.ionicframework.com/t/translate-use-lang-take-the-app-to-different-state/105241>\
**Category:** ionic-v1\
**Created:** [September 13, 2017, 11:38am UTC](https://forum.ionicframework.com/t/translate-use-lang-take-the-app-to-different-state/105241 "2017-09-13T11:38:19Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![omartaha](https://avatars.discourse-cdn.com/v4/letter/o/f1d935/32.png) [@omartaha](https://forum.ionicframework.com/u/omartaha)\
**Post date:** [September 13, 2017, 11:38am UTC](https://forum.ionicframework.com/t/translate-use-lang-take-the-app-to-different-state/105241/1 "2017-09-13T11:38:19Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![omartaha](https://avatars.discourse-cdn.com/v4/letter/o/f1d935/32.png) [@omartaha](https://forum.ionicframework.com/u/omartaha)\
**Post date:** [September 13, 2017, 12:18pm UTC](https://forum.ionicframework.com/t/translate-use-lang-take-the-app-to-different-state/105241/2 "2017-09-13T12:18:00Z")

</div>

I found the problem, the problem was that the buttons I used to change the language is like this:

```auto
<div class="lang_holder" style="margin-top: 30px;">
        <a href="#" ng-click="changeCurrentLanguage('ar')" class="arButton">عربي</a>
        <a href="#" ng-click="changeCurrentLanguage('en')" class="enButton">Eng</a>
</div>

```

The link attribue href="#" was causing this issue, and it solved after removing it.
