Localized routes
/docs is English, /es/docs is Spanish and /uk/docs is Ukrainian. Switching language preserves the page, query string and fragment.
Getting started
The source locale stays unprefixed. Secondary locales live under /es and /uk, and their catalogs are loaded only when a visitor asks for them.
Import the source catalog statically for typed keys and fallback. Keep secondary catalogs behind dynamic imports so they are split from the first bundle.
export const i18n = defineI18n({
locales: ['en', 'es', 'uk'],
sourceLocale: 'en',
source: en,
loaders: {
es: () => import('./es.json'),
uk: () => import('./uk.json')
}
});/docs is English, /es/docs is Spanish and /uk/docs is Ukrainian. Switching language preserves the page, query string and fragment.
This sentence exists only in the source catalog, so Spanish and Ukrainian fall back to it.
1 production behavior is covered.
3 production behaviors are covered.
12 production behaviors are covered.