#32581: to_locale should be idempotent
------------------------------------------------+------------------------
               Reporter:  Claude Paroz          |          Owner:  nobody
                   Type:  Cleanup/optimization  |         Status:  new
              Component:  Internationalization  |        Version:  dev
               Severity:  Normal                |       Keywords:
           Triage Stage:  Unreviewed            |      Has patch:  0
    Needs documentation:  0                     |    Needs tests:  0
Patch needs improvement:  0                     |  Easy pickings:  0
                  UI/UX:  0                     |
------------------------------------------------+------------------------
 In summary:
 {{{
 >>> from django.utils.translation import to_locale
 >>> to_locale('en-us')
 'en_US'  # <- Fine
 >>> to_locale(to_locale('en-us'))
 'en_us'  # <- Bad
 }}}

 Typically, this breaks using e.g. `django.utils.translation.override` with
 a locale code like `pt_BR` or `zh_Hans`. of course, we could document that
 override takes a language code, not a locale code, but if we can support
 both without much effort, this would be a lot better.

-- 
Ticket URL: <https://code.djangoproject.com/ticket/32581>
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/050.6c9df18d2a991dfc28947dbea0118c7e%40djangoproject.com.

Reply via email to