-
Notifications
You must be signed in to change notification settings - Fork 33
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
feat: allow browser language detection #371
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah I just realized that #350 isn't about spanish not activating, it's about some translations missing in spanish. This is currently a manual process, so not all of the keys in english have spanish counterparts. It falls back to english, so you see english in those cases. This is not a configuration issue.
While working on this, I noticed translation doesn't happen automatically with the browser language setting - this is on Chrome(Brave, Chromium). Modifying the |
Based on what I'm seeing in the README for that project, it will use the navigator but only after checking the other sources. It looks like it saves a LS key based on the initial detected language from navigator, then uses that going forward. So if you change your browser language settings, it will still use the old one based on the key that was saved. I think it would be wise to retain this behavior in the future, if we want to add a language selector. Perhaps you should just empty out the |
fdb2d9e
to
de743cb
Compare
This makes sense, took me a while to get the logic! Thanks for pointing this out. |
de743cb
to
7dbaa7e
Compare
Resolves #350
This PR allows i18next to detect the language set in the user's browser and translate the page.
Translation happens seamlessly now.