Polyglot reads your register() calls, resolves the exact catalog files your app loads, and merges new keys into them — order preserved, existing translations untouched.
An existing svelte-i18n app has its own catalog files, its own init module, its own conventions. The only correct automation is one that joins your world: Polyglot statically resolves the JSON files from your register('en', () => import('./locales/en.json')) calls and merges new keys into those files.
<script>
import { _ } from 'svelte-i18n';
</script>
<h1>Welcome back</h1>
<p>{$_('nav.home')}</p><script>
import { _, t } from 'svelte-i18n';
</script>
<h1>{$t('src.routes.+page.welcome_back')}</h1>
<p>{$_('nav.home')}</p>Note the import: your file already imported { _ } from svelte-i18n, so Polyglot extended that import with t (its alias) rather than duplicating or breaking it.
{
"nav": {
"home": "Startseite"
},
"src": {
"routes": {
"+page": {
"welcome_back": "Welcome back"
}
}
}
}{
"nav": {
"home": "Home"
},
"src": {
"routes": {
"+page": {
"welcome_back": "Welcome back"
}
}
}
}polyglot translate.$ curl -fsSL https://getpolyglot.ai/install.sh | bash
$ polyglot init --framework sveltekit
$ polyglot scan
$ polyglot wrap
$ polyglot translate --languages de # 50 strings free, no signupStart in your terminal
Install the CLI, run a scan, and see exactly what you're missing. Free, no account required.