Templates get $t() calls, script setup gets useI18n, the i18n instance is scaffolded and wired into main.ts — and existing vue-i18n catalogs are merged into, not replaced.
Polyglot wraps Vue SFCs with vue-i18n's native shapes — and if your app already uses vue-i18n, it detects your catalog's location and format and merges into it rather than inventing a parallel one.
<template>
<main>
<h1>Welcome back</h1>
<p>Your projects are ready</p>
</main>
</template><script setup lang="ts">
import { useI18n } from 'vue-i18n';
const { t } = useI18n();
</script>
<template>
<main>
<h1>{{ t('src.App.welcome_back') }}</h1>
<p>{{ t('src.App.your_projects_are_ready') }}</p>
</main>
</template>{{ $t('key') }}; bound attributes get :attr="$t('key')" conversions.useI18n binding so both template and script resolve.<strong>/links inside) is flagged for review with the exact reason, never approximated — rich-text codegen ships for the React family; in Vue, Polyglot won't guess at markup.On a fresh app Polyglot creates the i18n instance and wires app.use(i18n) into src/main.ts — then verifies that wiring as part of the run:
{
"src": {
"App": {
"welcome_back": "Welcome back",
"your_projects_are_ready": "Your projects are ready"
}
}
}{
"src": {
"App": {
"welcome_back": "Willkommen zurück",
"your_projects_are_ready": "Ihre Projekte sind bereit"
}
}
}{
"src": {
"App": {
"welcome_back": "Bon retour",
"your_projects_are_ready": "Vos projets sont prêts"
}
}
}$ curl -fsSL https://getpolyglot.ai/install.sh | sh
$ polyglot init --framework vue
$ polyglot scan
$ polyglot wrap
$ polyglot translate --languages de # 50 strings free, no signupIm Terminal starten
Installieren Sie die CLI, führen Sie einen Scan durch und sehen Sie genau, was Ihnen fehlt. Kostenlos, kein Konto erforderlich.