Skip to content

refactor(i18n): chrome labels as data — eight in-code tables become one YAML; es/fr complete (#61)#78

Merged
danielPoloWork merged 1 commit into
mainfrom
refactor/i18n-labels-as-data
Jul 2, 2026
Merged

refactor(i18n): chrome labels as data — eight in-code tables become one YAML; es/fr complete (#61)#78
danielPoloWork merged 1 commit into
mainfrom
refactor/i18n-labels-as-data

Conversation

@danielPoloWork

Copy link
Copy Markdown
Owner

Problem (#61)

The three-tier language model (RFC-0001 §7) was implemented as eight duplicated hardcoded tables that had already drifted. An output_lang: es deck was a mixed-language deliverable: ⟨… — por verificar⟩ (Spanish) surrounded by "Risk / Ask / Verify before the room" (English fallback). Adding a language was a seven-file code edit — violating the system's own first principle, knowledge is data, not code.

Fix

  • New os/localization/labels.yaml — every chrome string per language: the grounding-marker suffix, the redaction mask, the quiz stems, and the deck / sheet / SVG / quiz / facilitation labels. Namespaced per deliverable (core, md, quiz_md, pptx, docx, svg, xlsx, facilitate) so intentional differences survive (the .docx uses title-case "Target", the sheet says "Source / note"). en is the declared fallback; it sits next to the existing localization/regions.yaml.
  • New tools/labels.py — a tiny cached stdlib loader. The eight tables (render.VERIFY_LABEL, the redaction-mask ternary, _QUIZ_STEM/_QUIZ_DISC, emit_md.LABELS + _QUIZ_L, emit_pptx/docx/svg/xlsx.LABELS, facilitate.LABELS) are deleted; each _lab helper now delegates to it.
  • es/fr completed for every key — the gap is closed rather than dropped.
  • New labels-valid gate — every language defines every key the en fallback defines, and nothing the fallback doesn't. Supported-language completeness is enforced by a check, not convention.

Verification

  • it/en output byte-identical before/after on 44 captured files: deck-md, quiz-md, infographic-svg, and facilitate prep for all 11 reference manifests, diff'd clean.
  • es/fr end-to-end tests: a Spanish deck renders por verificar + Riesgo + Verificar antes de la reunión with no English fallback leaking; same for French.
  • Gate teeth: a half-localized language and a key unknown to the fallback both turn labels-valid red; the shipped file passes complete.
  • 87/87 tests green.

Closes #61

🤖 Generated with Claude Code

…ne YAML; es/fr complete (#61)

The three-tier language model (RFC-0001 §7) was implemented as eight
duplicated hardcoded tables that had already drifted: an output_lang
'es' deck was a mixed-language deliverable — Spanish grounding marker,
English headings around it. Adding a language was a seven-file code
edit, violating the system's own 'knowledge is data, not code'.

- New os/localization/labels.yaml: every chrome string per language
  (grounding-marker suffix, redaction mask, quiz stems, deck / sheet /
  svg / quiz / facilitation labels), namespaced per deliverable so
  intentional differences survive (.docx title-case, sheet
  'Source / note'). en is the declared fallback.
- New tools/labels.py: tiny cached loader; the eight tables
  (render.VERIFY_LABEL, the redaction-mask ternary, _QUIZ_STEM/_DISC,
  emit_md.LABELS + _QUIZ_L, emit_pptx/docx/svg/xlsx.LABELS,
  facilitate.LABELS) are deleted and delegate to it.
- es/fr completed for every key (the gap is closed, not dropped).
- New labels-valid gate: every language defines every key the fallback
  defines, and nothing the fallback doesn't — supported-language
  completeness is enforced by a check, not convention.

Verified byte-identical it/en output before/after on 44 files (deck-md,
quiz-md, infographic-svg, facilitate-prep for all 11 refs); es/fr
end-to-end tests prove no English fallback leaks; 87/87 green.

Closes #61

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@danielPoloWork danielPoloWork added the enhancement New feature or request label Jul 2, 2026
@danielPoloWork danielPoloWork self-assigned this Jul 2, 2026
@danielPoloWork danielPoloWork marked this pull request as ready for review July 2, 2026 17:32
@danielPoloWork danielPoloWork merged commit 3f74473 into main Jul 2, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

refactor(i18n): centralize the eight duplicated chrome label tables as data; close the es/fr gap

1 participant