npm install -D vite-plugin-shipi18n
npm install vue-i18nBecause Vue projects are usually Vite projects, the plugin is the least intrusive option — add it to vite.config.js and translation becomes part of the build:
import shipi18n from 'vite-plugin-shipi18n'
export default {
plugins: [
shipi18n({ provider: 'anthropic', targetLanguages: ['es', 'fr'] }),
],
}const { t } = useI18n(); return t('greeting', { name })import { createI18n } from 'vue-i18n'
import en from './locales/en.json'
import es from './locales/es.json'
const i18n = createI18n({
legacy: false,
locale: 'en',
fallbackLocale: 'en',
messages: { en, es },
})
app.use(i18n)<script setup>
import { useI18n } from 'vue-i18n'
const { t } = useI18n()
</script>
<template>
<p>{{ t('greeting', { name: 'Ada' }) }}</p>
</template>The key exists in the source but not yet in that locale. Re-run the build so the plugin translates it.
vue-i18n uses {name} rather than {{name}}. Keep the source file in vue-i18n syntax and it will be preserved as-is.
Need help? Read the docs