From 2c8f219c50ccccd889e35c36ad7b7650abda13d6 Mon Sep 17 00:00:00 2001 From: Worros Date: Wed, 22 Sep 2010 16:37:56 +0800 Subject: [PATCH] Locale: Deal with locale initialisation more safely --- pyfpdb/GuiBulkImport.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pyfpdb/GuiBulkImport.py b/pyfpdb/GuiBulkImport.py index cd374545..9c23e463 100755 --- a/pyfpdb/GuiBulkImport.py +++ b/pyfpdb/GuiBulkImport.py @@ -34,8 +34,8 @@ import Configuration import Exceptions import locale -lang=locale.getdefaultlocale()[0][0:2] -if lang=="en": +(lang, charset) = locale.getdefaultlocale() +if lang = None or lang == "en": def _(string): return string else: import gettext