We have pages with language prefix, like /en/code-of-conduct/ and /he/code-of-conduct/ but if a user enters one of them with the wrong language chosen (through session or browser preferences) then they may get a mixed page -- Hebrew content in a LTR page with english menu and sidebar, or vice versa.
If the URL has a language prefix, we need to make sure the indicated language is active.
We have pages with language prefix, like
/en/code-of-conduct/
and/he/code-of-conduct/
but if a user enters one of them with the wrong language chosen (through session or browser preferences) then they may get a mixed page -- Hebrew content in a LTR page with english menu and sidebar, or vice versa.If the URL has a language prefix, we need to make sure the indicated language is active.
See https://docs.djangoproject.com/en/2.0/topics/http/middleware/ for Django Middleware, the right component for handling this See https://docs.djangoproject.com/en/2.0/ref/middleware/#module-django.middleware.locale for the Django built-in language-selecting middleware
Thanks @AmitAronovitch for noticing