I had a scenerio in my Ionic/Angular application where I wanted to translate only a certain block of text seperate from the rest of the text in my Application. Meaning I didn't want the whole app to translate itself when I translate said block of text. So how can this be done? A quick look into the documentation for
$translate you'll notice a 4th optional parameter: forceLanguage.
So instead of using
$translate.use(key) (which would set the locale for my whole application) I used forceLanguage in a simple function. First I created my language dropdown:
<select id="shareSelect" ng-model="optionSelected" ng-change="onSelectLangChange(optionSelected)"> <option value="default" ng-selected="selected">Select a Language</option>