Translation Diff Checker is a powerful, easy-to-use Python tool designed to analyze and compare translation files across multiple languages. It helps developers and translators identify translation gaps, track changes, and maintain high-quality multilingual applications.
- π Comprehensive translation file comparison
- π Detect untranslated, new, and changed keys
- π Generate detailed HTML reports
- π Support for nested JSON translation files
- π» Command-line interface
- π¦ Multi-file and multi-language support
- Python 3.7+
- JSON translation files
- Supported File Format:
.json
- Currently supports only JSON translation files
- Nested JSON structures are supported
- Future roadmap includes support for YAML, TOML, and other translation formats
{
"welcome_message": "Hello, World!",
"user_profile": {
"name": "Name",
"age": "Age"
}
}
Detailed documentation is available in the docs
directory:
For the most up-to-date and comprehensive information, please refer to our documentation.
# Clone the repository
git clone https://github.com/hasanbeder/translation-diff-checker.git
# Change directory
cd translation-diff-checker
# Install dependencies
pip install -r requirements.txt
# Try with example files
python3 src/translation_diff_checker.py examples/en.json examples/tr.json
python3 src/translation_diff_checker.py en.json tr.json
python3 src/translation_diff_checker.py --source-dir source_translations/ --target-dir target_translations/
# HTML Report (default)
python3 src/translation_diff_checker.py en.json tr.json
# Text Report
python3 src/translation_diff_checker.py en.json tr.json --format text
# JSON Report
python3 src/translation_diff_checker.py en.json tr.json --format json
- HTML: Interactive, detailed report with charts and styling
- Text: Concise console output with key translation statistics
- JSON: Machine-readable format for further processing
Multi-File Translation Analysis Report
=====================================
File: en.json
-------------
Total Keys: 150
Translated Keys: 120
Completion Percentage: 80%
Untranslated Keys:
- user.profile.advanced_settings
- notifications.email_preferences
{
"total_keys": 150,
"translated_keys": 120,
"untranslated_keys": ["key1", "key2"],
"completion_percentage": 80.0
}
- Console Output: Quick summary of translation differences
- HTML Report: Detailed, interactive report with:
- Translation coverage percentage
- Untranslated keys
- New and removed keys
- Changed translations
You're developing a global e-commerce platform targeting multiple international markets. Your application needs to support translations for:
- Product descriptions
- User interface elements
- Error messages
- Email templates
- Customer support sections
- 1000+ translation keys across different application domains
- Translations managed by multiple teams
- Need to track translation progress
- Ensure consistency across languages
- Validate translation quality
- Initial Translation Coverage
# Compare English base translations with target languages
python3 src/translation_diff_checker.py \
translations/base/en.json \
translations/target/es-ES.json \
--output spanish_translation_report.html
- Detailed Insights The generated report reveals:
- π Total translation keys: 1000
- β Translated keys: 750
- β Missing keys: 250
- π Completion: 75%
- Identifying Translation Gaps Report highlights untranslated critical sections:
Untranslated Keys:
- checkout.payment_methods
- product.technical_specifications
- user_account.subscription_management
- customer_support.faq_section
- Continuous Integration Integrate into localization workflow:
# CI Pipeline Translation Check
localization_check:
script:
- python translation-diff-checker.py
translations/base/en.json
translations/target/fr-FR.json
--format text
only:
- merge_requests
- Translator Collaboration
- Generate comprehensive HTML reports
- Clearly communicate translation requirements
- Track progress across multiple languages
- Prioritize translation efforts
- π Faster global market expansion
- π‘ Systematic translation management
- π Improved user experience
- π° Reduced localization costs
- π Consistent brand messaging
- Before international product launch
- During continuous localization
- After major feature updates
- When adding new language support
- Run checks weekly
- Set minimum translation completeness (90%)
- Involve native speakers in review
- Use reports for translator performance tracking
# Run tests
python3 -m pytest tests/
- Fork the repository
- Create your feature branch (
git checkout -b feature/AmazingFeature
) - Commit your changes (
git commit -m 'Add some AmazingFeature'
) - Push to the branch (
git push origin feature/AmazingFeature
) - Open a Pull Request
Report issues at: https://github.com/hasanbeder/translation-diff-checker/issues
Distributed under the MIT License. See LICENSE
for more information.
Hasan Beder - @hasanbeder
Project Link: https://github.com/hasanbeder/translation-diff-checker
Made with β€οΈ for Developers and Translators