def gettext(ctx, text): """Translate a string, loading the translations for the locale if necessary.""" install_lang_files(ctx) trans = translate(text, ctx['request'].langfiles) return jinja2.Markup(trans)
def _(ctx, text): """Translate a string, loading the translations for the locale if necessary.""" install_lang_files(ctx) trans = translate(text, ctx['request'].langfiles) return jinja2.Markup(trans)
def _(ctx, text, *args): """Translate a string, loading the translations for the locale if necessary.""" args = args or {} install_lang_files(ctx) trans = translate(text, ctx['request'].langfiles) if args: trans = trans % args return jinja2.Markup(trans)
def gettext(ctx, text): """Translate a string, loading the translations for the locale if necessary.""" install_lang_files(ctx) return translate(text, ctx['request'].langfiles)