A Python GUI application for translating Microsoft Word documents using the DeepL API. Features a user-friendly interface with progress tracking, comprehensive content translation (paragraphs, tables, and text boxes), and automatic formatting preservation.
- Full-Featured GUI - Easy-to-use tkinter interface
- Comprehensive Translation:
- Document paragraphs
- Table cells
- Text boxes (via Word COM automation)
- 27 Supported Languages - Wide range of target languages
- Real-Time Progress Tracking - Progress bar and detailed status log
- API Key Management - Secure storage with show/hide toggle
- Formatting Preservation - Maintains original document structure
- Smart Filtering - Skips numbers and empty content
- Multi-threaded - Non-blocking UI during translation
- API key entry with show/hide toggle
- File browser for document selection
- Language dropdown selector
- Real-time progress bar
- Detailed status log
- Python 3.7+
- Microsoft Word (for text box translation - Windows only)
- DeepL API key (Get one here)
- Clone the repository:
git clone https://github.com/yourusername/deepl-word-translator.git
cd deepl-word-translator- Install dependencies:
pip install -r requirements.txt- Set up your DeepL API key:
- Copy
.env.exampleto.env - Add your DeepL API key:
DEEPL_API_KEY=your_api_key_here - Copy
python dl_translator.py-
Enter API Key
- Paste your DeepL API key in the text field
- Click "Save to .env" to store it permanently
- Use "Show" button to toggle visibility
-
Select Document
- Click "Browse..." button
- Choose a
.docxfile - File path will display in the interface
-
Choose Language
- Select target language from dropdown
- 27 languages available
-
Start Translation
- Click "Start Translation" button
- Monitor progress bar and status log
- Wait for completion message
-
Access Output
- Find translated file in same directory
- Format:
{original}_{lang}_{timestamp}.docx - Example:
report_fr_1729705432.docx
| Code | Language | Code | Language | Code | Language |
|---|---|---|---|---|---|
| BG | Bulgarian | IT | Italian | RO | Romanian |
| CS | Czech | JA | Japanese | RU | Russian |
| DA | Danish | LT | Lithuanian | SK | Slovak |
| DE | German | LV | Latvian | SL | Slovenian |
| EL | Greek | NL | Dutch | SV | Swedish |
| EN | English | PL | Polish | TR | Turkish |
| ES | Spanish | PT | Portuguese | UK | Ukrainian |
| ET | Estonian | FR | French | ZH | Chinese |
| FI | Finnish | HU | Hungarian | ID | Indonesian |
- Document Loading - Opens .docx using
python-docx - Content Collection - Identifies paragraphs and table cells
- Batch 1: Paragraphs - Translates all paragraphs via DeepL API
- Batch 2: Tables - Translates all table cell content
- Save Temporary - Saves intermediate file
- Text Boxes - Uses Word COM to access and translate text boxes
- Final Save - Outputs completed file with timestamp
The application intelligently skips:
- Empty or whitespace-only text
- Pure numbers (e.g., "123.45")
- Content that shouldn't be translated
Includes a 0.4-second delay between API calls to respect DeepL rate limits and prevent quota exhaustion.
- deepl - Official DeepL API client
- python-docx - Word document manipulation
- pywin32 - Windows COM automation for text boxes
- python-dotenv - Environment variable management
- tkinter - GUI framework (included in Python)
- GUI Layer - tkinter-based interface
- Translation Logic - DeepL API integration
- Document Processing - python-docx + Word COM
- Threading - Async translation with UI updates
| Platform | Paragraph/Table Translation | Text Box Translation |
|---|---|---|
| Windows | ✅ Full Support | ✅ Full Support |
| macOS | ✅ Full Support | ❌ Not Supported |
| Linux | ✅ Full Support | ❌ Not Supported |
Text box translation requires Microsoft Word (COM automation)
Translated files use the naming pattern:
{original_filename}_{language_code}_{unix_timestamp}.docx
Examples:
annual_report.docx→annual_report_de_1729705432.docxmeeting_notes.docx→meeting_notes_ja_1729705433.docx
- Ensure you've entered a valid API key
- Check that the key isn't expired
- Verify you have available quota
- Check your internet connection
- Verify API key has sufficient quota
- Ensure document isn't corrupted or password-protected
- Windows: Ensure Microsoft Word is installed
- macOS/Linux: Text box translation not supported (COM limitation)
- Close any open Word instances before translating
# Install all requirements
pip install -r requirements.txt
# Windows-specific: Install pywin32
pip install pywin32- ✅ Never commit
.envfile to Git - ✅ Keep API keys private and secure
- ✅ Use the password masking in the GUI
- ✅ Regularly rotate API keys
- ❌ Don't share screenshots with visible API keys
- Visit DeepL API Portal
- Sign up for free or paid account
- Navigate to account settings
- Copy your authentication key
- Add to
.envfile or paste in GUI
Free Tier: 500,000 characters/month
For detailed technical documentation, see dl_translator_documentation.md
Contributions welcome! Please:
- Fork the repository
- Create a feature branch
- Make your changes
- Submit a pull request
- Batch document processing
- Cross-platform text box support
- Translation memory/cache
- Source language auto-detection
- Formality level settings
- Custom glossary support
- PDF export option
This project is licensed under the MIT License - see the LICENSE file for details.
- DeepL for their excellent translation API
- python-docx library maintainers
- pywin32 project
- Issues: GitHub Issues
- Discussions: GitHub Discussions
Note: This tool is not affiliated with or endorsed by DeepL SE.