-
-
Notifications
You must be signed in to change notification settings - Fork 47
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
Only first browser locale is matched, and others ignored (most cases) #68
Comments
I was having an issue. It reverted to the browser locale even though I set it to another. Is that related to this bug? |
I don't think so. It looks like that your session data / cookie was lost.
|
Sometimes when I open the page, it shows different languages on the page and the plugin. For example page loads in Turkish but it shows EN (English) in the up-right switcher. |
As @wq9578 said if session and cookies are lost then it will default to the browser locale then the app locale. |
It was a PR didn't notice the issue with the loops. Nice catch 👍 |
Due to a bug only the first browser locale is matched.
In most cases the second browser locale is relevant (
en
inen-US,en;...
).The buggy foreach loop then returns null, which means the browser locale is ignored.
Fixed source file below, see function
getBrowserLocale
.Also some minor optimization added (
LanguageSwitch::make()->getLocales()
only called once).The text was updated successfully, but these errors were encountered: