L10n.py: Make safer

This commit is contained in:
Worros 2010-09-22 23:41:09 +08:00
parent 02aa42a987
commit 692cd4e6e4

View File

@ -18,8 +18,8 @@
import locale import locale
def pass_through(to_translate): return to_translate def pass_through(to_translate): return to_translate
lang=locale.getdefaultlocale()[0][0:2] (lang, charset) = locale.getdefaultlocale()
if lang=="en": if lang==None or lang[:2]=="en":
translation=pass_through translation=pass_through
else: else:
import gettext import gettext