A Python tool for comparing, managing, and translating internationalization (i18n) files in ARB format. This tool helps developers maintain consistency across multiple language files and automate translation workflows.
- Key Comparison: Compare keys between different language files
- Order Synchronization: Ensure consistent key ordering across all language files
- Key Management: Add missing keys or remove unnecessary ones
- Automated Translation: Translate values using DeepL API
- Multi-language Support: Supports 8 languages (ES, FR, EN, DE, IT, PT, CA, GL)
- Spanish (ES) - Primary language
- French (FR)
- English (EN)
- German (DE)
- Italian (IT)
- Portuguese (PT)
- Catalan (CA) - Non-translatable
- Galician (GL) - Non-translatable
- Clone this repository:
git clone https://github.com/TheHypnoo/compareARB.git
cd CompareARB- Install required dependencies:
pip install requests- Set up your DeepL API key:
- Copy
config.example.pytoconfig.py - Add your DeepL API key to
config.py
- Copy
- Get your API key from DeepL
- Copy
config.example.pytoconfig.py - Replace
your_deepl_api_key_herewith your actual API key
# config.py
DEEPL_API_KEY = "your_actual_api_key_here"Important: Never commit your actual API key to version control!
Run the main script:
python main.py- Compare keys - Check for missing or extra keys between files
- Compare and update key order - Synchronize key ordering across files
- Remove different keys - Remove keys that don't exist in the primary file
- Translate values - Automatically translate values using DeepL
- Change language - Switch to a different target language
- Exit - Close the application
- Select a target language (e.g., "fr" for French)
- Choose "Compare keys" to identify missing translations
- Use "Add missing keys" to populate empty translations
- Use "Translate values" to automatically translate content
- Review and edit translations as needed
compare_arb/
├── main.py # Main application
├── config.py # Configuration (API keys, etc.)
├── config.example.py # Example configuration
├── .gitignore # Git ignore rules
├── README.md # This file
├── intl_*.arb # Original language files
└── intl_*_example.arb # Example language files
The repository includes example internationalization files with basic content:
intl_en_example.arb- English exampleintl_es_example.arb- Spanish exampleintl_fr_example.arb- French exampleintl_de_example.arb- German exampleintl_it_example.arb- Italian exampleintl_pt_example.arb- Portuguese exampleintl_ca_example.arb- Catalan exampleintl_gl_example.arb- Galician example
- Never commit
config.py- It contains your API key - The
.gitignorefile is configured to exclude sensitive files - Use
config.example.pyas a template for other developers
- Fork the repository
- Create a feature branch
- Make your changes
- Test thoroughly
- Submit a pull request
This project is open source and available under the MIT License.
If you encounter any issues or have questions:
- Check the existing issues
- Create a new issue with detailed information
- Include your Python version and any error messages
- Initial release
- Support for 8 languages
- DeepL API integration
- Key comparison and management tools
- Automated translation capabilities