Permalink
Browse files

Merge branch 'billboards3.6' into dev

  • Loading branch information...
2 parents 4b12c29 + fe7aa37 commit 019d90f0861dd047318ab1b3ae868697211ccb1f @jlongster jlongster committed Apr 17, 2012
Showing with 10 additions and 1 deletion.
  1. +10 −1 lib/l10n_utils/dotlang.py
View
@@ -36,9 +36,18 @@ def parse(path):
return trans
+def fix_case(locale):
+ """Convert lowercase locales to uppercase: en-us -> en-US"""
+ parts = locale.split('-')
+ if len(parts) == 1:
+ return locale
+ else:
+ return '%s-%s' % (parts[0], parts[1].upper())
+
+
def translate(text, files):
"""Search a list of .lang files for a translation"""
- lang = translation.get_language()
+ lang = fix_case(translation.get_language())
for file_ in files:
key = "dotlang-%s-%s" % (lang, file_)

0 comments on commit 019d90f

Please sign in to comment.