to_locale not working with sr_Latn
|Reported by:||janos||Owned by:||nobody|
|Has patch:||yes||Needs documentation:||no|
|Needs tests:||yes||Patch needs improvement:||no|
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 : from django.utils.translation import to_locale In : to_locale('sr-latn') Out: '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.
Change History (6)
Changed 6 years ago by janos
comment:1 Changed 5 years ago by jezdez
- Needs documentation unset
- Needs tests unset
- Patch needs improvement unset
- Triage Stage changed from Unreviewed to Accepted