Skip to content
● Grav 2.2 is out: 2x faster cold starts and 96% less memory on big sites. Read the announcement →

LangSwitcher get's overwritten by the browser's default language

plugins

Started by Nicolas 4 years ago · 1 replies · 518 views
4 years ago

Dear Grav community,

I'm working on an issue I have with our website: https://netilion.endress.com/
The problem is related to the language selection. Our website is available in 7 different languages. We use LangSwitcher v1.5.0 on Grav v1.7.34.

We also use a language detection code that detects your browser's preferred language and sets it automatically. The problem is that whenever you have a browser default language that isn't English, and you try to go to English, it automatically jumps back to your default browser language.
Example: Browser default language German, I open the website -> Jumps automatically to to the german language (/de at the end). I switch my language to English, but still I get redirected to German.
It seems normal since we are detecting the language.

Is there any way I can ignore the browser default language whenever I've decided to display the website in English anyway?

Thank you so much.
Nico

4 years ago

@nicolas.mangold:
We also use a language detection code that detects your browser’s preferred language and sets it automatically

I think in this code there should be some logic, which would skip the detection if user selects language explicitly

Suggested topics

Topic Participants Replies Views Activity
Plugins · by renedebaaij, 2 days ago
0 36 2 days ago
Plugins · by complanar, 3 weeks ago
6 389 2 weeks ago
Plugins · by BenLaKnet, 2 weeks ago
1 208 2 weeks ago
Plugins · by complanar, 1 month ago
2 482 4 weeks ago
Plugins · by Vladimir Novak, 2 months ago
3 761 2 months ago