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()
def list_password_questions(self, locale): gettext = ref_gettext(translations[locale]) return tuple((k, gettext(v)) for k, v in db['password_question'])
def _(self): return ref_gettext(self.translation)
def gettext(self): return ref_gettext(translations[self.locale])