Spike: Lingui (gettext) with Next 16, Turbopack and cacheComponents #3

Closed
opened 2026-11-01 16:19:30 +01:00 by miko · 1 comment
Owner

Part of #1

Blocked by: #2

What

Prove the i18n setup from ADR-0007 before the UI grows.

Acceptance criteria

  • Lingui 6 with .po catalogs, English source-text msgids, en (source) and de catalogs, lingui extract script
  • @lingui/swc-plugin pinned to the exact version compatible with the project's Next version (verify on plugins.swc.rs); if that fails under Turbopack, use the Babel macro and document why in ADR-0007
  • One translated Server Component (e.g. Titlebar) and one translated Client Component
  • Locale resolved from cookie, else Accept-Language, else default en; no locale URL prefix
  • Works with cacheComponents: true: locale-dependent UI under <Suspense>, no cookies()/headers() inside "use cache"
  • A minimal language switch sets the cookie
  • npm run build passes; short notes on the setup added to the README or ADR-0007

Vocabulary: GLOSSARY.md. Decisions: docs/adr/.

Part of #1 Blocked by: #2 ## What Prove the i18n setup from ADR-0007 before the UI grows. ## Acceptance criteria - [ ] Lingui 6 with `.po` catalogs, English source-text msgids, `en` (source) and `de` catalogs, `lingui extract` script - [ ] `@lingui/swc-plugin` pinned to the exact version compatible with the project's Next version (verify on plugins.swc.rs); if that fails under Turbopack, use the Babel macro and document why in ADR-0007 - [ ] One translated Server Component (e.g. `Titlebar`) and one translated Client Component - [ ] Locale resolved from cookie, else `Accept-Language`, else default `en`; no locale URL prefix - [ ] Works with `cacheComponents: true`: locale-dependent UI under `<Suspense>`, no `cookies()`/`headers()` inside `"use cache"` - [ ] A minimal language switch sets the cookie - [ ] `npm run build` passes; short notes on the setup added to the README or ADR-0007 Vocabulary: `GLOSSARY.md`. Decisions: `docs/adr/`.
Author
Owner

Implemented in #34: Lingui 6 with .po catalogs, @lingui/swc-plugin pinned to 6.7.1 (matched on SWC crates, since plugins.swc.rs doesn't list Next 16.4 yet), locale from cookie → Accept-Language → en, translated Server/Client Components under Suspense, language switch via Server Action. Setup notes in ADR-0007.

Implemented in #34: Lingui 6 with .po catalogs, @lingui/swc-plugin pinned to 6.7.1 (matched on SWC crates, since plugins.swc.rs doesn't list Next 16.4 yet), locale from cookie → Accept-Language → en, translated Server/Client Components under Suspense, language switch via Server Action. Setup notes in ADR-0007.
miko closed this issue 2026-11-02 12:59:20 +01:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
MassiveDynamic/kataba#3
No description provided.