Opened 14 years ago

Closed 14 years ago

Last modified 13 years ago

#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)

01-trans_real.diff (456 bytes ) - added by Janoš 14 years ago.

Download all attachments as: .zip

Change History (6)

by Janoš, 14 years ago

Attachment: 01-trans_real.diff added

comment:1 by Jannis Leidel, 14 years ago

Triage Stage: UnreviewedAccepted

comment:2 by Jannis Leidel, 14 years ago

Needs tests: set

comment:3 by Jannis Leidel, 14 years ago

Resolution: fixed
Status: newclosed

(In [12056]) Fixed #12230 - Updated utils.translation.to_locale to support the special sr_Latn locale. Thanks to Janos Guljas.

comment:4 by Jannis Leidel, 14 years ago

(In [12251]) [1.1.X] Fixed #12230 - Updated utils.translation.to_locale to support the special sr_Latn locale. Thanks to Janos Guljas.

Backport of r12056.

comment:5 by Jacob, 13 years ago

milestone: 1.2

Milestone 1.2 deleted

Note: See TracTickets for help on using tickets.
Back to Top