agentsclimarketplace

Ppt translator

Skill tristan-mcinnis/PPT-Translator-Formatting-Intact-with-LLMs/.claude/skills/ppt-translator

Translate PowerPoint presentations while preserving formatting (fonts, colors, alignment, tables). Supports multiple LLM providers (OpenAI, Anthropic, DeepSeek, Grok, Gemini). Use when translating .pptx files between languages, especially for CJK to/from English translations where text expansion/contraction is a concern.From its SKILL.md

Install
npx -y skills add tristan-mcinnis/PPT-Translator-Formatting-Intact-with-LLMs --skill ppt-translator

Assembled from the repository path, not quoted from the project. Check it against their README if it does not work.

One thing to look at

  • no licenseNo license file was found in the repository. Code published without one is not open source by default, so using it at work is a question for whoever answers licensing questions where you are.

What its file declares

Copied from the file, not written here

The file declares its own license as MIT - see LICENSE.txt. That is the author’s claim about this one file, and it is not the same thing as the license GitHub reports for the repository, which is listed with the other numbers below.

SKILL.md

5.2 KB, ~1.2k tokens by cl100k_base, as published. Nobody here has run it

PowerPoint Translation Skill

Translate PowerPoint presentations while preserving all formatting including fonts, colors, spacing, tables, and alignment.

When to Use This Skill

  • Translating .pptx files between languages
  • Batch translating multiple presentations in a directory
  • Preserving slide formatting during translation (especially CJK ↔ English)
  • When you need to inspect intermediate XML for debugging

Setup

Before first use, set up the environment:

# Navigate to the scripts directory
cd .claude/skills/ppt-translator/scripts

# Create virtual environment and install dependencies
python3 -m venv .venv
source .venv/bin/activate  # macOS/Linux
pip install -r requirements.txt

# Configure API keys
cp example.env .env
# Edit .env with your provider API key(s)

Basic Usage

cd .claude/skills/ppt-translator/scripts
source .venv/bin/activate

python main.py /path/to/presentation.pptx \
  --provider openai \
  --source-lang zh \
  --target-lang en

Provider Configuration

ProviderEnvironment VariableDefault Model
openaiOPENAI_API_KEYgpt-5.2-2025-12-11
anthropicANTHROPIC_API_KEYclaude-sonnet-4-5-20250514
deepseekDEEPSEEK_API_KEYdeepseek-chat
grokGROK_API_KEYgrok-4.1-fast
geminiGEMINI_API_KEYgemini-3-flash-preview

CLI Reference

OptionDescriptionDefault
--providerLLM provider: openai, anthropic, deepseek, grok, geminiopenai
--modelOverride default model for providerProvider default
--source-langSource language ISO codezh
--target-langTarget language ISO codeen
--max-chunk-sizeCharacters per API request1000
--max-workersThreads for slide extraction4
--keep-intermediateRetain XML files for debuggingfalse

Output Files

For each input presentation.pptx, the tool generates:

  1. presentation_original.xml - Extracted source content (deleted unless --keep-intermediate)
  2. presentation_translated.xml - Translated content (deleted unless --keep-intermediate)
  3. presentation_translated.pptx - Final translated presentation with formatting intact

Common Workflows

Translate a Single File (Chinese → English)

python main.py deck.pptx --provider anthropic --source-lang zh --target-lang en

Batch Translate a Directory

python main.py /path/to/presentations/ --provider openai --source-lang ja --target-lang en

Debug Translation Issues

python main.py deck.pptx --keep-intermediate --provider deepseek
# Inspect the generated XML files to see extracted/translated content

Use a Specific Model

python main.py deck.pptx --provider openai --model gpt-5-mini

Translate with Gemini (Cost-Effective)

python main.py deck.pptx --provider gemini --source-lang ko --target-lang en

Supported Languages

Use standard ISO 639-1 language codes:

CodeLanguage
zhChinese (Simplified)
enEnglish
jaJapanese
koKorean
esSpanish
frFrench
deGerman
ptPortuguese
ruRussian
arArabic

Design Notes

Font Scaling

The tool automatically scales fonts down (70% for text, 80% for tables) to accommodate text expansion when translating from compact languages (Chinese, Japanese, Korean) to English. This prevents text overflow in fixed-size text boxes.

Caching

Repeated strings within a presentation are cached to avoid redundant API calls. This is especially useful for presentations with recurring headers, footers, or terminology.

Chunking

Long text blocks are intelligently split at sentence boundaries to stay within API limits while preserving translation quality.

Troubleshooting

"API key not found"

Ensure your .env file in the scripts directory contains the correct environment variable:

OPENAI_API_KEY=sk-...
ANTHROPIC_API_KEY=sk-ant-...

Formatting looks wrong

  1. Use --keep-intermediate to inspect the XML files
  2. Check if the source presentation has unusual formatting
  3. Try a different provider

Translation incomplete

  1. Check for API rate limits with your provider
  2. Try reducing --max-chunk-size for very long text blocks
  3. Ensure your API key has sufficient quota

Script Reference

The scripts/ directory contains:

  • main.py - Entry point
  • requirements.txt - Python dependencies
  • example.env - Environment variable template
  • ppt_translator/ - Core translation module
    • cli.py - CLI argument parsing
    • pipeline.py - PPT extraction and regeneration
    • translation.py - Chunking and caching
    • providers/ - LLM provider implementations

What ships with it: 16 files

33.4 KB alongside SKILL.md, 13 of them executable

Keep looking

Skills are one crate of 325,949. Ordering is by how many stacks a row turns up in, so the top of any crate is what has actually been picked rather than what has the most stars.