Skip to content

vue-i18n-pythonvue-i18n, in Python

One set of translation files. A Vue front end and a Python back end that agree on what they say.

In one screen

python
import json
from vue_i18n import create_core_context, translate

ctx = create_core_context(
    locale="es",
    fallback_locale="en",
    messages={
        "es": json.load(open("locales/es.json")),
        "en": json.load(open("locales/en.json")),
    },
)

translate(ctx, "hello", {"name": "Ana"})    # 'Hola Ana'
translate(ctx, "trips", 5)                  # the plural form for 5
translate(ctx, "nested.deep.key")           # nested keys, as in the browser

Unofficial

This is an unofficial port. vue-i18n is © kazuya kawaguchi and contributors, MIT licensed. This project is not affiliated with or endorsed by intlify.

Early

Pre-1.0, and honest about it: nothing here has served a production page yet. The behaviour is checked against upstream on every test run, which is a different thing from being battle-tested. 1.0 is what the first confirmed production use earns.

Released under the MIT License. vue-i18n is © kazuya kawaguchi and contributors; this is an unofficial port and is not affiliated with intlify.