Localization-Comparison-Tool

🛠️ Localization Comparison Tool 🛠️

GitHub release (latest by date) GitHub stars License Contributions Welcome

image

Effortlessly compare and analyze your localization files with this modern, open-source tool! Built with Flet, this tool helps streamline the localization process by making it easy to identify changes between different versions of your language files.


📖 Table of Contents


Overview

The Localization Comparison Tool is a desktop application designed for developers, translators, and localization managers. It provides a clear and efficient way to compare different versions of localization files, highlighting added, removed, or modified strings. By supporting various common file formats and offering a user-friendly interface, it aims to reduce the time and effort spent on managing and verifying translations.

This tool tackles the complexity of tracking changes in localization files, especially in projects with frequent updates or multiple languages, ensuring consistency and accuracy across all localized content.


🔍 Features


⚙️ How It Works Briefly

  1. File/Directory Selection: User selects source and target localization files or directories through the Flet-based GUI.
  2. Asynchronous Parsing & Comparison: The tool asynchronously parses the selected files based on their format. It then performs a key-by-key comparison.
  3. Difference Calculation: Identifies added, removed, or (optionally) modified strings, taking into account user-defined ignore patterns and options (e.g., ignore case/whitespace).
  4. Results Display: Differences are presented clearly in the UI, often with visual cues and detailed statistics. Directory comparisons may show results in tabs per file pair.
  5. History & Output: Comparison summaries can be saved to history. Results can be copied to the clipboard. Missing strings can optionally be sent to Google Cloud Translate.

💻 Tech Stack Highlights


📋 Prerequisites

For End-Users (Using Executable):

For Running from Source / Developers:


🚀 Installation

Click to expand installation instructions ### For End-Users (Translators, QA): 1. **Download**: Get the latest release from the [Releases page](https://github.com/KhazP/LocalizerAppMain/releases). 2. **Run**: Execute the downloaded application file (`.exe` for Windows, etc.). 3. No further installation steps are typically required. ### For Developers: 1. **Clone the Repository**: ```bash git clone [https://github.com/KhazP/LocalizerAppMain.git](https://github.com/KhazP/LocalizerAppMain.git) ``` 2. **Navigate to Project Directory**: ```bash cd LocalizerAppMain ``` 3. **Set up Virtual Environment & Install Dependencies**: It's highly recommended to use a virtual environment. ```bash # Create a virtual environment python -m venv venv # Activate it # Windows: .\venv\Scripts\activate # macOS/Linux: # source venv/bin/activate # Install required packages pip install -r requirements.txt # # Optional: For development (tests, linting) # pip install -r requirements-dev.txt # (If requirements-dev.txt exists) # Optional: Install the package in editable mode to use the `localizer` command pip install -e . ```

🛠️ Usage

After installation or setup:

1. Using the Executable (for End-Users):

2. Using the localizer Command (if installed via pip):

3. Running from Source (for Developers):

4. Using the .bat file (Windows, if running from source):

In-App Usage:

  1. Launch the application using one of the methods above.
  2. If it’s your first time, an onboarding tutorial may appear.
  3. Use the interface to select your base and target localization files or directories.
  4. Configure comparison options in Settings if needed (e.g., ignore patterns, theme).
  5. Click “Compare Files” or “Compare Directories”.
  6. Review the displayed differences, statistics, and previews.
  7. Use “Copy Results” or the Machine Translation features as needed.

📚 Documentation

Comprehensive documentation, including detailed usage instructions, information on supported file formats, advanced comparison options, and troubleshooting, is available in the docs/ folder. The docs/README.md (Source 9) also serves as the main description for the PyPI package.

Key topics covered in the docs/ folder often include:


📁 Key Files Overview

Based on the project structure outlined in docs/CONTRIBUTING.md:

Click to expand key files & directories list * `LICENSE`: License information. * `requirements.txt`: List of project dependencies. * `setup.py`: Installation and packaging script. * `start_localizer.bat`: Batch file to launch the application on Windows. * `GUI/flet_gui.py`: Main entry point for the Flet-based GUI application. * `GUI/logic.py`: Shared GUI logic functions. * `cli/compare_files.py`: Script for comparing localization files via the Command Line Interface. * `components/`: Reusable Flet UI components (e.g., file input, results view, settings dialog). * `core/`: Core application logic, constants, configuration management, and themes. * `parsers/`: Individual file format parsers (e.g., for JSON, XML, CSV, YAML, LANG, RESX, XLIFF, Properties, Android XML, Angular JSON). * `utils/`: Utility services like logging, history management, file caching, and processing. * `assets/`: Static assets like images and icons. * `docs/`: Documentation files, including `CONTRIBUTING.md` and `README.md`. * `tests/`: Automated test suite.

⚠️ Known Issues & Limitations


🔮 Future Enhancements


🤝 Contributing

Contributions are what make the open-source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated! Please see docs/CONTRIBUTING.md for detailed guidelines.

  1. Fork the Project (https://github.com/KhazP/LocalizerAppMain/fork).
  2. Create your Feature Branch (git checkout -b feature/AmazingFeature).
  3. Develop and test your changes. (Run tests using python -m pytest tests/).
  4. Consider installing development dependencies if a requirements-dev.txt is available (pip install -r requirements-dev.txt).
  5. Commit your Changes (git commit -m 'feat: Add some AmazingFeature').
  6. Push to the Branch (git push origin feature/AmazingFeature).
  7. Open a Pull Request.

For major changes, please open an issue first to discuss what you would like to change. Please make sure to update tests as appropriate.


📜 Disclaimer

This tool is provided “as-is” without any warranty, express or implied. The developers assume no liability for any damages or data loss caused by its use. Always back up your files before using any new software to modify or analyze them. Use responsibly.


📄 License

This project is licensed under the MIT License. See the LICENSE file for details.


📞 Contact


Happy localizing!