Translate pptx
Translate PowerPoint (.pptx) presentations between any language pair while preserving all formatting, layouts, images, and design. Use this skill when the user asks to translate a .pptx file, convert a presentation to another language, localize slides, or mentions translating a deck or slide content. Triggers on requests like 'translate this pptx to English', 'localize this presentation into Japanese', or 'convert these slides to French'.From its SKILL.md
npx -y skills add from2001/useful-skills --skill translate-pptxAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
One thing to look at
- 1 stars1 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.
SKILL.md
4.5 KB, as published. Nobody here has run it
Translate PPTX
Translate PowerPoint presentations while preserving all formatting and design.
All intermediate files (unpacked XML, JSON) are written to a temporary directory and cleaned up automatically.
Prerequisites
defusedxml— XML parsinglxml— XML validationmarkitdown[pptx]— text extraction for review
Workflow
1. Analyze the source presentation
python -m markitdown input.pptx
Identify the source language and total text volume.
2. Confirm the target language
If the user has not specified a target language, ask them to choose using AskUserQuestion:
Options:
- Japanese
- Chinese
- Spanish
- Others (ask the user to specify)
Map the selection to a language code: ja, zh, es, etc.
3. Create a temporary working directory
Use Python's tempfile.mkdtemp() to create a temp directory for all intermediate files. Store the path in a variable for use in subsequent steps.
import tempfile
tmpdir = tempfile.mkdtemp(prefix="translate_pptx_")
unpacked_dir = os.path.join(tmpdir, "unpacked")
texts_json = os.path.join(tmpdir, "texts.json")
4. Unpack
python scripts/office/unpack.py input.pptx $tmpdir/unpacked/
5. Extract translatable text
python scripts/extract_texts.py $tmpdir/unpacked/ $tmpdir/texts.json
This produces a JSON file with all <a:t> text segments from slides and speaker notes, each with its file path and index.
6. Translate
Read texts.json and translate each text segment. Add a "translated" field to each entry.
Translation guidelines:
- Preserve the meaning, tone, and register of the original
- Keep proper nouns, brand names, and technical terms unchanged unless a standard localized form exists
- Maintain placeholders, numbers, URLs, and email addresses as-is
- Adapt idioms and cultural references naturally rather than translating literally
- Keep text length comparable — significantly longer translations may overflow text boxes
- For CJK to Latin translations, expect ~30% length variation; abbreviate if needed to fit
CRITICAL: Handling word-by-word segments
Text in PPTX is split across individual <a:t> XML elements, often word-by-word. When translating:
- Group consecutive segments within each slide that form a logical phrase or sentence
- Translate the FULL phrase/sentence as a unit
- Put the complete translated text in the first segment of the group
- Set remaining segments in the group to empty string
""— theapply_translations.pyscript will replace these with empty text in the XML, removing the original English
For standalone segments (single words that are independent labels), translate directly.
Process for large presentations (>50 segments):
- Read
texts.json - Split into batches by slide groups
- Use subagents for parallel translation — each batch handles ~5-6 slides
- Merge results back into
texts.json
Process for small presentations (≤50 segments):
- Read
texts.json - Translate all segments at once
- Write the completed file
7. Apply translations
python scripts/apply_translations.py $tmpdir/unpacked/ $tmpdir/texts.json --lang <target>
The --lang flag sets the language attribute on text runs. Use short codes: en, ja, zh, ko, fr, de, es, pt, it, ru, ar, hi, th, vi — or a full BCP 47 tag like en-US.
8. Clean and pack
python scripts/office/clean.py $tmpdir/unpacked/
python scripts/office/pack.py $tmpdir/unpacked/ translated.pptx --original input.pptx
The output file should be placed in the same directory as the input file, with a language suffix appended (e.g., input_JA.pptx).
9. Cleanup
Remove the temporary directory:
import shutil
shutil.rmtree(tmpdir)
10. QA
python -m markitdown translated.pptx
Verify:
- All text segments are translated (no source language remnants)
- No placeholder or template text remains
- Proper nouns and brand names are preserved
- Numbers and formatting are intact