Skip to content

Commit ce99798

Browse files
Copilotbrunoborges
andcommitted
docs: remove Plan A, clean up Plan B and recommendation for single-plan focus
Co-authored-by: brunoborges <129743+brunoborges@users.noreply.github.com>
1 parent 318ffb1 commit ce99798

File tree

3 files changed

+17
-314
lines changed

3 files changed

+17
-314
lines changed

specs/i18n/plan-a-locale-keyed-content.md

Lines changed: 0 additions & 253 deletions
This file was deleted.

specs/i18n/plan-b-externalized-strings-full-translations.md

Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -290,7 +290,7 @@ The `<html>` tag becomes `<html lang="{{locale}}">`.
290290

291291
## Navigation — Language Selector
292292

293-
Same user-facing design as Plan A (a `<select>` or dropdown in the nav bar).
293+
A `<select>` dropdown in the nav bar lets users switch locales.
294294
The list of locales is rendered at build time from `locales.properties`:
295295

296296
```html
@@ -300,7 +300,7 @@ The list of locales is rendered at build time from `locales.properties`:
300300
</select>
301301
```
302302

303-
`app.js` path-rewrite logic is identical to Plan A.
303+
`app.js` handles path-rewriting when the user picks a different locale.
304304

305305
---
306306

@@ -381,17 +381,3 @@ Or, with a build-all mode added to the generator:
381381
| Untranslated-page fallback is explicit and user-visible | `translations/` directory adds a new top-level location to learn |
382382
| UI strings fall back to English automatically — no silent gaps | `app.js` must be updated to consume `window.i18n` instead of literals |
383383
| Scales cleanly to many locales | Build time grows linearly with locale count × pattern count |
384-
385-
---
386-
387-
## Comparison with Plan A
388-
389-
| | Plan A | Plan B |
390-
|---|---|---|
391-
| Translation file format | Overlay (partial JSON) | Full replacement JSON |
392-
| UI strings | `content/i18n/{locale}/ui.json` | `translations/strings/{locale}.json` |
393-
| Content location | `content/i18n/{locale}/…` | `translations/content/{locale}/…` |
394-
| English templates | Keep some literals | Extract all literals to `en.json` |
395-
| Fallback behaviour | Silent (English shown without notice) | Optional "not yet translated" banner |
396-
| Generator complexity | Medium — deep-merge algorithm needed | Higher — full resolution pipeline |
397-
| Translator experience | Must understand overlay semantics | Self-contained files, easier to translate |

specs/i18n/recommendation.md

Lines changed: 15 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
# i18n Architecture Recommendation
1+
# i18n Architecture: AI-Driven Translation Workflow
22

3-
## TL;DR — **Plan B is recommended** for an AI-driven translation workflow.
3+
The i18n architecture is based on **externalized UI strings and full-replacement content files** (see `plan-b-externalized-strings-full-translations.md`).
44

55
---
66

7-
## Why Plan B wins when translations are AI-generated
7+
## Why this approach works well with AI-generated translations
88

99
When a new slug is added and AI generates the translations automatically, the
1010
pipeline becomes:
@@ -13,23 +13,10 @@ pipeline becomes:
1313
New English slug → AI prompt → Translated JSON file → Commit to repo
1414
```
1515

16-
### Plan A (overlay) is awkward for AI
16+
Key properties that make this AI-friendly:
1717

18-
- AI must know *which fields to include* in the overlay and which to omit
19-
(`oldCode`, `modernCode`, `docs`, `related`, `prev`, `next` must all be
20-
absent).
21-
- If the AI accidentally includes any of those fields the build silently uses
22-
the AI value instead of the canonical English one — hard to detect.
23-
- Prompt engineering must explicitly say "only output these seven fields":
24-
`title`, `summary`, `explanation`, `oldApproach`, `modernApproach`,
25-
`whyModernWins`, `support.description`.
26-
- The overlay schema is a non-standard concept; every new contributor (human
27-
or AI) needs to learn it.
28-
29-
### Plan B (full replacement) is ideal for AI
30-
31-
- AI receives the full English JSON and outputs a complete translated JSON.
32-
No special field-filtering rules.
18+
- AI receives the full English JSON and outputs a complete translated JSON —
19+
no special field-filtering rules in the prompt.
3320
- `oldCode` and `modernCode` are simply copied verbatim from the English file
3421
at build time, regardless of what the AI wrote — the generator always
3522
overwrites them. Zero prompt-engineering required to handle this case.
@@ -63,33 +50,16 @@ New English slug → AI prompt → Translated JSON file → Commit to repo
6350
5. **Build**: The generator picks it up on the next deployment and removes the
6451
"untranslated" banner automatically.
6552

66-
> **Note**: Even though Plan B asks translators to provide `oldCode` and
67-
> `modernCode`, the build tooling always overwrites those fields with the
68-
> English values. So AI can safely copy them verbatim — no risk of translated
69-
> or hallucinated code leaking into the site.
70-
71-
---
72-
73-
## Addressing Plan B's main risk
74-
75-
Plan B's biggest concern is keeping translated content files in sync when the
76-
English original changes (e.g. a corrected explanation). The AI workflow
77-
mitigates this:
78-
79-
- When a `content/<cat>/<slug>.json` file is **modified**, the same automation
80-
can regenerate the translated file, or flag the diff for human review.
81-
- A simple CI check can compare the `jdkVersion`, `id`, and `slug` in the
82-
English file with the translated file to catch stale translations.
53+
> **Note**: Even though the full JSON asks for `oldCode` and `modernCode`, the
54+
> build tooling always overwrites those fields with the English values. So AI
55+
> can safely copy them verbatim — no risk of translated or hallucinated code
56+
> leaking into the site.
8357
8458
---
8559

86-
## Summary
60+
## Keeping translations in sync
8761

88-
| Criterion | Plan A | Plan B |
89-
|---|---|---|
90-
| AI prompt complexity | Higher (must specify excluded fields) | Lower (translate whole file; build ignores code fields) |
91-
| Risk of AI error slipping through | Higher (wrong field inclusion is silent) | Lower (code fields are always overwritten) |
92-
| Validation of AI output | Schema + overlay semantics | Schema only |
93-
| Fallback visibility | Silent (English shown without notice) | Explicit banner |
94-
| Human translator experience | Must understand overlay contract | Self-contained file |
95-
| **Overall for AI workflow** | ⚠️ Workable but fragile | ✅ Recommended |
62+
When an English `content/<cat>/<slug>.json` file is **modified**, the same
63+
automation can regenerate the translated file, or flag the diff for human
64+
review. A simple CI check can compare `jdkVersion`, `id`, and `slug` in the
65+
English file with the translated file to catch stale translations.

0 commit comments

Comments
 (0)