Skip to content

i18n libraries

intl-ai generates translation files at build time. You choose the runtime i18n library. This page lists the supported options and their ICU compatibility.

ICU MessageFormat

Most modern i18n libraries speak ICU MessageFormat. The main exceptions are i18next (uses {{var}} and plural suffixes) and vue-i18n (uses its own syntax by default). Pick a library that fits your app's needs.

Library compatibility

LibraryNative ICUSetupBest for
react-intlYesNoneReact apps that need ICU
@formatjs/intlYesNoneFramework-agnostic ICU runtime
linguiYesBuild macroCompile-time safety, any framework
i18next-icuYes (via plugin)Install i18next-icuExisting i18next apps migrating to ICU
vue-i18n + intl-messageformatYes (via custom compiler)Custom messageCompilerVue apps that need ICU
svelte-i18nPartialManual formatter callsSvelte apps
@cookbook/solid-intlYesNoneSolid apps that need ICU
@lit/localizePartialCommunity workaroundWeb components
typesafe-i18nNoN/AType-safe i18n without ICU
rosettaNoN/ATiny footprint (298 bytes)
@solid-primitives/i18nNoN/AMinimal Solid i18n

Configuration

Set processor: "icu" in your intl-ai.config.ts if your target library uses ICU MessageFormat. Without it, intl-ai uses the default processor which preserves literal {{var}} placeholders for i18next.

ts
// intl-ai.config.ts
export default {
  // ... your model setup
  defaultLocale: "en",
  locales: ["en", "es", "fr"],
  localeDir: "./locales",
  processor: "icu", // omit for i18next's {{var}} style
};

Per-library guides

Choosing a library

NeedUse
React + ICUreact-intl
Vue + ICUvue-i18n with intl-messageformat compiler
i18next syntax (no ICU)i18next + react-i18next
Compile-time type safetylingui or typesafe-i18n
Smallest bundlerosetta