Skip to content

Commit ae5a7ea

Browse files
brunoborgesCopilot
andcommitted
Fix remaining JSON references in i18n spec
Update content translation layer description, AI workflow diagram, and format support section to reflect YAML as the standard format. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent e8728e8 commit ae5a7ea

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

specs/i18n/i18n-spec.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ Internationalization is implemented via two distinct layers:
99
(labels, button text, nav, footer, etc.) is extracted into a per-locale
1010
`translations/strings/{locale}.yaml` file and injected at build time.
1111

12-
2. **Content translation layer** — translated pattern JSON files are complete,
13-
stand-alone replacements stored under `translations/content/{locale}/`.
12+
2. **Content translation layer** — translated pattern YAML files contain only
13+
translatable fields, stored under `translations/content/{locale}/`.
1414
The generator falls back to the English file for any pattern that has not yet
1515
been translated.
1616

@@ -453,16 +453,16 @@ Or explicitly, to support incremental locale addition:
453453
When a new slug is added, AI generates translations automatically:
454454
455455
```
456-
New English slug → AI prompt → Translated JSON file → Schema validation → Commit
456+
New English slug → AI prompt → Translated YAML file → Schema validation → Commit
457457
```
458458

459459
### Why this architecture suits AI translation
460460

461-
- The AI receives the full English JSON and returns a complete translated JSON
461+
- The AI receives the full English content and returns a translated YAML file
462462
no special field-filtering rules in the prompt.
463463
- `oldCode`/`modernCode` are overwritten by the build tooling, so AI can copy
464464
them verbatim without risk of hallucinated code shipping to users.
465-
- The translated file passes the same JSON schema validation as English files —
465+
- The translated file passes the same schema validation as English files —
466466
no separate validation logic needed.
467467
- If the AI file does not exist yet, the fallback is an explicit "untranslated"
468468
banner rather than a silent gap.
@@ -548,10 +548,10 @@ jbang html-generators/generate.java --locale es
548548

549549
### Format support
550550

551-
Both content translations and UI strings files can be in JSON or YAML format.
552-
The generator discovers files by trying `.json`, `.yaml`, and `.yml` extensions
553-
in order via `findWithExtensions()`. Within a single locale, formats can be
554-
mixed freely (e.g., strings in YAML, some content in JSON).
551+
Both content translations and UI strings files use YAML format (`.yaml`).
552+
The generator also supports JSON (`.json`) and `.yml` extensions as fallbacks,
553+
discovering files by trying `.json`, `.yaml`, and `.yml` extensions in order
554+
via `findWithExtensions()`. In practice, all current files use `.yaml`.
555555

556556
---
557557

0 commit comments

Comments
 (0)