summaryrefslogtreecommitdiff
path: root/django/utils
diff options
context:
space:
mode:
authorJannis Leidel <jannis@leidel.info>2010-01-01 21:38:34 +0000
committerJannis Leidel <jannis@leidel.info>2010-01-01 21:38:34 +0000
commit855e805b4cd1ce40751ef166d36cc6f0ae2a2519 (patch)
treeb0cf2cab5c175e4fbca84fd1517c1bd0284f8473 /django/utils
parent18c31f608f8dec24386941c37c8bfb7cc731d227 (diff)
Fixed #12230 - Updated utils.translation.to_locale to support the special sr_Latn locale. Thanks to Janos Guljas.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@12056 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'django/utils')
-rw-r--r--django/utils/translation/trans_real.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/django/utils/translation/trans_real.py b/django/utils/translation/trans_real.py
index 8b7db0f123..3f13d79290 100644
--- a/django/utils/translation/trans_real.py
+++ b/django/utils/translation/trans_real.py
@@ -41,6 +41,9 @@ def to_locale(language, to_lower=False):
if to_lower:
return language[:p].lower()+'_'+language[p+1:].lower()
else:
+ # Get correct locale for sr-latn
+ if len(language[p+1:]) > 2:
+ return language[:p].lower()+'_'+language[p+1].upper()+language[p+2:].lower()
return language[:p].lower()+'_'+language[p+1:].upper()
else:
return language.lower()