Skip to content

Improve Crowdin localization workflow with intelligent MD/XLIFF handling#3

Merged
nvdaes merged 94 commits intonvdaes:masterfrom
abdel792:l10nImprovements
Apr 22, 2026
Merged

Improve Crowdin localization workflow with intelligent MD/XLIFF handling#3
nvdaes merged 94 commits intonvdaes:masterfrom
abdel792:l10nImprovements

Conversation

@abdel792
Copy link
Copy Markdown

Improve Crowdin localization workflow with intelligent MD/XLIFF handling

This PR introduces a significant improvement to the localization workflow by adding a quality-driven, multi-source selection system for translated documentation files.


✨ Overview

The workflow now intelligently evaluates and selects the best available translation among multiple sources:

  • XLIFF (.xliff)
  • Remote Markdown (.md from Crowdin)
  • Local Markdown (addon/doc/<lang>/readme.md)

This ensures that the highest-quality translation is always used, while maintaining flexibility for translators.


🔄 New Workflow Behavior

  • XLIFF-first strategy

    • XLIFF files are evaluated first
    • Conversion to Markdown (xliff2md) only occurs if translations are detected
  • Multi-source comparison

    • When multiple Markdown sources are available, they are compared
    • The best version is selected based on language quality
  • Smart fallback logic

    • If only one valid source exists → used directly (no unnecessary scoring)
    • If no valid remote sources → local content can be uploaded
  • Local file protection

    • High-quality local translations are preserved
    • If local content is better, it is uploaded back to Crowdin

🧠 Translation Quality Evaluation

The script .github/scripts/checkTranslation.py has been extended with:

  • Markdown language scoring using langid
  • Support for .md files
  • Multi-file comparison capabilities
  • Normalized scoring output (md_score)

These improvements allow the workflow to make reliable decisions based on linguistic consistency, not just file presence.


📦 Dependencies

  • Added langid as a dependency in pyproject.toml

📊 Logging & Traceability

  • Detailed Write-Host logs added to all decision branches
  • Makes CI behavior transparent and easier to debug

✅ Benefits

  • Ensures the best available translation is always selected
  • Supports both .md and .xliff translation workflows
  • Avoids propagating incomplete or low-quality translations
  • Preserves and promotes high-quality local contributions
  • Keeps the workflow deterministic and efficient

🔗 Related PR

This PR builds upon and extends the localization workflow improvements:

👉 #3


💬 Notes

  • Translators are free to choose between Markdown and XLIFF formats
  • The system adapts automatically to whichever source is best
  • Future improvements may include more advanced language models if needed

