示例#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)
示例#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)
示例#3
0
文件: helpers.py 项目: shawnl/bedrock
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)
示例#4
0
文件: helpers.py 项目: 1234-/bedrock
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)