Doesn't start when using "C" locale (Fixes issue 29).

This commit is contained in:
Adam Waldenberg 2014-11-24 09:36:11 +01:00
parent 3010359eb2
commit 8755fb33dc
1 changed files with 7 additions and 4 deletions

View File

@ -51,11 +51,14 @@ def init():
lang = locale.getdefaultlocale()
os.environ['LANG'] = lang[0]
filename = basedir.get_basedir() + "/translations/messages_%s.mo" % lang[0][0:2]
if lang[0] is not None:
filename = basedir.get_basedir() + "/translations/messages_%s.mo" % lang[0][0:2]
try:
__translation__ = gettext.GNUTranslations(open(filename, "rb"))
except IOError:
try:
__translation__ = gettext.GNUTranslations(open(filename, "rb"))
except IOError:
__translation__ = gettext.NullTranslations()
else:
__translation__ = gettext.NullTranslations()
__enabled__ = True