Skip to content

Package Reference

The compatibility matrix currently runs against Lingui 5 and Lingui 6 with these framework and bundler generations:

PackageTested framework and bundler combinations
lingui-for-svelteSvelte 5 + Vite 6, Svelte 5 + Vite 7, Svelte 5 + Vite 8
lingui-for-astroAstro 5 + Vite 6, Astro 6 + Vite 7, Astro 7 alpha + Vite 8
unplugin-lingui-macroPlain Vite 6, Vite 7, and Vite 8

Astro 7 support tracks the current alpha line and may change before Astro 7 stable.

ExportWhat it containsUser-facing
lingui-for-sveltesetLinguiContext, getLinguiContext
lingui-for-svelte/macrot, plural, select, selectOrdinal, Trans, Plural, Select, SelectOrdinal, msg, defineMessage
lingui-for-svelte/configdefineConfig helper with framework.svelte support
lingui-for-svelte/extractorsvelteExtractor for lingui.config.ts; use svelteExtractor({ config }) for an explicit config source
lingui-for-svelte/unplugin/*Vite, Rollup, and Rolldown plugins
lingui-for-svelte/runtimeInternal runtime called by compiled macro output
ExportWhat it containsUser-facing
lingui-for-astrosetLinguiContext, getLinguiContext
lingui-for-astro/macrot, plural, select, selectOrdinal, Trans, Plural, Select, SelectOrdinal, msg, defineMessage
lingui-for-astro/configdefineConfig helper with framework.astro support
lingui-for-astro/extractorastroExtractor for lingui.config.ts; use astroExtractor({ config }) for an explicit config source
lingui-for-astro/integrationAstro integration for astro.config.ts
lingui-for-astro/unplugin/*Vite, Rollup, and Rolldown plugins
lingui-for-astro/runtimeInternal runtime called by compiled macro output

lingui-for-svelte/runtime and lingui-for-astro/runtime contain the low-level helpers that compiled macro output calls at runtime. Their API surface may change without a major version bump. Do not import from these paths directly.

Framework config lives in lingui.config.ts

Section titled “Framework config lives in lingui.config.ts”

Use defineConfig from lingui-for-svelte/config or lingui-for-astro/config when you need framework-specific options such as whitespace, packages, or runtimeWarnings. The framework build transform and extractor load the same config and read the relevant framework.svelte or framework.astro section. See Framework Config for how this works in single-framework and mixed-framework projects.

Plain .js and .ts files use @lingui/core/macro (official Lingui) with unplugin-lingui-macro for the build transform and @lingui/cli/api/extractors/babel for extraction. These are not part of lingui-for-*. See Plain JS/TS Setup.