Closed Soviut closed 10 years ago
I've solved the problem using the i18nextLanguageChange
event:
$rootScope.$on('i18nextLanguageChange', function () {
$scope.pagetitle = $i18next('ui.pagetitle');
});
Was I facing a race condition or was there something else preventing the translation from working?
Oh, I don't know. But I'm glad to see that you've solved the problem. :+1:
I'll close this issue now. If there are problems or question left, please comment on this issue :)
Regards, Andre
I've got a controller called SiteCtrl that sits on the
<html>
element that handles a few site-wide things.I wanted populate the
<title>
tag with translated text. However using the directive creates an html element and the filter is visible as raw`{{ }}
text. So, reluctantly, I decided to create a scope variable in my SiteCtrl that stores the pagetitle.However, this only outputs
ui.pagetitle
. From my experience with i18next, this means it's translating, but not finding the key. When I put this same line into another controller further down in the DOM, it works fine.I'm guessing there's something special about the html element. Is there any way i can get this translation to work?