-
Notifications
You must be signed in to change notification settings - Fork 26
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
Session storage "traps" user in a language #46
Comments
I have the same problem. My website is French and English. I did choose “include_default_lang: true” so the /fr doesn’t appear, only /en for English content. I wanted to activate “http_accept_language: true” so it switch to the language of my visitor. That what I wanted, as my browser is not in French. But when I click on the French language link to see the French content, I’m still being redirected to English. I manage to make it work by putting “include_default_lang: false” and having the /fr in the url. I didn't find a way to use "include_default_lang: true" and "http_accept_language: true" together. |
@agryson Does this happen only on clicking the lang switcher or if you attempt to change url via the browser url bar too? Just in case it's not a plugin issue but a Grav issue |
Attempting to change url via the browser works. |
I'm also running into this issue and exactly like the op determined, The langswitcher templates follow the So I think the fix could simply be to always include the language instead of using P.S. For reference, it looks like #12 described this same issue. |
Can this be tested with latest develop branch? that logic has been rewritten. |
Context
I have a site set up so that English is the default language and French is a second language.
When the user switches to French,
/fr/
is inserted just after the rootme.net/page
->me.net/fr/page
.With
session_store_active : false
this behaviour works as expected both ways, changing language will add or remove the/fr/
appropriately.Issue
However, setting
session_store: true
"traps" the user in French: trying to change the language to English points the user tome.net/page
as expected but a302
redirect bounces them back tome.net/fr/page
.Changing just the
session_store
setting and nothing else makes this behaviour systematically repeatable.Useful data
The text was updated successfully, but these errors were encountered: