History

What's new in astro-intl

A detailed log of every feature, fix, and breaking change across all versions.

2.4.0

Latest release
Added

Added optional Preact 10 and 11, Vue 3 and SolidJS 1.x adapters alongside React and Svelte for components rendered inside Astro. Import them from astro-intl/preact, astro-intl/vue and astro-intl/solid to read request translations and render rich text.

Added

Added English and Spanish guides for all five adapters. Each guide renders a translated heading on the server and passes translated labels to an interactive island.

Added

Added a testing guide with runnable examples for all five adapters using createGetTranslations and explicit catalogs, plus a native Astro example using runWithLocale.

Added

Added a five-language globe to the documentation landing page and playground, starting with Dominican Spanish.

Changed

Updated the sites with a charcoal theme, page transitions and code examples with keyboard-accessible tabs and copy controls.

Changed

The mobile navigation now opens full screen, with animated links and action buttons that respect reduced-motion preferences.

Fixed

The site language selector now shows a centered chevron that follows its open and closed states.

Security

Documented the project-level seroval@1.8.2 override for SolidJS 1.9.13 and applied it to the tested configurations.

2.3.1

Changed

Reorganized the documentation around a bilingual quick start, with copyable commands for npm, pnpm and Yarn.

Security

Raised the minimum sanitize-html version to 2.18.2 for translated markup and Svelte rich text.

Security

Updated the documentation and development environments to Astro 7.4.13 and Node.js 22.23.4, and refreshed vulnerable build and test dependencies. The library retains its Astro 4–7 peer range.

2.3.0

Added

Added astro-intl validate for deterministic JSON catalog validation in local workflows and CI.

Added

Added the astro-intl/validate subpath with validateCatalogs() and typed diagnostics for missing keys, extra keys, value type mismatches and incompatible placeholders.

Security

Updated Astro 7 development, documentation and compatibility consumers from 7.0.9 to 7.1.4 to resolve GHSA-4g3v-8h47-v7g6.

Security

Production dependency auditing now fails for moderate-or-higher vulnerabilities.

Fixed

Aligned the English and Spanish documentation catalogs and added catalog validation to the repository checks.

Fixed

Fixed the documentation CSS import order and normalized repository text files to LF.

2.2.2

Security

Isolated SSR locale and message state with Node.js AsyncLocalStorage; unsupported SSR runtimes now fail explicitly instead of sharing process-global request data.

Security

Replaced regex-only HTML filtering with parser-based allowlist sanitization for t.markup().

Security

Escaped and sanitized Svelte rich-text rendering and rejected unsafe native tag mappings.

Security

Validated locale path segments before routing and browser redirect construction.

Security

Escaped JSON-LD script content and safely rendered the documentation changelog.

Fixed

Clean publication builds now exclude tests, copy AutoRedirect.astro, validate exports and reject unexpected tarball files.

Fixed

Vitest discovers source tests only and no longer re-runs compiled tests from dist.

Fixed

Updated current React and request-locale examples while preserving historical signatures in the v1→v2 migration guide.

Changed

Added official Astro 7 support by extending the peer range to ^4 || ^5 || ^6 || ^7, while preserving Astro 4–6 compatibility and all current public APIs.

Changed

Updated the playground canary to Astro 7.0.9, @astrojs/vercel 11.0.3 and @astrojs/sitemap 3.7.3.

Changed

Extended the tarball compatibility matrix to Astro 4.16.19, 5.18.2, 6.4.8 and 7.0.9.

Changed

Validated Astro 7 with Vite 8/Rolldown, the Rust .astro compiler, queued nested rendering, Advanced Routing in full and explicitly composed pipelines, and locale-separated route caching.

Changed

Documented that Astro 7 requires Node.js 22.12.0 or newer without changing astro-intl's Node.js requirement for Astro 4–6 consumers.

2.2.1

Changed

Republished 2.2.0 with the package version updated to 2.2.1. The public tarballs contain identical compiled code.

2.2.0

Added

t.raw() function — access raw translation values (arrays, objects, numbers) without string coercion. Use t.raw("key") to get the native value type instead of [object Object].

Added

messagesDir integration option — simplified API for loading JSON files. Set messagesDir: "./src/i18n/messages" and the integration will automatically load {locale}.json files with the correct import attributes.

Added

Auto-detection of locale in static mode — getLocale() now automatically detects the locale from window.location.pathname when setRequestLocale() hasn't been called (client-side only).

Added

<AutoRedirect /> component — new Astro component export from astro-intl/components. Detects browser language and redirects to the appropriate localized route without the blank page issue of Astro.redirect(). Supports locales and defaultLocale props.

Added

MessagesDirConfig type — exported type for the messagesDir configuration option.

Changed

Updated package.json exports to include ./components sub-path for the AutoRedirect component.

Changed

Improved error messages when request config is not found.

2.1.0

Added

Astro v6 support — peerDependencies now accepts ^4 || ^5 || ^6. Backward compatible with Astro 4 and 5.

Added

getFallbackRoutes() API — new public function that returns i18n fallback routes collected from Astro 6.1's astro:routes:resolved hook. Returns an empty array on Astro < 6.1.

Added

FallbackRouteInfo type — exported type with { pattern: string; pathname?: string; locale: string }.

Added

astro:routes:resolved hook — the integration now listens to this hook to automatically detect and store fallback routes when i18n.fallbackType: 'rewrite' is configured in Astro.

Changed

devDependencies.astro updated to ^6.1.0.

Changed

@astrojs/vercel updated to ^10.0.3 in docs projects (Astro 6 compatible).

Changed

happy-dom updated to ^20.8.9 to fix CVE-2026-33943 (RCE via ECMAScriptModuleCompiler).

Security

Resolved all 32 Dependabot vulnerability alerts, including:

2.0.0

Breaking

getTranslationsReact removed from root export — React support is now imported from astro-intl/react instead of astro-intl.

Breaking

Sub-path imports required for framework adapters — use astro-intl/react and astro-intl/svelte instead of importing from the root.

Breaking

Old src/react.ts deleted — logic migrated to src/adapters/react.ts.

Added

Svelte adapter — getTranslations and createGetTranslations with t.rich() returning RichSegment[]. Import from astro-intl/svelte.

Added

renderRichText() helper — resolves RichSegment[] into an HTML string using tags (native HTML elements) and components (custom functions). Import from astro-intl/svelte.

Added

RichSegment type — framework-agnostic segment type (text | tag) exported from astro-intl/svelte.

Added

createGetTranslations factory — standalone translation factory (no store dependency) available in both React and Svelte adapters.

Added

Framework-agnostic base — parseRichSegments() in src/framework-base.ts powers both React and Svelte rich text parsing.

Added

New sub-path exports — astro-intl/react and astro-intl/svelte in package.json exports.

Added

svelte@^5 added as optional peer dependency.

Changed

React adapter moved from src/react.ts to src/adapters/react.ts.

Changed

React t.rich() now uses the shared parseRichSegments() base with recursive nested tag support.

Changed

Package structure reorganized with src/adapters/ directory for framework-specific code.

1.1.0

Added

Localized routing system — define translated URL paths per locale (e.g. /es/sobre-nosotros instead of /es/about).

Added

path(routeKey, options?) — generate localized URLs for named routes with dynamic [param] substitution. Import from astro-intl/routing.

Added

switchLocalePath(currentPath, nextLocale) — convert the current URL to its equivalent in another locale, preserving params, query strings and hashes. Import from astro-intl/routing.

Added

routes option in createIntlMiddleware — the middleware automatically rewrites translated URLs to their canonical filesystem paths (no duplicate page files needed).

Added

routes option in integration config (astro.config.mjs) — for projects that don't use middleware.

Added

RoutesMap type exported from astro-intl/types.

Added

Route template validation — detects unbalanced brackets and invalid param names at build time.

Added

Route conflict detection — throws on duplicate templates and warns on structurally equivalent ones.

Changed

createIntlMiddleware signature now accepts routes?: RoutesMap in options.

Changed

New ./routing export path in package.json for astro-intl/routing.

1.0.3

Changed

createIntlMiddleware() now automatically sets locales and defaultLocale in the intl store via __setIntlConfig. Users who use middleware no longer need to pass these options to intl() in astro.config.mjs.

Added

defaultLocale option in IntlMiddlewareOptions type.

1.0.2

Added

Configurable defaultLocale option — no more hardcoded "en" fallback.

Added

runWithLocale() — concurrency-safe request context via AsyncLocalStorage.

Added

Multi-runtime support — auto-detects AsyncLocalStorage (Node.js) with global-variable fallback (Cloudflare Workers, Deno).

Added

IntlConfig type exported for integration configuration.

Changed

Modular architecture — core.ts split into sanitize, interpolation, store, translations modules.

Changed

react.ts now imports shared escapeRegExp from sanitize.ts (removed duplicate).

Fixed

Race condition in SSR — concurrent requests no longer share state.

Fixed

Hardcoded "en" fallback locale now respects defaultLocale config.

1.0.1

Added

Variable interpolation with t("key", { name: "value" }).

Added

t.markup() for HTML in translations with security sanitisation.

Added

t.rich() for React with nested tag support.

Added

defineRequestConfig() for global config registration (next-intl style).

Added

Messages via integration options (messages config).

Added

BCP-47 locale validation.

Added

Prototype-pollution protection in dot-path traversal.

Added

HTML sanitisation (defence-in-depth) in t.markup().

1.0.0

Added

Initial release.

Added

setRequestLocale() for URL-based locale detection.

Added

getLocale() to read current locale.

Added

getTranslations() with namespace support.

Added

getTranslationsReact() for React components.

Added

Type-safety with DotPaths<T>.

Added

Native Astro integration.