The same files
Ordinary vue-i18n message resources - the en.json and sl.json your front end already loads. Named and positional placeholders, pipe plurals, linked messages, modifiers, literals. Nothing to migrate, and vue-i18n-extract keeps working.
One set of translation files. A Vue front end and a Python back end that agree on what they say.
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 browserUnofficial
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.