Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Infinite loop when using "cimode" as the language #768

Closed
Jessidhia opened this issue Mar 4, 2019 · 4 comments
Closed

Infinite loop when using "cimode" as the language #768

Jessidhia opened this issue Mar 4, 2019 · 4 comments
Labels

Comments

@Jessidhia
Copy link

Jessidhia commented Mar 4, 2019

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
@jamuhl jamuhl added the bug label Mar 4, 2019
@jamuhl
Copy link
Member

jamuhl commented Mar 4, 2019

could you retry with react-i18next@10.2.1

@Jessidhia
Copy link
Author

Yep, it worked 🎉

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

@jamuhl
Copy link
Member

jamuhl commented Mar 4, 2019

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

@jamuhl
Copy link
Member

jamuhl commented Mar 4, 2019

If you like this module don’t 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 🙏

@jamuhl jamuhl closed this as completed Mar 4, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants