refactor this to not use gettext's __builtin__ hack
This commit is contained in:
parent
d6d3192d82
commit
a5cccbe757
|
@ -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
|
||||
|
||||
|
|
Loading…
Reference in New Issue