#34069: get_language_from_request should not fallback to settings.LANGUAGE_CODE
-------------------------------------+-------------------------------------
Reporter: | Owner: nobody
sergioisidoro |
Type: | Status: new
Cleanup/optimization |
Component: | Version: 4.1
Internationalization | Keywords: i18n
Severity: Normal | get_language_from_request
Triage Stage: | middleware
Unreviewed | Has patch: 0
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 1
UI/UX: 0 |
-------------------------------------+-------------------------------------
I'm writing a middleware to fallback to a different language depending on
the TLD of the domain of the HTTP_HOST
However, I noticed that `get_language_from_request` falls back to the
settings default language, which will almost always take precedence in
this case.
This is quite confusing, since `settings.LANGUAGE_CODE` is not "from the
request", but from the application configuration, and it feels that the
responsibility of falling back to the default language should lie in the
Middleware, not in this function.
--
Ticket URL: <https://code.djangoproject.com/ticket/34069>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/01070183984e059a-81e171db-d517-4f9f-a767-62ce45803b56-000000%40eu-central-1.amazonses.com.