Default to 'en' in get_addon_translator() if locale.getlocale()[0] returns None

svn: r13483
This commit is contained in:
Doug Blank 2009-11-03 00:34:12 +00:00
parent f822b4b8a0
commit 9130ddd23a

View File

@ -79,7 +79,7 @@ def get_addon_translator(filename, domain='addon'):
Assumes filename_dir/locale/LANG/LC_MESSAGES/addon.mo.
"""
import locale
LANG = locale.getlocale()[0]
LANG = locale.getlocale()[0] or "en"
path = os.path.dirname(os.path.abspath(filename))
trans = Translator(LANG)
try: