Package Reference
Supported Versions
Section titled “Supported Versions”The compatibility matrix currently runs against Lingui 5 and Lingui 6 with these framework and bundler generations:
| Package | Tested framework and bundler combinations |
|---|---|
lingui-for-svelte | Svelte 5 + Vite 6, Svelte 5 + Vite 7, Svelte 5 + Vite 8 |
lingui-for-astro | Astro 5 + Vite 6, Astro 6 + Vite 7, Astro 7 alpha + Vite 8 |
unplugin-lingui-macro | Plain Vite 6, Vite 7, and Vite 8 |
Astro 7 support tracks the current alpha line and may change before Astro 7 stable.
lingui-for-svelte
Section titled “lingui-for-svelte”| Export | What it contains | User-facing |
|---|---|---|
lingui-for-svelte | setLinguiContext, getLinguiContext | ✓ |
lingui-for-svelte/macro | t, plural, select, selectOrdinal, Trans, Plural, Select, SelectOrdinal, msg, defineMessage | ✓ |
lingui-for-svelte/config | defineConfig helper with framework.svelte support | ✓ |
lingui-for-svelte/extractor | svelteExtractor for lingui.config.ts; use svelteExtractor({ config }) for an explicit config source | ✓ |
lingui-for-svelte/unplugin/* | Vite, Rollup, and Rolldown plugins | ✓ |
lingui-for-svelte/runtime | Internal runtime called by compiled macro output | ✗ |
lingui-for-astro
Section titled “lingui-for-astro”| Export | What it contains | User-facing |
|---|---|---|
lingui-for-astro | setLinguiContext, getLinguiContext | ✓ |
lingui-for-astro/macro | t, plural, select, selectOrdinal, Trans, Plural, Select, SelectOrdinal, msg, defineMessage | ✓ |
lingui-for-astro/config | defineConfig helper with framework.astro support | ✓ |
lingui-for-astro/extractor | astroExtractor for lingui.config.ts; use astroExtractor({ config }) for an explicit config source | ✓ |
lingui-for-astro/integration | Astro integration for astro.config.ts | ✓ |
lingui-for-astro/unplugin/* | Vite, Rollup, and Rolldown plugins | ✓ |
lingui-for-astro/runtime | Internal runtime called by compiled macro output | ✗ |
*/runtime is not a public API
Section titled “*/runtime is not a public API”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/TS uses a different package
Section titled “Plain JS/TS uses a different package”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.