Normal Setup with latest WordPress & Polylang Pro.
with Detect Browser Language: Off
Default Language is ‘ar’ assuming secondary is ‘en’.
Using Language Switcher when i switch to ‘en’ url is being “/en/home/”
so when i switch to ‘ar’ it reverts to “/” which is base url.
The Issue :
When i’m on “/en/home/” which is ‘en’ lang.
if i remove that from the URL and leave it as base “/” the language is resetting to ‘ar’ and site becomes “arabic”.
after debugging i discovered that everytime i browse a url, it’s setting or resetting the Cookie: pll_language based on the language in the URL.
That’s not a basic behavior. it should only set the Cookie when i use the Language Switcher to prevent the Cookie from being reset everytime i visit a page with different language.
Let’s say i removed ‘/en/home’ from URL. if the Cookie is set to ‘en’ it should redirect me back to ‘en/home’ and also for all pages with ‘en’ language.
Then only become ‘ar’ when i use the Language Switcher.
What i’m thinking, if a user have chosen a language and visited the site later. if the cookie is set from the last time. it should redirect to the desired language.
even if the URL of the page contains the other language which he didn’t set.
I have define('WP_CACHE', true);
set in wp-config.php
I hope i’ve made it clear enough.
So the question: is this the normal behavior for the plugin or it’s something tricky on my end?
Thanks.