Default to 'en' in get_addon_translator() if locale.getlocale()[0] returns None
svn: r13483
This commit is contained in:
parent
f822b4b8a0
commit
9130ddd23a
@ -79,7 +79,7 @@ def get_addon_translator(filename, domain='addon'):
|
|||||||
Assumes filename_dir/locale/LANG/LC_MESSAGES/addon.mo.
|
Assumes filename_dir/locale/LANG/LC_MESSAGES/addon.mo.
|
||||||
"""
|
"""
|
||||||
import locale
|
import locale
|
||||||
LANG = locale.getlocale()[0]
|
LANG = locale.getlocale()[0] or "en"
|
||||||
path = os.path.dirname(os.path.abspath(filename))
|
path = os.path.dirname(os.path.abspath(filename))
|
||||||
trans = Translator(LANG)
|
trans = Translator(LANG)
|
||||||
try:
|
try:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user