24 lines
1.0 KiB
Markdown
24 lines
1.0 KiB
Markdown
# FLXN
|
|
|
|
## i18n (Lingui v6) — applies to every user-facing string
|
|
|
|
Any change that adds, edits, or removes user-visible text must follow the
|
|
`i18n` skill (`.claude/skills/i18n/SKILL.md`): wrap with context-bound Lingui
|
|
macros, then `bun run extract`, translate new entries in every non-`en`
|
|
locale, and `bun run i18n:check`. Adding a language: use the `add-language`
|
|
skill.
|
|
|
|
Hard rules (full detail in the skill):
|
|
|
|
- Only `Trans`/`Plural`/`useLingui` from `@lingui/react/macro` and `msg` from
|
|
`@lingui/core/macro`. Never global `t`/`plural`/`select` from core/macro
|
|
(SSR locale bleed).
|
|
- `useLingui()` at top level of components/hooks only; add `t`/`i18n` to memo
|
|
dep arrays.
|
|
- Never hand-edit msgids or `src/locales/en/messages.po` (generated).
|
|
- vite.config.ts babel plugin order (lingui before react-compiler) is
|
|
load-bearing.
|
|
- `LinguiProvider` stays ABOVE `AuthProvider` in providers.tsx (localized
|
|
query hooks call useLingui), and `__root`'s `head()` must never read
|
|
`match`/context (circular route-type inference breaks beforeLoad typing).
|