From 692cd4e6e4282c2e84fbd070dac75817e105a1ed Mon Sep 17 00:00:00 2001 From: Worros Date: Wed, 22 Sep 2010 23:41:09 +0800 Subject: [PATCH] L10n.py: Make safer --- pyfpdb/L10n.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pyfpdb/L10n.py b/pyfpdb/L10n.py index c6e6036a..9510df0b 100644 --- a/pyfpdb/L10n.py +++ b/pyfpdb/L10n.py @@ -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