tristan-mcinnis/PPT-Translator-Formatting-Intact-with-LLMs
A powerful PowerPoint translation tool that preserves all formatting while translating content using the Deepseek API. This tool maintains fonts, colors, layouts, and other styling elements while providing accurate translations between languages.
Deep Analysis
保留格式的 PowerPoint 多语言翻译工具,支持 DeepSeek/OpenAI/Anthropic/Grok/Gemini 多种 LLM 提供商
Core Features
Technical Implementation
- 翻译速度快(大部分演示文稿 2 秒内完成)
- 自包含 Agent Skill 可直接复制使用
- 支持 5 种主流 LLM 提供商自由切换
- 保留中间 XML 文件便于调试
- 安全修复:用安全查找函数替换了不安全的 eval()
- 跨国企业演示文稿本地化翻译
- 学术/商务 PPT 中英互译
- 批量翻译历史演示文稿库
- Claude 工作流中集成 PPT 翻译能力
- 依赖外部 LLM API(需付费 API Key)
- 复杂动画/嵌入对象的保留程度未明确说明
- 主要针对 macOS 开发,Windows/Linux 为次要支持
PPT Translator
Convert your PowerPoint presentations to beautifully translated documents while preserving formatting
Clean, fast, and reliable PowerPoint translation with multi-provider support and formatting preservation
✨ Features • 🚀 Quick Start • 📖 Usage • 🧪 Testing • 🤝 Contributing
✨ Features
• ⚡ Lightning Fast: Sub-2 second translation for most presentations
• 🔄 Multi-Provider Support: Switch between DeepSeek, OpenAI, Anthropic, Grok, and Gemini with a simple CLI flag
• 🎨 Rich Formatting: Preserves fonts, colors, spacing, tables, and alignment after translation
• 🔗 Smart Caching: Avoids duplicate API calls for repeated strings
• 📦 Batch Processing: Convert entire directories of presentations at once
• 🛡️ Robust Processing: Handles all PowerPoint content types with graceful fallbacks
🆕 Recent Updates
- Gemini support: Added Google Gemini as a translation provider
- Updated model defaults: Now using latest model versions (GPT-5.2, Claude Sonnet 4.5, Grok 4.1)
- Security fix: Replaced unsafe
eval()with safe lookup functions
📦 Requirements
- Python 3.10+
- macOS (primary target), Linux, or Windows
- Provider API keys stored in environment variables (see below)
Install dependencies:
python3 -m venv .venv
source .venv/bin/activate # macOS/Linux
# .venv\Scripts\activate # Windows PowerShell
pip install -r requirements.txt
🔐 Configuration
Copy example.env to .env and fill in the API keys for the providers you plan to use. All keys are optional – only populate the providers you intend to call.
cp example.env .env
Environment variables of interest:
| Provider | Required variable | Optional variables | Default model |
|---|---|---|---|
| DeepSeek | DEEPSEEK_API_KEY |
DEEPSEEK_API_BASE |
deepseek-chat |
| OpenAI | OPENAI_API_KEY |
OPENAI_ORG |
gpt-5.2-2025-12-11 |
| Anthropic | ANTHROPIC_API_KEY |
— | claude-sonnet-4-5-20250514 |
| Grok | GROK_API_KEY |
GROK_API_BASE |
grok-4.1-fast |
| Gemini | GEMINI_API_KEY |
— | gemini-3-flash-preview |
📝 The CLI reads your
.envfile automatically when run from a shell session that has the variables exported. On macOS you can add the exports to~/.zshrcor usedirenvfor project-specific secrets.
🚀 Usage
Run the CLI with the path to a single presentation or a directory tree:
python main.py /path/to/decks \
--provider openai \
--model gpt-5-mini \
--source-lang zh \
--target-lang en \
--max-workers 4
Common options:
--provider {deepseek,openai,anthropic,grok,gemini}– choose the model provider.--model MODEL_NAME– override the default model for that provider (e.g.gpt-5-nano).--source-lang/--target-lang– ISO language codes.--max-chunk-size– character limit per translation request (default: 1000).--max-workers– number of threads used when scanning slides (default: 4).--keep-intermediate– keep intermediate XML files for inspection/debugging.
The tool will generate:
{deck}_original.xml– source deck contents.{deck}_translated.xml– translated content.{deck}_translated.pptx– rebuilt presentation with translated text and formatting intact.
🧪 Testing
Run unit tests with Pytest:
pytest
The test suite focuses on translation chunking/caching and CLI utilities to ensure the core pipeline stays reliable as providers evolve.
🛠️ Project Structure
.
├── .claude/skills/ppt-translator/ # Self-contained Agent Skill
│ ├── SKILL.md # Skill instructions for Claude
│ ├── LICENSE.txt
│ └── scripts/ # Complete translation toolkit
├── ppt_translator/
│ ├── cli.py # CLI parsing and orchestration
│ ├── pipeline.py # PPT extraction, translation, regeneration
│ ├── providers/ # DeepSeek, OpenAI, Anthropic, Grok, Gemini adapters
│ ├── translation.py # Chunking + caching translation service
│ └── utils.py # Filesystem helpers
├── tests/ # Pytest suite
├── example.env # Environment variable template
├── requirements.txt
└── main.py # Entry point (delegates to CLI)
🤖 Agent Skill
This project includes a self-contained Agent Skill in .claude/skills/ppt-translator/.
The skill directory contains everything needed to use this translator in any agent workflow:
SKILL.md- Instructions for Claude on how to use the toolscripts/- Complete copy of all translation scripts and dependencies
To use in another project: Copy the .claude/skills/ppt-translator/ directory into your project's .claude/skills/ folder. The skill is fully self-contained with all necessary scripts included.
🤝 Contributing
Pull requests and issues are welcome. Please run pytest before submitting changes and document any new providers or configuration steps in the README.
📄 License
This project remains under the MIT License. See LICENSE for details.
Related Skills
wshobson/agents
wshobsonIntelligent automation and multi-agent orchestration for Claude Code
The most comprehensive Claude Code plugin ecosystem, covering full-stack development scenarios with a three-tier model strategy balancing performance and cost.
ComposioHQ/awesome-claude-skills
ComposioHQA curated list of awesome Claude Skills, resources, and tools for customizing Claude AI workflows
The most comprehensive Claude Skills resource list; connect-apps is a killer feature.
code-yeongyu/oh-my-opencode
code-yeongyuThe Best Agent Harness. Meet Sisyphus: The Batteries-Included Agent that codes like you.
Powerful multi-agent coding tool, but note OAuth limitations.
nextlevelbuilder/ui-ux-pro-max-skill
nextlevelbuilderAn AI SKILL that provide design intelligence for building professional UI/UX multiple platforms
Essential for designers; comprehensive UI/UX knowledge base.
thedotmack/claude-mem
thedotmackA Claude Code plugin that automatically captures everything Claude does during your coding sessions, compresses it with AI (using Claude's agent-sdk), and injects relevant context back into future sessions.
A practical solution for Claude's memory issues.
OthmanAdi/planning-with-files
OthmanAdiClaude Code skill implementing Manus-style persistent markdown planning — the workflow pattern behind the $2B acquisition.
Context engineering best practices; an open-source implementation of Manus mode.

