#29425: Auto language redirect does not work if prefix_default_language=False in
root URLConf
-------------------------------------+-------------------------------------
Reporter: Nathan Humphreys | Owner: nobody
Type: Bug | Status: new
Component: | Version: 1.11
Internationalization |
Severity: Normal | Resolution:
Keywords: | Triage Stage:
| Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Carlton Gibson):
* cc: Carlton Gibson (added)
Comment:
So why is the behaviour as it is?
[https://github.com/django/django/pull/6264#issuecomment-194897558
Explanation from PR 6264], which added the extra test and behaviour:
> The redirect should only happen on `/` URL, with
`prefix_default_language` set to `True` (default behaviour).
>
> Each other request (like `/fr/whatever/`) should not look at `Accept-
Language` header at all,
> just serve the page for the language requested in URL.
>
> When the `prefix_default_language` is `False` the `/` url is the same as
`/en/`
> (with `settings.LANGUAGE_CODE=en`) so we should just ignore the `Accept-
Language` here.
--
Ticket URL: <https://code.djangoproject.com/ticket/29425#comment:5>
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 post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/069.d14e93c527f68d702d4401a69c561e78%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.