Skip to content
Grav 2.0 is officially stable. Read the announcement →
Plugins

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

plugins

Started by Nicolas 4 years ago · 1 replies · 442 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 Vladimir Novak, 2 weeks ago
3 293 2 weeks ago
Plugins · by Mathieu Lecouturier, 3 weeks ago
3 277 3 weeks ago
Plugins · by Slebeig, 2 months ago
1 403 2 months ago
Plugins · by Rene, 2 months ago
2 574 2 months ago
Plugins · by Xavier, 3 months ago
2 490 3 months ago