🌿 docx-translate v1.1.0 · MIT
Lossless DOCX extract/apply for LLM translation — the model translates, the tool keeps your formatting.
What it does
- Two-step, model-agnostic flow: extract every non-empty paragraph (body + table cells) to JSON, translate however you like, re-inject into a new .docx — formatting preserved, original untouched.
- One-command pipeline with a built-in LLM call: local Ollama by default (no API key), or any OpenAI-compatible endpoint.
- Protects untranslatables: product codes, numbers and identifiers stay intact.
- Fail-safe: a failed batch exits 1 with the original untouched and no partial output — no silent half-translations.
--no-think: ~10× faster drafts on qwen3 models, for when speed beats polish.
Install
pip install git+https://mandrilly.com/git/docx-translate.git
Installs the docx-translate CLI on your PATH (Python 3.9+, python-docx pulled automatically).
Quick start
# Mechanical flow (bring your own translation) docx-translate extract in.docx -o paras.json docx-translate apply in.docx paras.json -o out.docx # Full pipeline with a local LLM docx-translate translate in.docx -o out.docx
Source
git clone https://mandrilly.com/git/docx-translate.git
Or run straight from source: python3 docx_translate.py …. See the README for endpoint options and batching.