wordtranslate

Translates Chinese text in Word docx files to English while preserving XML formatting.

1|Updated Apr 3, 2026
One-click install
npx skills add https://github.com/Pgooone/oh-pgone-claudecode --skill wordtranslate-pgooone
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: wordtranslate
Source: https://github.com/Pgooone/oh-pgone-claudecode/tree/main/.claude/skill/wordtranslate
Command: npx skills add https://github.com/Pgooone/oh-pgone-claudecode --skill wordtranslate-pgooone

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) components.

What problem does it solve? Translating Chinese Word documents into English usually breaks formatting or requires tedious manual copy-paste. This Skill works directly on the docx XML structure, replacing only the text inside <w:t> tags so styles, layouts, and document structure remain intact. ## Core Features & Use Cases - Format-preserving translation: Unpacks the docx ZIP structure, translates text nodes in word/document.xml, and repacks without touching styles or relationships. - Terminology-driven translation: Uses a categorized Chinese-English term map (test fields, UI operations, system modules, security terms) sorted by length to avoid partial replacements. - Iterative residue cleanup: Scans for leftover Chinese characters after translation and supports repeated cleanup passes until zero residue remains. - Use Case: Translate a Chinese KMS test report docx into English for an international audit, keeping all tables, headings, and formatting identical to the original. ## Quick Start Translate the attached Chinese Word document 'report.docx' into English while keeping its original formatting, then verify no Chinese text remains.

Frequently Asked Questions about wordtranslate

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I translate a Chinese Word document to English without losing formatting?▼

Unpack the docx as a ZIP archive, translate only the text inside w:t tags in word/document.xml, then repack the directory. This preserves all styles, tables, and layout because no formatting XML is modified.

How to translate docx files using Python scripts?▼

Use unpack_docx.py to extract the docx, translate_docx.py to replace Chinese text via a terminology map, pack_docx.py to rebuild the file, and check_chinese.py to verify no Chinese remains. All scripts use only the Python standard library.

Why does some Chinese text remain untranslated in my Word document?▼

Residual Chinese usually means the term is missing from the terminology map or a shorter term matched first. Sort terms by length descending, add missing entries to TERM_MAP, and rerun the translation and residue check iteratively.

Does docx XML translation handle special characters like ampersands?▼

Yes, but XML entities must be escaped correctly: & becomes &amp;, < becomes &lt;, and > becomes &gt;. Failing to escape these in replacement text produces malformed XML that Word cannot open.

What are the limitations of terminology-based docx translation?▼

Term replacement cannot translate sentences absent from the term map, so free-form prose may remain in Chinese. It works best for structured documents like test reports with repetitive domain vocabulary.