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 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