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

Community guidelines

Please keep discussions civil and on-topic. Repeated violations may lead to a temporary ban.

Plugins

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

plugins

Started by Nicolas 4 years ago · 1 replies · 352 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 Rene, 1 week ago
2 54 1 week ago
Plugins · by Xavier, 4 weeks ago
2 61 4 weeks ago
Plugins · by Luka Prinčič, 7 years ago
3 1188 1 month ago
Plugins · by Sebastian van de Meer, 1 month ago
1 54 1 month ago
Plugins · by PIERROT Alain, 2 months ago
3 79 2 months ago