Example #1
0
 def handle_request(request):
     h = object.__new__(TemplateHandler)
     h.__init__(request)
     h.template_name = template_name
     h.status_code = status_code
     h.helpers = {
         "_": ref_gettext(h.options["translations_manager"][h.locale][translation_name]),
         "locale": h.locale,
         "path_for": h.path_for,
         "principal": h.principal,
         "route_args": h.route_args,
     }
     return h()
Example #2
0
 def list_password_questions(self, locale):
     gettext = ref_gettext(translations[locale])
     return tuple((k, gettext(v)) for k, v in db['password_question'])
Example #3
0
 def _(self):
     return ref_gettext(self.translation)
Example #4
0
 def gettext(self):
     return ref_gettext(translations[self.locale])