Skip to content

Install and First Translation

  1. Install Lingui plus the framework package.
  2. Add unplugin-lingui-macro if the app uses Lingui macros in plain .ts, .js, .tsx, or .jsx.
  3. Add the framework integration or plugin.
  4. Create lingui.config.js or lingui.config.ts with the framework package’s defineConfig helper.
  5. Add the framework extractor. If you need framework-specific options, put them under framework.svelte or framework.astro.
  6. Put a single t or Trans call on the page.
  7. Run extraction and compile once before expanding the message set.
  • In .svelte, start with lingui-for-svelte/macro.
  • In .astro, start with lingui-for-astro/macro.
  • In plain JavaScript or TypeScript, start with @lingui/core/macro and unplugin-lingui-macro. See Plain JS/TS Setup.
  • The macro compiled away during build.
  • The message was extracted into the catalog.
  • The translated output appears in the target locale.

If one of those three fails, debug that stage before adding more pages.