My application is on angularJs. I new to angular-translate. Gone through few examples like http://angular-translate.github.io/. Every scenario I need to define both the language text (Eg: if i need to change "Title" to English to German i need to define title in two languages $translateProvider.translations('en') $translateProvider.translations('de') ) Is this the only way to translate angularJs application?Is there any way that I can pass text as key and translate according to language selected with out defining both text?
Tried in this way but not worked.
$rootScope.$on('$translateChangeSuccess', function () {
$translateProvider.preferredLanguage('fa');
$scope.pageTitle = $translate.instant('Title');
});
In View:
{{pageTitle}}
Can i know better way to change the text.