Ejemplo n.º 1
0
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)
Ejemplo n.º 2
0
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)
Ejemplo n.º 3
0
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)
Ejemplo n.º 4
0
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)