A professional desktop application for managing localization files in multiple formats (JSON, YAML, PO). Built with PyQt5, this tool provides a comprehensive solution for translation management with multi-language editing, missing key detection, statistics, and export capabilities.
- Multi-Format Support: Work with JSON, YAML, and PO (gettext) localization files
- Multi-Language Editing: Load and edit multiple language files simultaneously
- Missing Key Detection: Automatically identify missing translations across languages
- Real-Time Statistics: View completion rates, missing keys, and empty translations
- Translation Preview: Preview translations as you edit
- Search Functionality: Quickly find specific keys or translations
- Export Capability: Export translations to different formats
- Professional Qt UI: Clean, intuitive interface with Fusion style
- Visual Indicators: Missing translations highlighted in red for easy identification
- Python 3.6+
- PyQt5
- PyYAML
- polib
pip install -r requirements.txtOr install individually:
pip install PyQt5 PyYAML polibpython main.py- Click "Load File" button or use File → Load File (Ctrl+O)
- Select a localization file (JSON, YAML, or PO format)
- Enter a language identifier (e.g., 'en', 'fr', 'de')
- The file will be loaded and displayed in the translation table
- Select a language from the Language dropdown
- Click on any translation cell to edit
- Missing translations are highlighted in red
- Changes are reflected immediately in statistics
The right panel shows:
- Total Keys: Total number of unique translation keys
- Translated: Number of keys with translations
- Missing: Number of keys without translations
- Empty: Number of empty translation values
- Completion: Overall completion percentage with progress bar
The "Missing Keys" section lists all keys that are missing translations in the current language, making it easy to identify what needs to be translated.
- Add Key: Click "Add Key" button or use Edit → Add Key (Ctrl+N)
- Delete Key: Select a row and click "Delete Key" or use Edit → Delete Key (Delete)
- Click "Save" button or use File → Save (Ctrl+S)
- Saves the current language file to its original location
- Use File → Export (Ctrl+E)
- Select the language to export
- Choose the output format (JSON, YAML, or PO)
- Specify the output file path
- Click OK to export
Supports nested JSON structures with dot notation for keys:
{
"app": {
"title": "My Application",
"subtitle": "Welcome"
},
"buttons": {
"save": "Save",
"cancel": "Cancel"
}
}Keys are flattened as: app.title, app.subtitle, buttons.save, buttons.cancel
Supports nested YAML structures:
app:
title: My Application
subtitle: Welcome
buttons:
save: Save
cancel: CancelStandard gettext PO format:
msgid "app.title"
msgstr "My Application"
msgid "buttons.save"
msgstr "Save"Sample localization files are provided in the examples/ directory:
examples/en.json- English translations (JSON)examples/fr.json- French translations (JSON)examples/de.yaml- German translations (YAML)examples/es.po- Spanish translations (PO)
Load these files to see the application in action and understand the missing key detection feature (French file has 2 missing keys).
- Ctrl+O: Load File
- Ctrl+S: Save
- Ctrl+E: Export
- Ctrl+N: Add Key
- Delete: Delete Key
- Ctrl+Q: Exit
The application consists of three main modules:
JSONParser: Parse and save JSON localization filesYAMLParser: Parse and save YAML localization filesPOParser: Parse and save PO (gettext) files- Handles nested structures and flattening/unflattening
LocalizationManager: Core business logic- Multi-language file management
- Missing key detection
- Statistics calculation
- Export functionality
MainWindow: Main application windowStatisticsWidget: Real-time statistics displayPreviewWidget: Translation preview panelExportDialog: Export configuration dialog
Run the provided test scripts:
# Test backend functionality
python test_backend.py
# Test UI components
python test_ui.pyMIT License - see LICENSE file for details.
Max Base
Contributions are welcome! Please feel free to submit issues or pull requests.
