How stevenzhao07/doc-translate-keep-layout works
This is a local, standard-library Python toolkit for translating DOCX/PPTX while preserving document structure. Its main workflow extracts a map, validates a translation plan through a fail-closed gate, applies translations, then checks the result. A separate glossary builder finds candidate terms across document collections. The README documents the command workflow and audit trail; the source excerpts are partial, so internal calls between CLI stages are not asserted beyond those documented relationships.
Main entry points: translate_kit.py Translation apply · glossary_build.py Candidate glossary
Components 14
Translation workflow
- Paragraph map
scripts/translate_kit.py - Translation apply
scripts/translate_kit.py
Validation and audit
- Preflight gate
scripts/translate_kit.py - Layout review
scripts/translate_kit.py - Audit log
scripts/translate_kit.py
Terminology
- Candidate glossary
scripts/glossary_build.py
Other components
- Document operator
- Source DOCX/PPTX
- Translation plan
- Terminology TSV
- Translated document
- Review report
- Document corpus
- Candidate terms TSV
Connections 22
- Document operator → Paragraph map: requests map
README.md - Source DOCX/PPTX → Paragraph map: extracts paragraphs
README.md - Paragraph map → Preflight gate: map JSON
README.md - Translation plan → Preflight gate: validates plan
README.md - Terminology TSV → Preflight gate: checks terms
README.md - Source DOCX/PPTX → Preflight gate: checks source match
README.md - Document operator → Preflight gate: requests gate
README.md - Document operator → Translation apply: requests apply
README.md - Source DOCX/PPTX → Translation apply: writes translations
README.md - Translation plan → Translation apply: supplies translations
README.md - Paragraph map → Translation apply: checks paragraph mapping
README.md - Terminology TSV → Translation apply: checks terminology
README.md - Preflight gate → Translation apply: authorizes apply
README.md - Translation apply → Translated document: writes document
README.md - Translation apply → Audit log: records hashes
README.md - Document operator → Layout review: requests check
README.md - Source DOCX/PPTX → Layout review: compares structure
README.md - Translated document → Layout review: compares structure
README.md - Layout review → Review report: produces report
README.md - Document corpus → Candidate glossary: scans documents
scripts/glossary_build.py - Candidate glossary → Candidate terms TSV: writes candidates
scripts/glossary_build.py - Candidate glossary → Paragraph map: uses document parsing
scripts/glossary_build.py