Paraglide JS is a compiler-based alternative to svelte-i18n for Svelte and SvelteKit: messages compile to typed functions (m.title() instead of $_("title")), unused messages are tree-shaken, and SvelteKit SSR resolves the locale per request. Your existing ICU MessageFormat JSON can be compiled as is through the ICU plugin.
npx @inlang/paraglide-js init
Migration guide → · SvelteKit guide →
svelte-i18n is a long-standing Svelte i18n library built on Svelte stores and FormatJS' intl-messageformat. It loads JSON dictionaries at runtime and formats ICU messages through the $_ / $t / $format store. Paraglide compiles the same kind of messages at build time instead.
Project status
svelte-i18n 4.0.0 was released in October 2023. The only release since is 4.0.1 (October 2024), which allows Svelte 5 as a peer dependency; it works in Svelte 5 through stores. As of December 2026 there have been no commits since, and 74 issues are open.
Paraglide JS is maintained by General Translation, released regularly, and its SvelteKit integration is used by the Svelte CLI's paraglide add-on.
TL;DR
- Choose Paraglide for type-checked message keys and parameters, unused-message tree-shaking, per-request locale handling in SvelteKit SSR, and a library that is still developed.
- Stay on svelte-i18n if you need to change language without a page reload, load translation dictionaries that are only known at runtime (for example from an API), or your app is stable and you don't want to touch it.
- You can keep your ICU JSON. The ICU MessageFormat plugin compiles svelte-i18n's message syntax, including plurals, selects and
selectordinal. Nested JSON needs flattening once; svelte-i18n reads flat dotted keys too, so both libraries can run on the same files during the migration.
At a glance
| Paraglide JS | svelte-i18n | |
|---|---|---|
| Architecture | Compiler: one generated function per message | Runtime: dictionaries in a store, ICU parsed by intl-messageformat |
| Calling a message | m.title(), m["field.name"]() | $_("title"), $_("field.name") |
| Parameters | m.awesome({ name }) | $_("awesome", { values: { name } }) |
| Typed keys and parameters | ✅ Generated | ❌ Keys are strings |
| Message syntax | inlang message format, or ICU MessageFormat via the ICU plugin | ICU MessageFormat |
| Unused messages | Removed by the bundler | Whole dictionary per registered locale |
| Loading locales | All locales in each message function by default; experimental per-locale builds ship only the active one | register() lazy-loads one locale's dictionary; waitLocale() before rendering |
| SvelteKit SSR | Locale resolved per request by paraglideMiddleware | Module-level locale store; the SvelteKit recipe sets it in the server hook |
| Locale switching | setLocale() navigates or reloads the document | locale.set("de") updates in place |
| Localized URLs | ✅ Built in (i18n routing) | Not included; getLocaleFromPathname() reads a locale from the path |
| Number / date formatting | In messages (formatting) or Intl directly | $number, $date, $time stores, and in messages |
| Rich text | Typed markup with a Svelte adapter (inlang message format) | {@html $_("key")} |
| Runtime-only dictionaries | 🟠 Messages must be known at build time | ✅ addMessages() at any time |
| Translation workflow | General Translation through the inlang CLI, Fink editor, Sherlock VS Code extension | JSON files; svelte-i18n extract collects message IDs from code |
Type safety
svelte-i18n looks messages up by string at runtime. A typo like $_("feild.name") renders the key (or a default you pass) and is only noticed when someone looks at the page.
Paraglide generates a function and declaration for each message:
<script lang="ts">
import { m } from "$lib/paraglide/messages.js";
</script>
<h1>{m.title()}</h1>
<p>{m.awesome({ name: "Paraglide" })}</p>
<p>{m["feild.name"]()}</p> <!-- ❌ type error -->
svelte-check reports a misspelled key or a missing parameter in CI.
Bundle size and loading
svelte-i18n ships intl-messageformat, which parses ICU strings in the browser, plus the dictionary of each registered locale you load. Every message in that dictionary ships whether a page uses it or not.
Paraglide compiles messages to plain functions, so there is no message parser at runtime, and the bundler drops messages your code doesn't import. By default each function contains every configured locale; the benchmark and build workflow explain the trade-off and how to ship only the active locale.
SSR in SvelteKit
svelte-i18n keeps the current locale in a module-level store. Its SvelteKit recipe sets that store from Accept-Language in hooks.server.ts; on a server handling several requests at once, they share that one value, so concurrent requests in different languages can render with the wrong one.
Paraglide's SvelteKit setup wraps each request in paraglideMiddleware, which resolves the locale from the URL, a cookie or headers and keeps it in request-scoped storage. getLocale() returns the right locale for each request, and the middleware can redirect to localized URLs.
Locale switching
Setting the locale store in svelte-i18n re-renders every store subscriber in place. Paraglide's setLocale() navigates to the localized URL or reloads the page, so the server-rendered HTML, <html lang> and the client always agree. If you need to switch language without losing in-memory state, test this first.
When svelte-i18n is still a fine choice
- Dictionaries come from a CMS or API at runtime and can't be part of the build.
- The language must change without a navigation, and the page can't restore its state after a reload.
- Your app is stable and doesn't need typed keys, smaller bundles, or new framework features.
Try Paraglide
npx @inlang/paraglide-js init
