i18next / ng-i18next

translation for AngularJS using i18next
https://github.com/i18next/ng-i18next
MIT License
161 stars 54 forks source link

Synchronous XMLHttpRequest on the main thread is deprecated because of its detrimental effects to the end user's experience #89

Closed krnlde closed 9 years ago

krnlde commented 9 years ago

I'm referencing i18next/i18next#391 since this problem is specific to i18next/ng-i18next.

Are there suggestions on how to solve this other than:

My first thought was to intercept the language switch request and first load the language into i18next. Does that sound like a good workaround or is that hacky?

Greetings, krnl

bugwelle commented 9 years ago

Mmmhh,... Thanks for reporting this issue :)

Changing language in ng-i18next doesn't work as you might think because we're reinitializing i18next everytime options change (including language). (We have to change that...)

Try to add t = null; here: https://github.com/i18next/ng-i18next/blob/master/dist/ng-i18next.js#L81

Please tell me if this works (haven't tested, yet). I currently don't have that much time for this project, so please let me know if you found a solution.

Regards, Andre

krnlde commented 9 years ago

It indeed removes the browser warning. Can this be accepted as a solution? Next step PR?

bugwelle commented 9 years ago

Glad to hear that.

Yes. Will be fixed in the next release (hopefully tomorrow or at least on the weekend).

krnlde commented 9 years ago

Thanks man!

bugwelle commented 9 years ago

Done. Latest version is online and also works with i18next >= 1.10.0.