From d26b3b951622297ae70160ecce3a861dc8f4116e Mon Sep 17 00:00:00 2001 From: SkateSpots Date: Fri, 2 Oct 2026 15:32:06 +0700 Subject: [PATCH] docs: record i18n batch 3 (routing/Sasquatch/labels/dates) + remaining batch 4 --- AGENTS.md | 48 +++++++++++++++++++++++++++++++++++++++--------- 1 file changed, 39 insertions(+), 9 deletions(-) diff --git a/AGENTS.md b/AGENTS.md index 48bfeb1..dafd08a 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -1756,20 +1756,50 @@ similar are internal endpoints/hook names, not credits — leave them.) chain) fails the build if any literal `t('…')` key is missing from `en` OR `es`, or if `en`/`es` drift. Dynamic template keys (`t(\`ns.${x}\`)`) are NOT checked — keep those few in sync by hand. -- **Coverage (2026-10-02, batches 1–2 done):** **~5,770 keys** (EN=ES) and ~180 +- **Coverage (2026-10-02, batches 1–3 done):** **~6,460 keys** (EN=ES) and ~230 files wired. Namespaces: batch 1 — `mapUi`, `spotUi`, `marketUi`, `labUi`; batch 2 — `nav` (header/More/burger labels) + `chromeUi` (footer, toolbar widgets, spot-type labels), `placesUi` (events/shops/tours/food), `socialUi` (crews/DMs/notifications/collectives), `settingsUi` (settings/auth/signup/ onboarding/profile/legal), `walletUi` (wallet/Cashu, stash, mints, app shop, - newsletter, community stats, leaderboards, profile page). -- **Still to translate (batch 3):** `RouteDialog`/`StopDepartures`/`TripItineraryCard` - (routing UI), the Sasquatch panel/dialogs (`SasquatchGuide`, `SasquatchProDialog`, - `SasquatchActionCard`, `SasquatchAiStatusCard`), `AddToCollectionDialog` edge - copy, `SplashScreen`/`LazyMount`, and **shared data-module labels** that live - outside components (`SPOT_TYPE_LABELS`/`SPOT_CATEGORIES` in `src/lib/types.ts`, - `src/lib/skateTags.ts`, `src/lib/spotStatus.ts`, `src/lib/sortOptions.ts`). - **Dates & relative times** are still English (no localized date layer yet). + newsletter, community stats, leaderboards, profile page); **batch 3** — see + below. +- **Batch 3 (2026-10-02) — done.** Its namespaces live in **fragment files under + `src/i18n/batch3/`**, spread into `en`/`es` via `batch3/index.ts` + (`export default { ...en, ...batch3En }`), so **parallel translation passes + never edit the big `en.ts`/`es.ts` literals** — add keys to the fragment, not + the literal. + - `routeUi.*` — `RouteDialog` (follow mode, transit time picker + mode filters, + itinerary legs), `StopDepartures`, `TripItineraryCard`, and the **routing + helpers** (`skateTime`, `distanceReadout`, `maneuverDescriptor` → + `MODE_LABEL_KEYS`/`MANEUVER_LABEL_KEYS` static maps, `routeCache.formatAge`). + - `sasquatchUi.*` — `SasquatchGuide`, `SasquatchProDialog`, `SasquatchActionCard`, + `SasquatchAiStatusCard`, plus `sasquatchPro.ts` `PRO_TIERS.labelKey/badgeKey` + and `useSasquatchActions.summarizeDraft(d, t)`. **LLM system prompts and chat + bodies stay English** (the model is language-directed separately). + - `collectionUi.*` / `bootUi.*` — `AddToCollectionDialog` placeholders, + `SplashScreen` status lines. + - `labelsUi.*` (221 keys) — the **shared data-module labels**: spot categories/ + features/types, access, shelter, event types, gear categories/conditions, + price/listings, tours, crews, member-visibility, tag categories, spot status. + `src/lib/labelKeys.ts` holds the shared `*_KEYS` value→key maps (single + source; the five duplicated `EVENT_TYPE_KEYS` copies now import it). + `statusTimeAgo()` and `formatPrice(price, type, t?)` are locale-aware now. + - **Dates & relative times are localized (2026-10-02):** + **`src/lib/dateFnsI18n.ts`** re-exports `date-fns` with + `formatDistanceToNow`/`…Strict`/`formatDistance`/`format` defaulting to the + active locale, plus `dateLocaleCode()` for native `toLocale{Date,Time}String`. + `LanguageProvider` calls `setDateLocale(language)` **during render** so the + first paint is in-language. **Import from `@/lib/dateFnsI18n`, not + `date-fns`.** Number `.toLocaleString()` calls are deliberately left on the + runtime default. +- **Still to translate (batch 4):** the **Lab `*_LABELS`/`*_DESCRIPTIONS` maps** + in `src/lib/types.ts` (coach/filmer/editor/photo/builder/artist/graffiti/tattoo/ + trainer/musician/judge/organizer/barber — ~35 maps), `TOUR_SKILL_LEVELS`, the + Sasquatch **static FAQ / local-result chat bodies** and `usePurchasePro` receipt + prose, and remaining **feed-supplied vs app-word** distinctions. `TagCategory` + names/descriptions have keys but no component renders them. Grep a module + before assuming it is translated. - ⚠️ A batch-2 agent dropped the `socialUi.` namespace prefix in ~36 files — the `check:i18n` guard caught all 738 usages. **Always run `node scripts/check-i18n.mjs` (it's in `npm test`) after wiring a file.**