Locale: Deal with locale initialisation more safely

This commit is contained in:
Worros 2010-09-22 16:37:56 +08:00
parent 0049cfbd3c
commit 2c8f219c50

View File

@ -34,8 +34,8 @@ import Configuration
import Exceptions import Exceptions
import locale import locale
lang=locale.getdefaultlocale()[0][0:2] (lang, charset) = locale.getdefaultlocale()
if lang=="en": if lang = None or lang == "en":
def _(string): return string def _(string): return string
else: else:
import gettext import gettext