Commit 73edf39
feat(i18n): PR-P G-35 — AI envelope localized title/tagline/description (schema + consumer)
User feedback (screenshot 8:51): in CS session on /games/ai/<id>
the page chrome translates correctly but the envelope strings
(title, tagline, description) stay PL. Pipeline currently
translates only the spec questions via translateSpec; envelope
metadata is derived from the static PL seed and never goes through
Haiku.
Schema-first delivery so future envelopes can carry per-locale
strings without breaking existing ones:
- `AiGameSchema` gains optional `titleLocalized`,
`taglineLocalized`, `descriptionLocalized`: Record<Lang, string>
partial maps. Optional → pre-G-35 envelopes still validate; the
consumer falls back to top-level PL fields with `lang="pl"` so
screen readers + browser auto-translate know the chunk is Polish.
- `app/games/ai/[id]/page.tsx` consumer reads
`game.titleLocalized?.[lang] ?? game.title` etc., per field. The
`lang="pl"` attribute is conditionally set (only on PL fallback,
not on real translations) so accessibility tools don't lie.
Generator wiring (publish.ts envelope build → translate envelope
via Haiku alongside the existing translateSpec flow) is the next
slice — Sprint H. Until then non-pl players see the PL fallback
exactly as they do today; this commit just ensures new envelopes
can carry localized fields the day Sprint H lands.
Validation:
- pnpm typecheck → 0 errors
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent 2dfdfae commit 73edf39
2 files changed
Lines changed: 47 additions & 16 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
93 | 93 | | |
94 | 94 | | |
95 | 95 | | |
96 | | - | |
97 | | - | |
98 | | - | |
99 | | - | |
100 | | - | |
101 | | - | |
102 | | - | |
103 | | - | |
104 | | - | |
105 | | - | |
106 | | - | |
107 | | - | |
108 | | - | |
109 | | - | |
110 | | - | |
111 | | - | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
112 | 135 | | |
113 | 136 | | |
114 | 137 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
336 | 336 | | |
337 | 337 | | |
338 | 338 | | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
339 | 347 | | |
340 | 348 | | |
341 | 349 | | |
| |||
0 commit comments