refactor this to not use gettext's __builtin__ hack

This commit is contained in:
Chris Jones 2009-08-18 13:43:39 +01:00
parent d6d3192d82
commit a5cccbe757

View File

@ -20,16 +20,18 @@
from version import APP_NAME
from util import dbg
_ = None
try:
import gettext
gettext.install(APP_NAME)
gettext.textdomain(APP_NAME)
_ = gettext.gettext
except ImportError:
dbg("Using fallback _()")
import __builtin__
def dummytrans (text):
"""A _ function for systems without gettext. Effectively a NOOP"""
return(text)
__builtin__.__dict__['_'] = dummytrans
_ = dummytrans