Pages get {$t()} calls, the init module is scaffolded with SSR-safe static imports, and the root layout is wired — verified at the end of every run.
svelte-i18n's classic SSR trap is lazy register() loaders: the server render asks for a message before the dictionary resolves. Polyglot's scaffold sidesteps it with static imports + synchronous addMessages — the server render always has its dictionary.
<main>
<h1>Welcome back</h1>
<p>Your projects are ready</p>
</main><script>
import { t } from 'svelte-i18n';
</script>
<main>
<h1>{$t('src.routes.+page.welcome_back')}</h1>
<p>{$t('src.routes.+page.your_projects_are_ready')}</p>
</main>The generated init module and the root +layout.svelte wiring land together, and the run verifies both:
{
"src": {
"routes": {
"+page": {
"welcome_back": "Welcome back",
"your_projects_are_ready": "Your projects are ready"
}
}
}
}{
"src": {
"routes": {
"+page": {
"welcome_back": "Willkommen zurück",
"your_projects_are_ready": "Ihre Projekte sind bereit"
}
}
}
}{
"src": {
"routes": {
"+page": {
"welcome_back": "Bon retour",
"your_projects_are_ready": "Vos projets sont prêts"
}
}
}
}Polyglot reads your register() calls, resolves your catalog files, and merges into them — see the existing-setup page for that flow.
$ curl -fsSL https://getpolyglot.ai/install.sh | sh
$ polyglot init --framework sveltekit
$ 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.