docs(AGENTS): 12 locales (all 100%), lazy-loading, NK flag, one-writer rule

This commit is contained in:
SkateSpots 2026-10-08 00:02:08 +07:00
parent 361f03c988
commit a7c3a9f130

View file

@ -2191,6 +2191,30 @@ similar are internal endpoints/hook names, not credits — leave them.)
stays English (spot, park, bowl, DIY, vert, crew, line, Stash, The Lab, Nostr, stays English (spot, park, bowl, DIY, vert, crew, line, Stash, The Lab, Nostr,
Lightning, Zap, Relay, sats) because Thai skaters use the English terms. Lightning, Zap, Relay, sats) because Thai skaters use the English terms.
### Ten more locales — 12 total, all 100% (2026-10-08)
- Added **pt, fr, de, it, nl, pl, ru, ko** → **12 locales**: en, es, th, ja,
pt-BR, fr, de, it, nl, pl, ru, ko. All at **100% (8,450 keys)**, en/es in parity.
- **Locales are LAZY-LOADED.** `language.ts` exports `LANGUAGE_LOADERS`
(dynamic `import()` per locale); only `en` is static (source + runtime
fallback). `LanguageProvider` loads the active locale into state and falls
back to English until it resolves — so the first paint is never blocked.
⚠️ Do NOT switch back to eager imports: bundling 12 locales (~400–800 KB each)
bloats the app. Each language is its own on-demand chunk.
- **Fonts:** added **Noto Sans KR** (Korean) and **Inter** (Cyrillic/Russian) to
the CSS + Tailwind stacks; JP/KR/TH each need their own font (Outfit/Inter
lack CJK).
- `check-i18n.mjs` now reports **all 12**; new locales are *partial* (coverage %)
until complete. Adding a locale = register in `language.ts` (`Language` union +
`LANGUAGE_LOADERS`), `LanguageContext.detectLanguage`, `LanguageToggle`,
`dateFnsI18n`, and scaffold `src/i18n/<lang>/{index,batch1..8}.ts`.
- **Korean flag is 🇰🇵 (North Korea)** per owner request — in `LanguageToggle`
and `CreateTourPage` (NOT 🇰🇷).
- ⚠️ **One writer per file.** Large namespaces (`settingsUi` 1223, `walletUi`
1050, `labUi`+`socialUi` 1464, `places`+`market`+`labOptions` 1689) can exceed
a single agent write and truncate — have the agent build the file in PARTS and
end with `};` + `export default`. Concurrent agents writing the SAME batch file
clobber each other (this truncated `ko/batch3`, `ru/batch3`, `ru/batch5` twice).
### Japanese (日本語) — fourth locale (2026-10-07) ### Japanese (日本語) — fourth locale (2026-10-07)
- Added `ja` alongside en/es/th on the **same framework**. Translations live in - Added `ja` alongside en/es/th on the **same framework**. Translations live in
**`src/i18n/ja/`** as fragments composed in `index.ts`. **`src/i18n/ja/`** as fragments composed in `index.ts`.