From 3195f3f2ba3c5df023ae0f33b2f5ce03df866058 Mon Sep 17 00:00:00 2001 From: Ludy Date: Fri, 6 Feb 2026 12:07:08 +0100 Subject: [PATCH] chore(ci): improve language TOML check output with fixer guidance (#5638) # Description of Changes This pull request enhances the language file difference reporting in `.github/scripts/check_language_toml.py` by providing clearer guidance on how to resolve translation key mismatches. The most important changes are: **Improved translation key reporting and remediation instructions:** * When extra keys are detected, the report now suggests the exact command (`translation_merger.py remove-unused`) to remove them and provides a direct example for the user. * When missing keys are found, the report now suggests the exact command (`translation_merger.py add-missing`) to add them and provides a direct example for the user. * For any missing or extra keys, a reference link to the relevant documentation section is included to help users understand and resolve the issues. --- ## 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. --- .github/scripts/check_language_toml.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/.github/scripts/check_language_toml.py b/.github/scripts/check_language_toml.py index 940ded16b..716497197 100644 --- a/.github/scripts/check_language_toml.py +++ b/.github/scripts/check_language_toml.py @@ -259,10 +259,21 @@ def check_for_differences(reference_file, file_list, branch, actor): report.append( f" - **_Extra keys in `{locale_dir}/{basename_current_file}`_**: `{missing_keys_str}` that are not present in **_`{basename_reference_file}`_**." ) + report.append("") + report.append(" Use the following command to remove them:") + report.append(f" `python scripts/translations/translation_merger.py {locale_dir} remove-unused`") + report.append("") if extra_keys_list: report.append( f" - **_Missing keys in `{locale_dir}/{basename_current_file}`_**: `{extra_keys_str}` that are not present in **_`{basename_reference_file}`_**." ) + report.append("") + report.append(" Use the following command to add them:") + report.append(f" `python scripts/translations/translation_merger.py {locale_dir} add-missing`") + report.append("") + + if missing_keys_list or extra_keys_list: + report.append(" See: https://github.com/Stirling-Tools/Stirling-PDF/tree/main/scripts/translations#2-translation_mergerpy") else: report.append("2. **Test Status:** ✅ **_Passed_**")