[](https://www.npmjs.com/package/@inlang/paraglide-js) [



Compiler-based i18n library that emits tree-shakable translations, leading to up to 70% smaller i18n bundle sizes.
Documentation ยท
Quick Start ยท
Report Bug
Used in production by
...and more
Trusted by framework authors
SvelteKit's official i18n integration
Part of TanStack's CI pipeline
``js`
// messages/en.json
{
"greeting": "Hello {name}!"
}
`js
import { m } from "./paraglide/messages.js";
m.greeting({ name: "World" }); // "Hello World!" โ fully typesafe
`
The compiler generates typed message functions. Your bundler tree-shakes unused messages. Expect up to 70% smaller i18n bundle sizes compared to runtime i18n libraries (e.g. 47 KB vs 205 KB).
| | |
| ------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Smaller i18n Bundle | Up to 70% smaller i18n bundle size than runtime i18n libraries. |
| Tree-Shakable | Unused messages are eliminated by your bundler. |
| Fully Typesafe | Autocomplete for message keys and parameters. Typos become compile errors. |
| Framework Agnostic | Works with React, Vue, Svelte, Solid, TanStack, or vanilla JS/TS. |
| Built-in i18n Routing | URL-based locale detection and localized paths out of the box. |
| Built on inlang | Integrates with Sherlock (VS Code extension), Fink (translation editor), and more. |
React ยท
Vue ยท
TanStack Start ยท
SvelteKit ยท
React Router ยท
Astro ยท
Vanilla JS/TS
> [!TIP]
> Paraglide is ideal for any Vite based app. Setup is just one plugin and Vite's tree-shaking eliminates unused messages automatically. Get started โ
`bash`
npx @inlang/paraglide-js init
The CLI sets up everything:
- Creates your message files
- Configures your bundler (Vite, Webpack, etc.)
- Generates typesafe message functions
Then use your messages:
`js
import { m } from "./paraglide/messages.js";
import { setLocale, getLocale } from "./paraglide/runtime.js";
// Use messages (typesafe, with autocomplete)
m.hello_world();
m.greeting({ name: "Ada" });
// Get/set locale
getLocale(); // "en"
setLocale("de"); // switches to German
`
Full Getting Started Guide โ
Paraglide compiles an inlang project into tree-shakable message functions. Your bundler eliminates unused messages at build time.
``
โโโโโโโโโโโโโโโโโโ
โ Inlang Project โ
โโโโโโโโโฌโโโโโโโโโ
โ
โผ
โโโโโโโโโโโโโโโโโโโโโโโโโโ
โ Paraglide Compiler โ
โโโโโโโโโโโโโฌโโโโโโโโโโโโโ
โ
โผ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ ./paraglide/messages.js โ
โ ./paraglide/runtime.js โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโ
Watch: How Paraglide JS works in 6 minutes โ
Paraglide uses Intl.PluralRules for locale-aware pluralization, supporting all CLDR plural categories (zero, one, two, few, many, other) and ordinals (1st, 2nd, 3rd). Gender and custom selects are supported via the variants system.
`js
// Pluralization example
m.items_in_cart({ count: 1 }); // "1 item in cart"
m.items_in_cart({ count: 5 }); // "5 items in cart"
// Works correctly for complex locales (Russian, Arabic, etc.)
``
Message format is plugin-based โ use the default inlang format, or switch to i18next, JSON, or ICU MessageFormat via plugins. If your team relies on ICU MessageFormat 1 syntax, use the inlang-icu-messageformat-1 plugin.
Pluralization & Variants Docs โ
| Feature | Paraglide | i18next | react-intl |
| ---------------------- | ---------------------------------- | --------------------- | --------------------- |
| i18n bundle size | Up to 70% smaller via tree-shaking | โ Ships all messages | โ Ships all messages |
| Tree-shakable | โ
| โ | โ |
| Typesafe | โ
| Partial | โ |
| Framework agnostic | โ
| Wrappers needed | React only |
| i18n routing | โ
Built-in | โ | โ |
> "Paraglide JS is by far the best option when it comes to internationalization. Nothing better on the market."
>
> Ancient-Background17 ยท Reddit
> "Just tried Paraglide JS. This is how i18n should be done! Totally new level of DX."
>
> Patrik Engborg ยท @patrikengborg
> "I was messing with various i18n frameworks and must say Paraglide was the smoothest experience. SSG and SSR worked out of the box."
>
> Dalibor Hon ยท Discord
> "I migrated from i18next. Paraglide reduced my i18n bundle from 40KB to ~2KB."
>
> Daniel ยท Why I Replaced i18next with Paraglide JS
- Paraglide JS 1.0 announcement
- Svelte London January 2024 Meetup
Paraglide is built on the open inlang format. Works with:
| Tool | Description |
| ----------------------------------------------------------------------- | ------------------------------------------------ |
| Sherlock | VS Code extension for inline translation editing |
| CLI | Machine translate from the terminal |
| Fink | Translation editor for non-developers |
| Parrot | Manage translations in Figma |
Explore the inlang ecosystem โ
- Getting Started
- Framework Guides (React Router, SvelteKit, Astro, etc.)
- Message Syntax & Pluralization
- Routing & SSR
- API Reference
We welcome contributions! See CONTRIBUTING.md for guidelines.
- GitHub Issues
- Discord Community
MIT โ see LICENSE