Get 'language is not included' error on first time page request
See original GitHub issueWhen I request page at first time. I get Invalid configuration: Current language is not included in all languages array
in the browser console.
Also, If I remove i18next
cookie and then refresh the page. The error message is occurred too.
This error message is only occurred when I enable localeSubpaths
.
Issue Analytics
- State:
- Created 5 years ago
- Comments:38 (35 by maintainers)
Top Results From Across the Web
Get 'language is not included' error on first time page request
When I request page at first time. I get Invalid configuration: Current language is not included in all languages array in the browser ......
Read more >What went wrong? Troubleshooting JavaScript - MDN Web Docs
This one is pretty simple — it generally means that you've missed the closing parenthesis at the end of a function/method call. Note:...
Read more >Common .NET Software Errors and How to Fix Them - Stackify
We've aggregated the 50 top .NET software errors. It includes exceptions, broken data bindings, memory leaks, etc. Find solutions on ways to ...
Read more >Rails Internationalization (I18n) API - Ruby on Rails Guides
Getting the locale from params and setting it accordingly is not hard; including it in every URL and thus passing it through the...
Read more >Design-time errors in the Windows Forms Designer
Error message: "A requested language parser is not installed. The language parser name is '{0}'." Visual Studio attempted to a load a designer ......
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
If you do not want
changeLanguage('en-US')
to be called, and therefore want to assert thatallLanguages.includes(currentLanguage)
when a language change occurs, then you cannot do so whileconfig.load === 'languageOnly'
.If the intended behavior is for someone who prefers
'en-US'
to have their language set to'en'
, and to not support awhitelist
that has regional locales, then you can assert something likeallLanguages.includes(currentLanguage.slice(0, 2))
. However, in practice, users’ accept-language headers that contain'en-US'
will most likely also include'en'
somewhere in it, as well.Setting
config.load = 'currentOnly'
ensures thatallLanguages
will always includecurrentLanguage
and that the only languages that we attempt to use are the ones that are on ourwhitelist
.@isaachinman Sorry - just getting to this now. I believe that’s all that was needed. You’re most welcome.