#24063: Locale code validation too strict
--------------------------------------+------------------------------------
     Reporter:  nijel                 |                    Owner:  nobody
         Type:  New feature           |                   Status:  new
    Component:  Internationalization  |                  Version:  master
     Severity:  Normal                |               Resolution:
     Keywords:                        |             Triage Stage:  Accepted
    Has patch:  1                     |      Needs documentation:  0
  Needs tests:  0                     |  Patch needs improvement:  1
Easy pickings:  0                     |                    UI/UX:  0
--------------------------------------+------------------------------------
Changes (by claudep):

 * 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>
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 django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/063.4e4eaf3e459f3602b598fd7ad2ae6a6b%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to