With this configuration only the first page view redirects correctly from url.com to url.com/de. As soon as Kirby has set its cookie all following page views redirects to url.com/en.
What can cause this behavior? Is this a known bug or am I doing something wrong?
Hi,
okay you are right. I tested it with different commatas and everything worked fine.
Also the position, if before or after the arrays of language.detect, is equal.
Have you set your content files also with the right naming?
@JanStieler:
Exactly, the syntax is fine even with commata. Also the content files are setup correctly. And the translation itself works perfectly. It’s just the odd behaviour of the language detection.
@mbochynski
Maybe I’m just getting it wrong, but I cannot see how your configuration would work properly. Aren’t you taking away the possibility for users to choose the language by themselves this way?
You have defined “/” as entry point to Norwegian and “/pl” for Polski. Even if the detection only takes place at the base url, users from Poland couldn’t choose the Norwegian version because the site would always redirect them to the version in Polski. Is this the behavior you want to achieve?
For me language detection would only make sense with the following assumptions:
Detection only comes in action on the base url of the site
As shown in my example all language versions of the site are accessable by the language code in the url.
This way it should be possible to use language detection AND let the users change the language by using a language switcher. I think this is a common and adequate way to integrate language detection (microsoft.com is doing it this way for example).
Any thoughts on this? Can anyone tell me how the language detection in Kirby actually really works?
Hey, I know that this is a old issue but I tried to get the language kit from kirby (clean install) to reflect what my issue is.
I have tested again and again with and I do not get this to work. So I have cleaned the cache and also I have only used Firefox for my tests. The issue is consistent.
###So my issue:
The languages detect worked fine until I added the third language Portuguese. With english and Norwegian it worked. Then I added the last language, then the automatic switching stops not working. Also when I then try to go back it does´t work anymore.