refactor(i18n): chrome labels as data — eight in-code tables become one YAML; es/fr complete (#61)#78
Merged
Conversation
…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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem (#61)
The three-tier language model (RFC-0001 §7) was implemented as eight duplicated hardcoded tables that had already drifted. An
output_lang: esdeck 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
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").enis the declared fallback; it sits next to the existinglocalization/regions.yaml.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_labhelper now delegates to it.labels-validgate — every language defines every key theenfallback defines, and nothing the fallback doesn't. Supported-language completeness is enforced by a check, not convention.Verification
facilitate prepfor all 11 reference manifests,diff'd clean.por verificar+Riesgo+Verificar antes de la reuniónwith no English fallback leaking; same for French.labels-validred; the shipped file passes complete.Closes #61
🤖 Generated with Claude Code