Commits

Andriy Kornatskyy committed a28a5e3

Added ref_gettext - a helper function to get reference to translation unicode version of gettext cross python implementaions

Comments (0)

Files changed (2)

src/wheezy/core/comp.py

 else:  # pragma: nocover
     from urlparse import urlsplit
     from urlparse import urlunsplit
+
+if PY3:  # pragma: nocover
+    ref_gettext = lambda t: t.gettext
+else:  # pragma: nocover
+    ref_gettext = lambda t: t.ugettext

src/wheezy/core/i18n.py

 import gettext
 
 from wheezy.core.comp import defaultdict
+from wheezy.core.comp import ref_gettext
 from wheezy.core.collections import attrdict
 
 
+null_translations = gettext.NullTranslations()
+
+
 class TranslationsManager(object):
     """ Manages several languages and translation domains.
     """