from six import PY3, iteritems
+from mediagoblin import mg_globals
+
if PY3:
from email.mime.text import MIMEText
from urllib import parse as urlparse
+ ugettext = mg_globals.thread_scope.translations.gettext
+ ungettext = mg_globals.thread_scope.translations.ngettext
else:
from email.MIMEText import MIMEText
import urlparse
+ ugettext = mg_globals.thread_scope.translations.ugettext
+ ungettext = mg_globals.thread_scope.translations.ungettext
from mediagoblin.tools.timesince import timesince
from mediagoblin.meddleware.csrf import render_csrf_form_token
+from mediagoblin._compat import ugettext, ungettext
SETUP_JINJA_ENVS = {}
'jinja2.ext.i18n', 'jinja2.ext.autoescape',
TemplateHookExtension] + local_exts)
- template_env.install_gettext_callables(
- mg_globals.thread_scope.translations.ugettext,
- mg_globals.thread_scope.translations.ungettext)
+ template_env.install_gettext_callables(ugettext, ungettext)
# All templates will know how to ...
# ... fetch all waiting messages and remove them from the queue