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

trunk, experimental:

- Fix crash if default locale isn't supported.
This commit is contained in:
imdano
2008-09-20 19:13:34 +00:00
parent f71ca63667
commit 1714444cf7

View File

@@ -276,7 +276,11 @@ def get_gettext():
# http://www.learningpython.com/2006/12/03/translating-your-pythonpygtk-application/
local_path = wpath.translations
langs = []
lc, encoding = locale.getdefaultlocale()
try:
lc, encoding = locale.getdefaultlocale()
except ValueError, e:
print str(e)
print "Default locale unavailable, falling back to en_US"
if (lc):
langs = [lc]
osLanguage = os.environ.get('LANGUAGE', None)