So adding a translations to existing site is more seamless - it does not
require changing current urls, just adding new ones.
That pattern with un-prefixed default language is pretty common - for
example https://www.apple.com (which is en_US) and
https://www.apple.com/fr/ (fr_FR).
Any other language than the default one is prefixed as before using
i18n_patterns.
The idea for that is having a `prefix_default_language` param to`
i18n_patterns`, which is `True` by default, to keep it compatible with
current appriach. Setting it to `False` will turn on this "feature".
Here's the code: https://github.com/django/django/pull/5823
--
Ticket URL: <https://code.djangoproject.com/ticket/25933>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
* needs_better_patch: => 0
* needs_tests: => 0
* needs_docs: => 0
* type: Uncategorized => New feature
Old description:
> The idea is to allow having the default language urls un-prefixed.
>
> So adding a translations to existing site is more seamless - it does not
> require changing current urls, just adding new ones.
>
> That pattern with un-prefixed default language is pretty common - for
> example https://www.apple.com (which is en_US) and
> https://www.apple.com/fr/ (fr_FR).
>
> Any other language than the default one is prefixed as before using
> i18n_patterns.
>
> The idea for that is having a `prefix_default_language` param to`
> i18n_patterns`, which is `True` by default, to keep it compatible with
> current appriach. Setting it to `False` will turn on this "feature".
>
> Here's the code: https://github.com/django/django/pull/5823
New description:
The idea is to allow having the default language urls un-prefixed.
So adding a translations to existing site is more seamless - it does not
require changing current urls, just adding new ones.
That pattern with un-prefixed default language is pretty common - for
example https://www.apple.com (which is en_US) and
https://www.apple.com/fr/ (fr_FR).
Any other language than the default one is prefixed as before using
i18n_patterns.
The idea for that is having a `prefix_default_language` param to`
i18n_patterns`, which is `True` by default, to keep it compatible with
current approach. Setting it to `False` will turn on this "feature".
Here's the code: https://github.com/django/django/pull/5823
--
--
Ticket URL: <https://code.djangoproject.com/ticket/25933#comment:1>
Comment (by timgraham):
Claude, does this proposal look reasonable?
--
Ticket URL: <https://code.djangoproject.com/ticket/25933#comment:2>
* needs_docs: 0 => 1
* has_patch: 0 => 1
* needs_tests: 0 => 1
* stage: Unreviewed => Accepted
--
Ticket URL: <https://code.djangoproject.com/ticket/25933#comment:3>
* needs_docs: 1 => 0
* needs_tests: 1 => 0
--
Ticket URL: <https://code.djangoproject.com/ticket/25933#comment:4>
* stage: Accepted => Ready for checkin
--
Ticket URL: <https://code.djangoproject.com/ticket/25933#comment:5>
* status: new => closed
* resolution: => fixed
Comment:
In [changeset:"839a955d08fa0657622ed9b60fdd262658fa659f" 839a955d]:
{{{
#!CommitTicketReference repository=""
revision="839a955d08fa0657622ed9b60fdd262658fa659f"
Fixed #25933 -- Allowed an unprefixed default language in i18n_patterns().
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/25933#comment:6>
Comment (by Tim Graham <timograham@…>):
In [changeset:"85a4844f8a8e628b90fa30ba7074f162a2d188ef" 85a4844f]:
{{{
#!CommitTicketReference repository=""
revision="85a4844f8a8e628b90fa30ba7074f162a2d188ef"
Refs #25933 -- Fixed i18n_patterns() prefix_default_language=False with
HTTP_ACCEPT_LANGUAGE header.
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/25933#comment:7>