Ask your question and get a summary of the document by referencing this page and the AI provider of your choice
The content of this page was translated using an AI.
See the last version of the original content in EnglishIf you have an idea for improving this documentation, please feel free to contribute by submitting a pull request on GitHub.
GitHub link to the documentationCopy doc Markdown to clipboard
Why consider migrating from Paraglide JS in 2027?
Paraglide JS was one of the i18n libraries TanStack pointed people to. The official TanStack Router i18n guide and the start-i18n-paraglide example are both built on it.
On November 16, 2026, Paraglide JS joined General Translation (GT). It stays MIT-licensed and existing apps keep working. But the direction has changed: the Paraglide README now recommends General Translation to translate your message files, and GT suggests its own SDKs, gt-react or gt-next, if you want the copy back in your components.
The risk is that Paraglide's maintenance degrades over the coming months. The announcement says the project is now maintained by the GT team, but it does not say that its creator joins GT. Nobody from Inlang (the company behind Paraglide.js) joined GT, since almost all of Paraglide's past core developers have already moved on to other companies.
Moreover GT already has its own SDK to push, which is still far from mature in December 2026 (see below). Bug and security fixes are promised. The roadmap, though, points to GT's translation CLI, dashboard and inference. Downloads already show it: weekly npm downloads of @inlang/paraglide-js went from 1.51 million (November 7 to 13) to 1.32 million (November 27 to December 3), about 13% fewer. The US Thanksgiving week falls in the second window, so part of the drop is seasonal.
This guide is for you if you'd rather not depend on a company whose business is selling translations. Intlayer generates your translations for free, on your machine, with your own API keys (OpenAI, Anthropic, Mistral...) or a local model running in Ollama or LM Studio.
What Paraglide Got Right
Paraglide compiles every message into its own JavaScript function (m.hero_title()). A page only imports the functions it calls, so the bundler can drop the messages of the other pages. In the TanStack Start benchmark, Paraglide leaks 0% of other pages' content, where most libraries ship one big JSON per locale.
What It Costs
Each message function imports the text of every locale:
Copy the code to the clipboard
A French visitor downloads the English, Spanish, German... versions of every string on the page. With 2 locales, half your translations are dead weight. With 10 locales, 90% of the translated content shipped to the page is never displayed. Paraglide has no dynamic mode to fix this, and loading one function per message lazily would mean thousands of requests.
The second cost is getLocale(). With no provider, every m.key() call resolves the locale again (cookie, storage, URL). A page with 200 strings resolves it 200 times per render.
More details in Is Intlayer lighter than Paraglide?.
Made for Svelte, Less So for React
Paraglide is a simple tool: it generates plain JavaScript into your codebase, so the same output works in Svelte, Vue, vanilla JS or React. In a Svelte template, {m.hero_title()} is idiomatic, and the Svelte + Vite benchmark is where its tree shaking works best.
- In React, a function call per string (
<>{m.hero_title()}</>) can be considered an anti-pattern - React doesn't know the result depends on the locale, so nothing re-renders when it changes. Paraglide's
setLocale()reloads the whole page by default. - The call runs again on every render of every component, locale resolution included.
- Rich content (a link or a
<strong>inside a sentence) doesn't fit in a string-returning function.
Intlayer also works across frameworks, but with a dedicated integration for each framework and meta-framework, built for how each one renders: React context and Server Components, Vue refs, Svelte stores, Solid and Angular signals, plus Next.js, Nuxt, SvelteKit, TanStack Start, React Router, Astro and server frameworks such as Express or Hono.
What About General Translation?
GT is a young framework, and its business is AI translation served from its CDN. We took apart a production app built on gt-react (T3 Code) and found:
- a 38 KB gzipped runtime, about twice
react-i18next; - one catalog per locale for the whole app, so 63% of what a French user loads is for screens they haven't opened;
- every string shipped twice: the English source in the code, the translation in the catalog;
strings keyed by a hash of the English text, so fixing a typo breaks the key.
If you picked Paraglide for its bundle size, GT goes the other way.
Why Intlayer
Intlayer also imports dictionaries where they are used, so other pages don't leak either. With importMode: "dynamic", it also loads only the current locale, which Paraglide can't do. A provider reads the locale once per render instead of once per string, and the compiler lets you write plain text in your JSX and extracts it at build time.
TanStack Start, 10 pages, gzipped:
Open the table in a modal to view all data content clearly
| Setup | Page JS avg | Above base | Locale leak | Other-page leak |
|---|---|---|---|---|
| Base (no i18n) | 111.0 KB | - | 0.0% | 0.0% |
paraglide (any strategy) | 125.1 KB | +14.1 KB | 49.7% | 0.0% |
intlayer (importMode: dynamic) | 118.6 KB | +7.6 KB | 0.0% | 0.0% |
Metric
Dynamic JSON loading
Lazy-loads translations at runtime
Scoped JSON (namespacing)
Per-page translation namespaces
What is this metric?
The total gzip-compressed size of the internationalisation library bundle. It only includes the provider and content retrieval logic after tree-shaking and minification.
Why is it important?
A smaller library size reduces the initial JavaScript payload, leading to faster download and execution times on the client.
View as
Full data: TanStack Start benchmark, Next.js benchmark.
Feature Comparison
Open the table in a modal to view all data content clearly
| Feature | Intlayer | Paraglide JS | General Translation (gt-react, gt-next) |
|---|---|---|---|
| Maintained by | Intlayer team (Apache-2.0) | GT team since November 2026 (MIT) | GT, a company selling AI translation (SDK under MIT) |
| Translations near components | ✅ Co-located content files, or plain text with the compiler | ❌ One JSON file per locale | ⚠️ Source text inline, translations in a central catalog |
| TypeScript integration | ✅ Auto-generated types | ✅ Typed message functions | ⚠️ No keys to type (hashed source text) |
| Missing translation detection | ✅ Type errors, build warnings, npx intlayer test in CI | ⚠️ Falls back to the base locale | ⚠️ Falls back to the source text |
| Rich content (JSX, Markdown) | ✅ Direct support | ⚠️ Strings only | ✅ JSX inside <T> |
| Pluralization | ✅ plural(), enu() | ✅ Variants | ✅ <Plural>, <Branch> |
| Localised routing | ✅ Built-in, localised paths (Next.js, Vite) | ✅ urlPatterns + router rewrite | ✅ Via gt-next middleware |
| Per-page content split | ✅ Per dictionary | ✅ Per message (depends on the bundler) | ❌ One catalog per locale for the whole app |
| Load only the current locale | ✅ importMode: "dynamic" or "fetch" | ❌ Every locale inside every message | ⚠️ One catalog, plus the English source in the code |
| Locale resolution | ✅ Once, from a provider | ⚠️ On every message call | ✅ Once, from a provider |
| Runtime size (gzip) | ~5 KB | 1.8 KB, plus the runtime generated into your app | ~38 KB |
| AI translation | ✅ Free, with your own API key or a local model (Ollama, LM Studio) | ⚠️ Not built-in, docs point to GT's service | ⚠️ GT's hosted service, paid |
| Visual editor / CMS | ✅ Local editor + optional CMS | ⚠️ inlang apps | ✅ GT dashboard (hosted) |
| VS Code extension | ✅ Go to definition, extraction, inlay hints, key rename | ⚠️ Sherlock (inlang), through a plugin | ❌ None found |
| LSP (Zed, Neovim, other editors) | ✅ @intlayer/lsp | ❌ No | ❌ No |
| Frameworks | React, Next.js, Vue, Svelte, Angular, Solid, Astro, Lit, backends and more | Any JS framework | React, Next.js, React Native, TanStack Start, Vue |
Runtime sizes come from the TanStack Start benchmark and the T3 Code analysis. See also the VS Code extension, the LSP and the AI provider configuration.
API Mapping
Open the table in a modal to view all data content clearly
| Paraglide JS | Intlayer |
|---|---|
project.inlang/settings.json | intlayer.config.ts |
messages/{locale}.json | Plain text in your components (compiler) or .content.ts |
m.hero_title() | Ship faster in JSX, or content.title |
m.greeting({ name }) | Hello {name} in JSX, or content.greeting({ name }) |
getLocale() / setLocale() | useLocale() from react-intlayer |
localizeHref() | getLocalizedUrl() from intlayer |
paraglideMiddleware in server.ts | Built into the intlayer() Vite plugin |
Router rewrite (deLocalizeUrl) | {-$locale} route segment |
urlPatterns (localised pathnames) | routing.rewrite in intlayer.config.ts |
paraglideVitePlugin | intlayer() from vite-intlayer |
Migrate Step by Step
The examples below use TanStack Start with React. The same steps apply to Next.js, Svelte, Vue or Astro with the matching Intlayer package.
Install Intlayer
bashCopy codeCopy the code to the clipboard
The command detects your framework, installs
intlayer,react-intlayerandvite-intlayer, and createsintlayer.config.ts. Select Compiler when asked.Port your locales and enable the compiler
Copy the locales from
project.inlang/settings.json:intlayer.config.tsCopy codeCopy the code to the clipboard
Swap the Vite plugin and remove the Paraglide middleware
vite.config.tsCopy codeCopy the code to the clipboard
The
intlayer()plugin includes the locale detection and redirection thatparaglideMiddlewaredid, so you can deletesrc/server.ts(or the middleware call in it) and therewriteblock insrc/router.tsx.Move your routes under {-$locale}
Paraglide strips the locale prefix with a router rewrite. Intlayer uses an optional route segment instead, so TanStack Router stays aware of the locale and typed links keep working:
bashCopy codeCopy the code to the clipboard
The TanStack Start guide has the full
route.tsx, root layout, localised link and locale switcher.Put your strings back into your components
Replace each
m.key()call with the English text it returns:src/components/Hero.tsxCopy codeCopy the code to the clipboard
src/components/Hero.tsxCopy codeCopy the code to the clipboard
The component no longer imports messages or references keys. On a large codebase, give this prompt to your coding agent:
textCopy codeCopy the code to the clipboard
Let the compiler extract the content
Run the dev server or a build. The compiler detects user-facing text in your components (JSX text,
title,placeholder,alt,aria-label...), writes a content file next to each component, and swaps the text for auseIntlayer()call in the build output. Your source files stay as you wrote them.src/components/Hero.content.jsonCopy codeCopy the code to the clipboard
Keep a string out of extraction (brand names, IDs) with an
intlayer-ignore-next-linecomment. See the compiler documentation.Bring back your existing translations
The extracted files only hold English at this point. Your French, Spanish... translations are still in
messages/*.json. Copy them over before deleting anything:textCopy codeCopy the code to the clipboard
Then check that nothing is missing, and translate the rest with your own API key or a local model:
bashCopy codeCopy the code to the clipboard
Remove Paraglide
Delete
project.inlang/,messages/,src/paraglide/and the@inlang/paraglide-jsdependency. Then open your bundle visualizer: each page should now carry only its own content, in one locale.
Prefer Explicit Content Files?
The compiler is optional. If you'd rather keep content in files you write yourself, declare it next to the component:
Copy the code to the clipboard
Copy the code to the clipboard
To convert existing components into content files in one pass, run npx intlayer extract. Read Compiler vs. Declarative i18n to choose between the two.
FAQ
Yes. General Translation says Paraglide stays free and MIT-licensed, and that it will keep fixing bugs and security issues. New work goes toward GT's translation CLI, dashboard and inference.
Partly. The syncJSON plugin with format: "icu" reads messages/{locale}.json as Intlayer dictionaries, and simple {param} messages work as is. Paraglide's plural variants have a different shape and need to be rewritten with plural(). You would also keep one big dictionary, which loses the per-page split.
No, as long as you keep the same routing mode. prefix-no-default gives /about and /fr/about, like Paraglide's default url strategy patterns. Localised pathnames (/fr/a-propos) go in routing.rewrite, see Custom URL Rewrites.
Yes. Paraglide and Intlayer don't share anything at runtime, so both can run side by side while you move components over. Remove Paraglide once the last m. import is gone.
Further Reading
Comments
No comments yet. Be the first to share your thoughts.
