mirror of
https://github.com/Frooodle/Stirling-PDF.git
synced 2026-01-14 20:11:17 +01:00
# Description of Changes This pull request adds a new feature to the translation management script, allowing users to automatically remove unused translations that are not present in the `en-GB` (golden truth) file. The update includes both the implementation in `translation_merger.py` and documentation in `README.md`. The most important changes are grouped below: **New Feature: Remove Unused Translations** * Added a `remove-unused` command to `translation_merger.py`, which removes translation keys from a target file if they are not present in the `en-GB` reference. This includes backup support and a CLI interface. [[1]](diffhunk://#diff-bb7f09f590ccabb456565d52afd66c1421525ddb1b6b65c0985aaab5a3c20ae7R282-R307) [[2]](diffhunk://#diff-bb7f09f590ccabb456565d52afd66c1421525ddb1b6b65c0985aaab5a3c20ae7R397-R404) [[3]](diffhunk://#diff-bb7f09f590ccabb456565d52afd66c1421525ddb1b6b65c0985aaab5a3c20ae7R464-R471) * Implemented helper methods `_delete_nested_key` (for deleting nested keys and cleaning up empty branches) and `get_unused_keys` (for identifying unused keys) in the translation merger logic. [[1]](diffhunk://#diff-bb7f09f590ccabb456565d52afd66c1421525ddb1b6b65c0985aaab5a3c20ae7R117-R139) [[2]](diffhunk://#diff-bb7f09f590ccabb456565d52afd66c1421525ddb1b6b65c0985aaab5a3c20ae7R156-R166) **Documentation Updates** * Updated `README.md` to document the new `remove-unused` command and describe its purpose and usage. [[1]](diffhunk://#diff-aeee54608ec45b06f4d52a4afcfbc7e6b08dee75f4328207cec32b8ca02fe0c6R185-R187) [[2]](diffhunk://#diff-aeee54608ec45b06f4d52a4afcfbc7e6b08dee75f4328207cec32b8ca02fe0c6R196) --- ## Checklist ### General - [ ] I have read the [Contribution Guidelines](https://github.com/Stirling-Tools/Stirling-PDF/blob/main/CONTRIBUTING.md) - [ ] I have read the [Stirling-PDF Developer Guide](https://github.com/Stirling-Tools/Stirling-PDF/blob/main/devGuide/DeveloperGuide.md) (if applicable) - [ ] I have read the [How to add new languages to Stirling-PDF](https://github.com/Stirling-Tools/Stirling-PDF/blob/main/devGuide/HowToAddNewLanguage.md) (if applicable) - [ ] I have performed a self-review of my own code - [ ] My changes generate no new warnings ### Documentation - [ ] I have updated relevant docs on [Stirling-PDF's doc repo](https://github.com/Stirling-Tools/Stirling-Tools.github.io/blob/main/docs/) (if functionality has heavily changed) - [ ] I have read the section [Add New Translation Tags](https://github.com/Stirling-Tools/Stirling-PDF/blob/main/devGuide/HowToAddNewLanguage.md#add-new-translation-tags) (for new translation tags only) ### Translations (if applicable) - [ ] I ran [`scripts/counter_translation.py`](https://github.com/Stirling-Tools/Stirling-PDF/blob/main/docs/counter_translation.md) ### UI Changes (if applicable) - [ ] Screenshots or videos demonstrating the UI changes are attached (e.g., as comments or direct attachments in the PR) ### Testing (if applicable) - [ ] I have tested my changes locally. Refer to the [Testing Guide](https://github.com/Stirling-Tools/Stirling-PDF/blob/main/devGuide/DeveloperGuide.md#6-testing) for more details. |
||
|---|---|---|
| .. | ||
| translations | ||
| analyze_pdf_json.py | ||
| build-tauri-jlink.bat | ||
| build-tauri-jlink.sh | ||
| convert_cff_to_ttf.py | ||
| counter_translation_v3.py | ||
| download_pdf_samples.py | ||
| download-security-jar.sh | ||
| generate_requirements.bat | ||
| harvest_type3_fonts.py | ||
| ignore_translation.toml | ||
| index_type3_catalogue.py | ||
| init-without-ocr.sh | ||
| init.sh | ||
| installFonts.sh | ||
| PropSync.java | ||
| remove_translation_keys.sh | ||
| replace_translation_line.sh | ||
| RestartHelper.java | ||
| summarize_type3_signatures.py | ||
| type3_to_cff.py | ||
| update_type3_library.py | ||