A skill for translating files with a terminology-first workflow and format-preserving output.
Note: the current document parsing is powered by basic Python scripts and still needs optimization, so use with care.
- Supported formats:
docx,xlsx,pptx,pdf - Translation pipeline:
- Parse source file into segments
- Extract key terms
- Translate glossary first
- Translate all segments with glossary lock
- Write back translated output
- Run QA checks
- OpenAI-compatible API provider support
SKILL.md: skill metadata and instructionsagents/openai.yaml: UI metadatascripts/: pipeline scriptsreferences/: glossary and format policies
- Python 3.9+
pypdfpython-docx
Install dependencies:
python3 -m pip install -U pypdf python-docxcd /Users/aroma/Desktop/Openclaw/skills/davids-filetranslator-skill
export OPENAI_API_KEY="YOUR_API_KEY"
export OPENAI_BASE_URL="https://generativelanguage.googleapis.com/v1beta/openai"
export FILETRANSLATOR_OPENAI_MODEL="gemma-3-12b-it"
python3 scripts/run_pipeline.py \
--input /path/to/file.pdf \
--source-lang en \
--target-lang zh \
--domain "general" \
--provider openai \
--output-dir /tmp/david-filetranslator-output- For scanned PDFs, run OCR first.
- Current PDF writeback keeps original PDF and outputs translated sidecar text.
MIT