Bring Lingui's macro-first localization model to Svelte and Astro.
lingui-for exists for teams who want the strengths of Lingui in frameworks that need framework-specific integration. It keeps Lingui's core authoring model intact while making it feel natural in Svelte and Astro.
That means you can keep the parts of Lingui that are actually valuable: powerful macros, interpolation, rich-text translations, extract and compile workflows, and compact compiled message output. And you get them in a form that matches each framework instead of fighting it.
In Svelte, that means translations fit naturally into the framework's reactive model. In Astro, that means request-aware translation with clear runtime boundaries. The goal is not to invent a new i18n system. The goal is to make Lingui work properly where users already want to use it.
<!-- Svelte -->
<script>
import { t, Plural } from "lingui-for-svelte/macro";
let count = $state(1);
</script>
<h1>{$t`Hello from Svelte`}</h1>
<p>
<Plural value={count} one="# item selected" other="# items selected" />
</p>
---
// Astro
import { t, Trans } from "lingui-for-astro/macro";
---
<h1>{t`Hello from Astro`}</h1>
<p>
<Trans><strong>Macro-first</strong> translation in Astro</Trans>
</p>
Trans, Plural, Select, and SelectOrdinal.lingui-for does not force identical behavior across frameworks.
That asymmetry is intentional. The goal is not identical implementation. The goal is to deliver Lingui's value in the way each framework can support well.
lingui-for-svelte: Lingui integration for Svelte.lingui-for-astro: Lingui integration for Astro.unplugin-lingui-macro: Unplugin wrapper for Lingui macro transforms.For package-level setup and API details, start with the README inside each package directory.
See CONTRIBUTING.md for setup instructions, workspace structure, and development commands.