React-i18next: Infinite loop when using "cimode" as the language

Created on 4 Mar 2019  路  4Comments  路  Source: i18next/react-i18next

Describe the bug
When the language is set to cimode, the hasLoadedNamespace check always returns false for any given namespace, as i18next will never load any namespace when the language is cimode (early return in loadResources). This causes an infinite loop with react-i18next constantly trying to load the "missing" translation and always finding it to not be loaded once it's notified.

Occurs in react-i18next version
10.2.0

To Reproduce

Use any react-i18next component or hook while the i18next instance has lng: 'cimode' set.

Expected behaviour
Translations to be rendered according to the cimode behavior (just returns the keys as-is, optionally with a namespace prefix)

Screenshots

image

OS (please complete the following information):

  • Device: MBP 2018 15"
  • Browser: 72.0.3626.17
bug

Most helpful comment

will add a toLowerCase for the check and publish with the next release....ok?

All 4 comments

could you retry with [email protected]

Yep, it worked :tada:

Just a note: i18next itself is case-insensitive w.r.t. 'cimode', though the check here is case-sensitive.

will add a toLowerCase for the check and publish with the next release....ok?

If you like this module don鈥檛 forget to star this repo. Make a tweet, share the word or have a look at our https://locize.com to support the devs of this project -> there are many ways to help this project :pray:

Was this page helpful?
0 / 5 - 0 ratings