Removed to_lower parameter for translation's to_locale().
Unused since
@@ -56,16 +56,10 @@ def reset_cache(**kwargs):
get_supported_language_variant.cache_clear()
-def to_locale(language, to_lower=False):
- """
- Turn a language name (en-us) into a locale name (en_US). If 'to_lower' is
- True, the last component is lower-cased (en_us).
- """
+def to_locale(language):
+ """Turn a language name (en-us) into a locale name (en_US)."""
p = language.find('-')
if p >= 0:
- 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()
