Re: Django i18n_patterns default language

2020-02-24 Thread Aldian Fazrihady
You can add a middleware to ignore the header: class IgnoreLanguageHeaderLocaleMiddleware(LocaleMiddleware): LANGUAGE_HEADER = 'HTTP_ACCEPT_LANGUAGE' def process_request(self, request): if self.LANGUAGE_HEADER in request.META: del request.META[self.LANGUAGE_HEADER]

Re: Django i18n_patterns default language

2020-02-23 Thread Szocs Arnold
Is there any solution to add language prefix to the URL from the settings.LANGUAGE_CODE which is my preferred language. Instead from "Accept-Language" header. I do not want to use the browser language. On Fri, Feb 21, 2020 at 4:14 PM Aldian Fazrihady wrote: > A web browser has language preferen

Re: Django i18n_patterns default language

2020-02-21 Thread Aldian Fazrihady
A web browser has language preference setting. When a request made to your Django server, your browser reads its language preferences and it put it in the request "Accept-Language" header. Django will check if the request URL has language prefix in it. If it doesn't it will add language prefix to

Django i18n_patterns default language

2020-02-21 Thread Szocs Arnold
I am using i18n_patterns to change the language prefix in url. It s working fine ones the language cookie is set. The problem is that it's adding /en/ when I trying to access a page without the language code in private window, even though my preferred language is not en (the default one set in