Skip to content
● Meet Grav Guard: keep every Grav site you run secure and up to date, all from one place. Free for up to 3 sites. Read more →

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

plugins

Started by Nicolas 4 years ago · 1 replies · 621 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 DrPen, 1 month ago
2 478 1 month ago
Plugins · by renedebaaij, 2 months ago
1 350 1 month ago
Plugins · by Thomas, 1 month ago
1 375 1 month ago
Plugins · by complanar, 2 months ago
6 699 2 months ago
Plugins · by BenLaKnet, 2 months ago
1 642 2 months ago