#12230 closed (fixed)
to_locale not working with sr_Latn
Reported by: | Janoš | Owned by: | nobody |
---|---|---|---|
Component: | Internationalization | Version: | 1.1 |
Severity: | Keywords: | ||
Cc: | janos@… | Triage Stage: | Accepted |
Has patch: | yes | Needs documentation: | no |
Needs tests: | yes | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
There is a bug in function to_locale in django/utils/translation/trans_real.py when trying to get locale for sr-latn language.
In [1]: from django.utils.translation import to_locale In [2]: to_locale('sr-latn') Out[2]: 'sr_LATN'
The output should be 'sr_Latn'. It is an exception that is overlooked when new language has been added.
Because of the wrong caption Django won't recognize 'sr_Latn' folder with translations when searching trough 'locale' folders.
Patch that I have provided solves the problem, but there could be a different condition under if.
Attachments (1)
Change History (6)
by , 15 years ago
Attachment: | 01-trans_real.diff added |
---|
comment:1 by , 15 years ago
Triage Stage: | Unreviewed → Accepted |
---|
comment:2 by , 15 years ago
Needs tests: | set |
---|
comment:3 by , 15 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
comment:4 by , 15 years ago
Note:
See TracTickets
for help on using tickets.
(In [12056]) Fixed #12230 - Updated utils.translation.to_locale to support the special sr_Latn locale. Thanks to Janos Guljas.