1
0
mirror of https://github.com/gryf/wicd.git synced 2025-12-24 07:02:29 +01:00

Fix crash when trying to use an unavaiable locale.

This commit is contained in:
Dan O'Reilly
2009-08-01 21:25:58 -04:00
parent 08fc68a459
commit 0467dd8fce

View File

@@ -44,11 +44,10 @@ def get_gettext():
lc, encoding = locale.getdefaultlocale(envvars=('LC_MESSAGES',
'LC_ALL', 'LANG',
'LANGUAGE'))
langs += [lc]
except ValueError, e:
print str(e)
print "Default locale unavailable, falling back to en_US"
if (lc):
langs += [lc]
langs += ["en_US"]
lang = gettext.translation('wicd', local_path, languages=langs,
fallback=True)