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

react-i18next:: i18n.languages were undefined or empty #1803

Open
AlemTuzlak opened this issue Sep 18, 2024 · 1 comment
Open

react-i18next:: i18n.languages were undefined or empty #1803

AlemTuzlak opened this issue Sep 18, 2024 · 1 comment

Comments

@AlemTuzlak
Copy link

🐛 Bug Report

I was implementing react-i18next in Remix and I got the error from the title. I guess this isn't technically a bug but I wanted to check with you guys if it made sense to change the behavior a bit or warn the user of the error. What happened is that I had setup everything properly and I by accident set the fallbackLng to be something other than the supportedLngs. Namely, I set the fallbackLng to be en_GB instead of en-GB which silently failed and resulted in the error above in the browser and the server. I switched it to the correct locale and it worked.

I would like to check if you would be open to just adding something like a log message saying "The fallback language you provided does not exist in your supported languages" just to maybe help people in the future who face the same issue

To Reproduce

detection: {
  supportedLanguages: ["en", "de"],
  fallbackLanguage: "random",
},

Expected behavior

Get at least a console log that it doesn't exist in the supportedLanguages

Your Environment

  • runtime version: node 22
  • i18next version: 23.13.0
  • os: Windows
  • any other relevant information
@adrai
Copy link
Member

adrai commented Sep 18, 2024

Yes, we're open for such a warning message...
something like: https://github.com/i18next/i18next/blob/master/src/i18next.js#L163
feel free to provide a PR in the i18next repository...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants