I will provide pull request for this.
--
Ticket URL: <https://code.djangoproject.com/ticket/24063>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
* needs_better_patch: => 0
* needs_tests: => 0
* needs_docs: => 0
Comment:
Pull requests for master and 1.7.x:
https://github.com/django/django/pull/3815
https://github.com/django/django/pull/3816
--
Ticket URL: <https://code.djangoproject.com/ticket/24063#comment:1>
* version: 1.7 => master
* stage: Unreviewed => Accepted
--
Ticket URL: <https://code.djangoproject.com/ticket/24063#comment:2>
* type: Uncategorized => New feature
--
Ticket URL: <https://code.djangoproject.com/ticket/24063#comment:3>
* needs_better_patch: 0 => 1
Comment:
I think this issue is a little more complicated. There are several
families of language codes. But basically, we are handling two different
ones in Django:
- IETF Language tags coming from the browser, defined in
http://tools.ietf.org/html/rfc5646
- POSIX locale codes (http://en.wikipedia.org/wiki/Locale) which is the
format used by gettext translations file names.
We should not mix those. See also
`django.utils.translation.trans_real.to_locale/to_language` which is the
code trying to map strings from one code to the other. To correctly handle
script variants, there is surely some more clever mapping work to do (e.g.
`Cyrl` in RFC5646 should map to `@cyrillic` in the POSIX locale).
--
Ticket URL: <https://code.djangoproject.com/ticket/24063#comment:4>
Comment (by nijel):
Indeed handling Language tags coming from the browser is not covered by my
patch. What I've tried to address is to allow Django to set such locale
manually. Automatic mapping of browser locales would be indeed nice.
--
Ticket URL: <https://code.djangoproject.com/ticket/24063#comment:5>
* needs_better_patch: 1 => 0
Comment:
Claude, could you check the pull request now?
--
Ticket URL: <https://code.djangoproject.com/ticket/24063#comment:6>
* stage: Accepted => Ready for checkin
--
Ticket URL: <https://code.djangoproject.com/ticket/24063#comment:7>
* status: new => closed
* resolution: => fixed
Comment:
In [changeset:"76d26d89220f5740103a16bf71df2ae255c00da4" 76d26d89]:
{{{
#!CommitTicketReference repository=""
revision="76d26d89220f5740103a16bf71df2ae255c00da4"
Fixed #24063 -- Allowed locale variants supported by gettext.
The locale code can contain a variant after @, so allowed that.
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/24063#comment:8>