angularjs - Angular-translate, get word NOT from current language -


there ng-module $translate.

there method $translate.use(locale), changes locale @ all, of course.

i need word other locales without locale switching. possible?

upd. resolved adding provider:

.provider('vocabularies', function($translateprovider) {     this.$get = () => $translateprovider.translations(); }) 

so, in controller can add:

function(vocabularies) {     console.log(vocabularies['en-us']['key.of.needed.words']); } 

thanks everyone!

as mentioned here $translate.use() getter , setter, means can store current locale in variable, change new one, extract word , restore locale original one.

another solution create factory holds translations , use both configure $translateprovider, access later without changing locale. better solution i'd say.


Comments