-
Notifications
You must be signed in to change notification settings - Fork 16
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
UI problem with translation - fallbackLng not working #36
Comments
Fix should be fallbackLng setting. |
This would be problem for many different languages, when there are multiple different ways how to express them in browser headers. Chrome seems to provide always multiple variation of language tag in it's header. |
Alternative solution (if we assume that the Chrome browser will always provide also shorter tag equivalent such as "sk") would be change the behaviour of language select menu to handle this case. |
@nitram147 I documented a potential solution in #37. It uses a util method on I wasn't sure how to really mimic setting the language to I marked the PR as draft. Can you see if this solves the issue for you? |
I encountered this problem during usage of Chrome browser, Firefox works fine (reason mentioned below).
Browser is sending following Accept-Language request header "sk-SK;sk" (for comparison Firefox is only sending "sk").
i18n tries to fetch "sk-SK" and fail with the following error (because node backend return some default html instead of json - the locales/sk-SK/translation.json path don't exists):
Next it tries to use "sk" language and succeed. However the language swapping select stay with "EN" option selected:
So in case you want to swap your language to English, you have to select Slovak/Swedish language (swapping select pretends to be checked on "EN" option) and then select "EN" option. This can confuse users to think that there isn't English localization available.
The text was updated successfully, but these errors were encountered: