Forcing another language does not work anymore (breaking in 2.11)
See original GitHub issue@almeidap reported a regression introduced in 2.11
Forcing a language is now working in version 2.11.0 but it produces errors when trying to switch to another language afterwards:
angular.js:13236 TypeError: Cannot read property 'key' of undefined
at angular-translate.js:2216
at processQueue (angular.js:15552)
at angular.js:15568
...
You should be able to reproduce the issue if you click in any language button on the updated demo Plunk (see console for stack trace): http://plnkr.co/edit/3YVgipajDFwLuYBVVBeh?p=preview
FYI, angular-translate determines my preferred language as French, which is correct.
In fact after some more testing, it looks like forcing a translation only works properly when using the
translate
pipe. Take a look to the improved demo again: http://plnkr.co/edit/3YVgipajDFwLuYBVVBeh?p=preview
- When using the
translate-force
directives, it fails radomly (probably due to the promise mechanism behind the scene).- Note that I had to comment the
$translateProvider.determinePreferredLanguage()
call as it seems to conflict with$translateProvider.fallbackLanguage()
(see #1075) and breaks completelytranslate-force
.Unless there is something wrong in the demo, this issue should be reopened again.
@tspaeth I would assume that we have add something which breaks it: https://github.com/angular-translate/angular-translate/compare/5dfa8ca49137425d0614c5693b2fe67fa72c125f...adeaa3e3a19f46cc4d40de8665f7e4492fce8475
The are errors in the console because here the translation
is actually an empty object and thefore NPEs. And that’s wrong, translation
should not be empty.
Issue Analytics
- State:
- Created 7 years ago
- Comments:9 (7 by maintainers)
@knalli you are welcome 😉
Closing this. No complaints any more…