Stirling-PDF/.github
Ludy ef07a6134a
feat(scripts): enhance translation progress tool with CLI flags, TOML management, and CI-friendly output (#4801)
# Description of Changes

- **What was changed**
- Refactored `scripts/counter_translation.py` into a more modular CLI
tool.
  - Added argument parsing with new flags:
    - `--lang/-l` to check a single `messages_*.properties` file.
- `--show-percentage/-sp` to print **only** the numeric percentage
(useful for CI).
- `--show-missing-keys/-smk` to list untranslated keys for a single
language.
- Introduced `main()` entrypoint and helper `_lang_from_path()` for
robust language code extraction.
  - Improved comparison logic:
    - Skips header lines, trims values, and tolerates BOM.
    - Treats `en_GB`/`en_US` as 100% translated.
- Tracks and reports missing keys; removes keys from ignore list once
translated.
  - Hardened TOML handling:
- Automatically creates/updates `scripts/ignore_translation.toml` when
absent.
    - `convert_to_multiline()` normalizes/sorts arrays for stable diffs.
  - README integration:
    - `write_readme()` updates language badges from computed progress.
- Added type hints, richer docstrings, usage examples, and clearer
console messages.
  - Deduplicates language results and sorts by percentage (desc).
  - Uses consistent UTF-8 and newline handling.

- **Why the change was made**
- Make translation tracking **automation-ready** (CI pipelines can
consume a single number).
- Reduce manual maintenance of ignore lists and improve
**deterministic** formatting for clean diffs.
- Provide better **developer UX** with explicit flags and actionable
diagnostics (missing keys).
- Increase correctness and maintainability via structured code, typing,
and clear responsibilities.


---

## Checklist

### General

- [x] I have read the [Contribution
Guidelines](https://github.com/Stirling-Tools/Stirling-PDF/blob/main/CONTRIBUTING.md)
- [x] 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)
- [x] I have performed a self-review of my own code
- [x] 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)

### 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.
2025-11-02 16:34:22 +00:00
..
actions/setup-bot Standardize GitHub App Bot Authentication Across Workflows (#3582) 2025-05-27 12:36:41 +01:00
config ci(workflows): add PR comment–driven label management with authorized users (#4650) 2025-10-29 23:31:25 +00:00
ISSUE_TEMPLATE Merge branch 'decrypt' of https://github.com/Stirling-Tools/Stirling-PDF 2024-12-06 15:33:44 +00:00
scripts fix(ci): 🛡️mitigate CVE-2025-6176 by pinning brotli to patched commit and upgrading dev dependency pins (#4802) 2025-11-01 13:16:27 +00:00
workflows build(deps): bump actions/dependency-review-action from 4.8.0 to 4.8.1 (#4674) 2025-11-02 15:41:35 +00:00
CODEOWNERS Update CODEOWNERS (#4158) 2025-08-09 15:09:26 +01:00
dependabot.yml Update .pre-commit-config.yaml no. 2 2024-12-21 15:34:07 +01:00
labeler-config-srvaroa.yml chore(labeler): add new 'v2' label and expand matching rules (#4172) 2025-08-11 10:26:57 +01:00
labels.yml Add 'break-change' label and update release categories (#4806) 2025-11-02 16:22:27 +00:00
pull_request_template.md feat(scripts): enhance translation progress tool with CLI flags, TOML management, and CI-friendly output (#4801) 2025-11-02 16:34:22 +00:00
release.yml Add 'break-change' label and update release categories (#4806) 2025-11-02 16:22:27 +00:00