Skip to content

Fetch translations from crowdin#18453

Merged
seanbudd merged 38 commits intobetafrom
fetchFromCrowdin
Jul 18, 2025
Merged

Fetch translations from crowdin#18453
seanbudd merged 38 commits intobetafrom
fetchFromCrowdin

Conversation

@seanbudd
Copy link
Copy Markdown
Member

@seanbudd seanbudd commented Jul 14, 2025

Link to issue number:

Part of #17878
Follow up to #18270

Summary of the issue:

Currently, fetching the latest translations from Crowdin is a manual process.

Description of developer facing changes:

  • A GitHub action to update translations is added. This will run at weekly interval, just before we do a regular release. Translation freezes should be designed to line up with this time. This can be run manually. This will only update tracked translations for existing languages.
  • A GitHub action to add new languages is added. This is because we have languages which are started in Crowdin, but not ready for sync/release. This will allow us to track new languages.

Description of development approach:

  • The Crowdin GitHub actions caused problems when running in a windows environment. Using the API directly with l10nUtil seemed cleaner.
  • To download all translations you must create a project export bundle and download it directly. Adding this to l10nUtil makes it easier for devs to pull all translations from crowdin manually when required.

Testing strategy:

Known issues with pull request:

None

Code Review Checklist:

  • Documentation:
    • Change log entry
    • User Documentation
    • Developer / Technical Documentation
    • Context sensitive help for GUI changes
  • Testing:
    • Unit tests
    • System (end to end) tests
    • Manual testing
  • UX of all users considered:
    • Speech
    • Braille
    • Low Vision
    • Different web browsers
    • Localization in other languages / culture than English
  • API is compatible with existing add-ons.
  • Security precautions taken.

@coderabbitai summary

@seanbudd seanbudd marked this pull request as ready for review July 14, 2025 09:10
@seanbudd seanbudd requested a review from a team as a code owner July 14, 2025 09:10
@seanbudd seanbudd requested review from SaschaCowley and removed request for a team July 14, 2025 09:10
@wmhn1872265132
Copy link
Copy Markdown
Contributor

Most of the steps of add-new-language.yml are exactly the same as fetch-crowdin-translations.yml, would it be better to separate it into a composite action? Reduces duplication and facilitates maintenance.

@seanbudd
Copy link
Copy Markdown
Member Author

Most of the steps of add-new-language.yml are exactly the same as fetch-crowdin-translations.yml, would it be better to separate it into a composite action? Reduces duplication and facilitates maintenance.

I think the workflows are sufficiently different, particularly different message strings, that it makes this not worth it.

@seanbudd seanbudd changed the base branch from addPoFileChecker to beta July 15, 2025 02:41
@wmhn1872265132
Copy link
Copy Markdown
Contributor

Please note: After #18270 merge, an error occurs when uploading nvda.po using l10nUtil included in the launcher:

Traceback (most recent call last):
File "l10nUtil.py", line 740, in
File "l10nUtil.py", line 727, in main
File "l10nUtil.py", line 568, in checkPo
File "l10nUtil.py", line 452, in check
File "l10nUtil.py", line 367, in _checkSyntax
File "subprocess.pyc", line 548, in run
File "subprocess.pyc", line 1026, in init
File "subprocess.pyc", line 1538, in _execute_child
FileNotFoundError: [WinError 2] 系统找不到指定的文件。

@seanbudd seanbudd mentioned this pull request Jul 15, 2025
5 tasks
@SaschaCowley SaschaCowley added the conceptApproved Similar 'triaged' for issues, PR accepted in theory, implementation needs review. label Jul 15, 2025
Co-authored-by: Noelia Ruiz Martínez <nrm1977@gmail.com>
@seanbudd seanbudd added this to the 2025.2 milestone Jul 17, 2025
@seanbudd seanbudd requested a review from Copilot July 17, 2025 07:08
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR introduces automation for fetching and adding translations from Crowdin by extending l10nUtil.py and adding two GitHub workflows.

  • Adds an exportTranslations function and CLI command to bundle, download, and extract translations.
  • Integrates the new command into the main l10n utility.
  • Adds workflows to regularly update tracked languages and to add new languages on demand.

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
source/l10nUtil.py Added exportTranslations function and CLI parser integration.
.github/workflows/fetch-crowdin-translations.yml Workflow to auto-fetch and commit tracked translations weekly.
.github/workflows/add-new-language.yml Workflow to manually add and track new languages from Crowdin.
Comments suppressed due to low confidence (1)

source/l10nUtil.py:289

  • Add unit tests for exportTranslations to cover build initiation, polling logic, download, and extraction of the translation archive, ensuring errors are handled as expected.
def exportTranslations(outputDir: str, language: str | None = None):

@seanbudd seanbudd requested a review from michaelDCurran July 18, 2025 03:46
@seanbudd seanbudd merged commit 6bea5b1 into beta Jul 18, 2025
4 of 6 checks passed
@seanbudd seanbudd deleted the fetchFromCrowdin branch July 18, 2025 04:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

conceptApproved Similar 'triaged' for issues, PR accepted in theory, implementation needs review.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants