question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

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 completely translate-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:closed
  • Created 7 years ago
  • Comments:9 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
almeidapcommented, Apr 21, 2016

@knalli you are welcome 😉

0reactions
knallicommented, Sep 21, 2016

Closing this. No complaints any more…

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to change the language on Android at runtime and ...
The first place is your “Settings” screen or whatever place you use to change the language in your application. Note that after the...
Read more >
2.11.4 Changes in MySQL 8.0
Changes marked as Incompatible change are incompatibilities with earlier versions of MySQL, and may require your attention before upgrading. Our aim is to...
Read more >
Troubleshoot checking spelling and grammar in multiple ...
Checking spelling and grammar in multiple languages can present unique problems, such as correctly spelled words being flagged as incorrect, or misspelled ...
Read more >
Extensible Markup Language (XML) 1.0 (Fifth Edition)
[Definition: Markup takes the form of start-tags, end-tags, empty-element tags, entity references, character references, comments, CDATA section ...
Read more >
Changes in Atmospheric Constituents and in Radiative ...
Radiative forcing, however, is not designed as an indicator of the detailed aspects of climate response. Unless otherwise men-.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found