def gettext(string, *args, **variables):
"""
gettext(u'Hello World!')
gettext(u'Hello %(name)s!', name='World')
gettext(u'Hello %s!', 'World')
"""
t = get_translations()
if t is None:
return string if not variables else string % variables
s = t.ugettext(string)
if args:
return s % args
else:
return s if not variables else s % variables
like this: