wagtail / wagtailtrans

A Wagtail add-on for supporting multilingual sites
http://wagtailtrans.readthedocs.io/
BSD 3-Clause "New" or "Revised" License
104 stars 60 forks source link

Wrong locale assignment to Translated page #198

Open irugoy opened 3 years ago

irugoy commented 3 years ago

Hi there, I've two separates page trees, EN and DE like this

if I browse to /en/home-en/agenda-en/ and prints out the {{ LANGUAGE_CODE }} in template it says 'en' which is correct, but if I try to access /en/home-de/agenda-de/ I actually get to see the DE content but the {{ LANGUAGE_CODE }} still being 'en' which it should not be possible, I should see 'de' instead.

I would expect that if the translation language of the page that is being accessed is 'de' but the locale prefix in URL is not the same then the user should get redirected with the proper locale prefix

So this /en/home-de/agenda-de/ should redirect the user to /de/home-de/agenda-de/

Thanks