ts-intl
Docs
Astro Integration Available|ts-intl-astro

Internationalization for Modern TypeScript

Zero Dependencies · Type Safety · Framework Agnostic

$
pnpm add@aaakul/ts-intl
export default {
  dashboard: {
    greeting: "Hello, {name: string}!",
    membership: "{role, select, admin {Admin} pro {Pro Member} other {Standard Member}}",
    cart: "{count, plural, =0 {Cart is empty} one {# item in cart} other {# items in cart}}",
    discount: "Flash Sale: <badge>20% OFF</badge> on all items",
    invoice: "Total: {amount, number, currency}",
    delivery: "Estimated delivery: {time}",
  },
} as const;
Live Preview

Hello, Alex!

Pro Member
Flash Sale: 20% OFF on all items
3 items in cartTotal: $129.99
Estimated delivery: in 2 days

Type Safety

Provides TypeScript type inference for translation keys, namespaces, and parameters, while validating schema consistency across locales.

Zero Runtime Dependencies

Built on TypeScript and Web standard Intl APIs, requiring no code generation build steps. Minified + Gzipped: < 5 kB

ICU Message Format Support

Supports plurals, ordinals, select branches, and rich text tag interpolation without external parser dependencies.

Framework Agnostic

Runs in Astro, Next.js, React, Vue, Svelte, Node.js, Bun, and Cloudflare Workers.

Benchmark

Network Transfer Size Benchmark

Measures the real network transfer size of all i18n assets during initial pre-rendering and client-side hydration.

Network Transfer Size (KB)

Playwright Headless Chromium · Real HTTP Transfer Size

paraglidemiddleware
-91%36.3 KB
ts-intllocale-splitting
-86%57.8 KB
paraglidebundled
-82%76.6 KB
i18nexthttp-backend
-55%188.7 KB
ts-intlbundled
-14%360.0 KB
i18nextbundled
Baseline420.4 KB
Runtime Dependencies & Footprint

i18next bundles full parser engines and plugin runtimes, incurring baseline overhead. ts-intl has zero runtime dependencies (~2 KB core) and, in locale-splitting mode, loads only the active locale dictionary.

Compiler vs. Runtime Splitting

Paraglide compiles messages to JS functions and tree-shakes unused keys. ts-intl is a runtime library requiring no code generation, using standard dynamic imports to prevent multi-locale bundle accumulation.