nvdaes and others added 30 commits November 24, 2025 10:24
… addedwith dev role to Crowdin if they use a project not owned by them to upload source files)
…k pass creating a PR at nvdaes/translateNvdaaddonsWithCrowdin repo
Bumps [actions/checkout](https://github.com/actions/checkout) from 5 to 6.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](actions/checkout@v5...v6)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-version: '6'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Sean Budd <seanbudd123@gmail.com>
Co-authored-by: Sean Budd <seanbudd123@gmail.com>
dependabot Bot and others added 29 commits February 27, 2026 10:18
Bumps [actions/upload-artifact](https://github.com/actions/upload-artifact) from 6 to 7.
- [Release notes](https://github.com/actions/upload-artifact/releases)
- [Commits](actions/upload-artifact@v6...v7)

---
updated-dependencies:
- dependency-name: actions/upload-artifact
  dependency-version: '7'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps the uv group with 3 updates in the / directory: [filelock](https://github.com/tox-dev/py-filelock), [urllib3](https://github.com/urllib3/urllib3) and [virtualenv](https://github.com/pypa/virtualenv).


Updates `filelock` from 3.20.1 to 3.20.3
- [Release notes](https://github.com/tox-dev/py-filelock/releases)
- [Changelog](https://github.com/tox-dev/filelock/blob/main/docs/changelog.rst)
- [Commits](tox-dev/filelock@3.20.1...3.20.3)

Updates `urllib3` from 2.6.2 to 2.6.3
- [Release notes](https://github.com/urllib3/urllib3/releases)
- [Changelog](https://github.com/urllib3/urllib3/blob/main/CHANGES.rst)
- [Commits](urllib3/urllib3@2.6.2...2.6.3)

Updates `virtualenv` from 20.35.4 to 20.36.1
- [Release notes](https://github.com/pypa/virtualenv/releases)
- [Changelog](https://github.com/pypa/virtualenv/blob/main/docs/changelog.rst)
- [Commits](pypa/virtualenv@20.35.4...20.36.1)

---
updated-dependencies:
- dependency-name: filelock
  dependency-version: 3.20.3
  dependency-type: indirect
  dependency-group: uv
- dependency-name: urllib3
  dependency-version: 2.6.3
  dependency-type: indirect
  dependency-group: uv
- dependency-name: virtualenv
  dependency-version: 20.36.1
  dependency-type: indirect
  dependency-group: uv
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
…ries (NVDA 2026.2) (nvaccess#19)

Closes nvaccess#15

This pull request add support for building custom speech pronunciation dictionaries via the add-on template. Changes made:

    Adds "speechDictionraies" sectoin to buildVars
    Adds speech dictionaries manifest key type and generation rules (borrowing custom symbol dictionaries)
…s#21)

Currently, checks are run with GitHub Actions regardless of files which have been changed.

This PR makes checks to be run just for add-ons. Additionally, Python and dependencies are installed using uv and pyproject.toml.
Co-authored-by: Cyrille Bougot <cyrille.bougot@laposte.net>
Various CI fixes and improvements:

    Do not try to build / make release if the workflow is run from this add-on template repo, since it fails and the template is not meant to be used as a release. Fixes: Do not restrict workflow triggers to addon path nvaccess#22 (comment).
    Modernized uv usage with "uv sync", fixing the failure on previously used "uv pip install". Discussed in Do not restrict workflow triggers to addon path nvaccess#22 (comment).
    Use uv for each command using Python so that the correct environment is used
    Added .egg-info to .git-ignore
    Updated readme
nvaccess#25)

Bumps the uv group with 1 update in the / directory: [requests](https://github.com/psf/requests).


Updates `requests` from 2.32.5 to 2.33.0
- [Release notes](https://github.com/psf/requests/releases)
- [Changelog](https://github.com/psf/requests/blob/main/HISTORY.md)
- [Commits](psf/requests@v2.32.5...v2.33.0)

---
updated-dependencies:
- dependency-name: requests
  dependency-version: 2.33.0
  dependency-type: direct:production
  dependency-group: uv
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
…ccess#26)

Bumps the uv group with 1 update in the / directory: [uv](https://github.com/astral-sh/uv).


Updates `uv` from 0.9.11 to 0.11.6
- [Release notes](https://github.com/astral-sh/uv/releases)
- [Changelog](https://github.com/astral-sh/uv/blob/main/CHANGELOG.md)
- [Commits](astral-sh/uv@0.9.11...0.11.6)

---
updated-dependencies:
- dependency-name: uv
  dependency-version: 0.11.6
  dependency-type: direct:production
  dependency-group: uv
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps [softprops/action-gh-release](https://github.com/softprops/action-gh-release) from 2 to 3.
- [Release notes](https://github.com/softprops/action-gh-release/releases)
- [Changelog](https://github.com/softprops/action-gh-release/blob/master/CHANGELOG.md)
- [Commits](softprops/action-gh-release@v2...v3)

---
updated-dependencies:
- dependency-name: softprops/action-gh-release
  dependency-version: '3'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
- move Python helper scripts from .github/workflows to .github/scripts for better separation of concerns
- add polib dependency and switch to uv sync for reproducible CI environment
- fix missing GH_TOKEN required for GitHub CLI (gh) commands
- fix l10nUtil.exe path resolution (use ./l10nUtil.exe instead of _l10n/l10nUtil.exe)
- improve Crowdin download behavior by avoiding processing empty translation files
- refine PO handling: preserve local translations, conditionally upload to Crowdin when needed
- refine XLIFF handling: update local documentation only, no upload back to Crowdin
- ensure safer, more deterministic, and more predictable translation synchronization logic
The script is already available in .github/scripts/.
Improve crowdinL10n.yml translation workflow
…on logic

- Add Markdown language scoring (langid) in checkTranslation.py
- Extend script to support MD files and optional multi-file comparison
- Update workflow to handle XLIFF → MD conversion only when translated
- Implement multi-source comparison (XLIFF MD, remote MD, local MD)
- Apply best-quality selection before updating or uploading files
- Add full logging for all decision branches
- Improve fallback behavior when only one source is available
@nvdaes nvdaes merged commit 059bb53 into nvdaes:master Apr 22, 2026
1 of 3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants