Opened 7 years ago
Closed 7 years ago
#28546 closed Bug (fixed)
Add support for private subtags in translation's to_locale().
Reported by: | Ronnie van den Crommenacker | Owned by: | Brent Hand |
---|---|---|---|
Component: | Internationalization | Version: | dev |
Severity: | Normal | Keywords: | i18n, translation, language |
Cc: | Triage Stage: | Accepted | |
Has patch: | yes | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | yes |
Easy pickings: | yes | UI/UX: | no |
Description
In Dutch we make a difference between formal and informal communications.
We're starting to implement this by using a private subtag nl-nl-x-informal
https://www.w3.org/International/articles/language-tags/#extension
Because of the sr-latn exception in the to_locale function the private subtag is formatted wrong.
>>> from django.utils.translation.trans_real import to_locale >>> to_locale('nl-nl-x-informal') nl_Nl-x-informal
While the country code should be with a capital L:
nl_NL-x-informal
Change History (5)
comment:1 by , 7 years ago
Triage Stage: | Unreviewed → Accepted |
---|
comment:2 by , 7 years ago
Owner: | changed from | to
---|---|
Status: | new → assigned |
comment:3 by , 7 years ago
Has patch: | set |
---|
comment:4 by , 7 years ago
Patch needs improvement: | set |
---|---|
Summary: | Django translations to_locale() function incorrectly formats private subtags → Add support for private subtags in translation's to_locale(). |
Note:
See TracTickets
for help on using tickets.
I have added the check to make sure that subtags are formatted properly. Here is the link to the PR https://github.com/django/django/pull/8995