Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAleksey Lim <alsroot@member.fsf.org>2009-12-31 00:45:42 (GMT)
committer Aleksey Lim <alsroot@member.fsf.org>2009-12-31 00:45:42 (GMT)
commitb5c840e6720b5a26c05d67c26abc65bec5132787 (patch)
treebde452b4c4d8eed23ff2c979956cbbb7e4a18038
parent5e0442b852fefbac337677a151e0af9cc5de11a1 (diff)
Do not fail if LANG wasn't set
-rw-r--r--lessons.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/lessons.py b/lessons.py
index 2766e0b..35a6922 100644
--- a/lessons.py
+++ b/lessons.py
@@ -66,7 +66,8 @@ class View(gtk.EventBox):
self.show_all()
-_lang = locale.getdefaultlocale()[0].split('_')[0]
+_locale = locale.getdefaultlocale()[0]
+_lang = _locale and _locale.split('_')[0] or 'en'
if not os.path.isdir(theme.path('lessons', _lang)):
logging.info('Cannot find lessons for language %s, thus use en' % _lang)