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
def pass_through(to_translate): return to_translate
lang=locale.getdefaultlocale()[0][0:2]
if lang=="en":
(lang, charset) = locale.getdefaultlocale()
if lang==None or lang[:2]=="en":
translation=pass_through
else:
import gettext