Skip to content

Conversation

@nvdaes
Copy link

@nvdaes nvdaes commented Nov 24, 2025

No description provided.

strictSetInference = true

# Compliant rules
reportAbstractUsage = true
Copy link
Member

Choose a reason for hiding this comment

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

it's probably better to keep these rules than dropping to NVDA's standard

@nvdaes
Copy link
Author

nvdaes commented Nov 28, 2025

Purpose

Add-on authors may wish to help translators use Crowdin, the same framework where they translate NVDA. to translate messages and documentation for maintained add-ons:

Other details

  • Pot file are created/updated, and uploaded to a Crowdin project.
  • The readme.md file is converted to xliff and uploaded to a Crowdin project.
  • Po and xfiles are translated.
  • Translated files are downloaded and processed to be copied to locale/langCode/LC_MESSAGES/nvda.po, and doc/langCode/readme.md, in the addon folder.
    Authors need to store a Crowdin token with permissions to upload files to the Crowdin project as a repository secret.

Development approach

Use the Crowdin registration repo to add scripts usable by individual add-ons in personal repos.

@nvdaes
Copy link
Author

nvdaes commented Nov 28, 2025

I've tested that all check pass using this pyproject.toml file on this PR:

nvdaes/translateNvdaAddonsWithCrowdin#11

I use precommit, CodeQL and a workflow to check that all translatable messages have comments for translators.

I'll try to use the cache action to cache some add-on metadata like its id, and also hashfiles from l10nSources (taking the value of buildVars.py), and the hasf¡hfile of the readme.md, to determine if pot and xliff files should be updated.

@nvdaes
Copy link
Author

nvdaes commented Nov 30, 2025

Export translations to Crowdin running the workflow with update=False works properly:

https://github.com/nvdaes/translateNvdaAddonsWithCrowdin/actions/runs/19802210157

@nvdaes
Copy link
Author

nvdaes commented Nov 30, 2025

This time, updatexLiff is failing. Seems that adding blank lines to readme may cause problems:

https://github.com/nvdaes/translateNvdaAddonsWithCrowdin/actions/runs/19802391926/job/56731562709

@nvdaes
Copy link
Author

nvdaes commented Nov 30, 2025

If someone can help with this issue when update xliff, I'll be grateful.
I think that this is one of the bugest problems with xliff files. Sometimes sel lines are None and they don't have a strip method. I don't know if this should be also improved in NVDA
cc: @seanbudd

@seanbudd
Copy link
Member

seanbudd commented Dec 1, 2025

It might be easier to avoid xliff and just translate the markdown files directly. This won't support diffs very well but worth experimenting with

@nvdaes
Copy link
Author

nvdaes commented Dec 1, 2025

@seanbudd wrote:

It might be easier to avoid xliff and just translate the markdown files directly. This won't support diffs very well but worth experimenting with

OK.

@nvdaes
Copy link
Author

nvdaes commented Dec 3, 2025

@CyrilleB79, you were interested in this framework. If you want, feel free to see how the translateNvdaAddonsWithCrowdin.md can be translated in the project. Using xliff files is causing problems, as mentioned, and we are experimenting uploading md files instead.

@seanbudd seanbudd mentioned this pull request Dec 16, 2025
@nvdaes
Copy link
Author

nvdaes commented Dec 17, 2025

@seanbudd , thanks for merging PR #4 . Should pre-commit ci be enabled for this repo, to provide guidance about failures if authors enable it in their repos?
Seems that this is not enabled here.

@seanbudd
Copy link
Member

Lets get #4 and the submodule created first before working on this PR

@nvdaes
Copy link
Author

nvdaes commented Dec 17, 2025

@seanbudd , I've created a repo with l10n files copied from NVDA master branch. Please let me know if we should create an addonTemplateBranch to be used for this repo, and the main branch for NVDA, or what do you think. The repo is at

https://github.com/nvdaes/nvdaL10n

License is GPL 3. I've selected this from available licenses.

@nvdaes
Copy link
Author

nvdaes commented Dec 17, 2025

@seanbudd , I've created two branches for the nvdaL10n repo.

Unless I've made some mistake, I've copied the NVDA files corresponding to l10nUtils and related ones to the main branch, and the modified files used in this PR, in the addonTemplate branch.

You may add the submodule:

git submodule add -b addonTemplate https://github.com/nvdaes/nvdaL10n _l10n

The repo is managed by uv with a pyproject copied/based in the Pyproject used for the add-on template in PR #5 .
In the pre-commit configuration I had to remove master, since this branch doesn't exist in the external repo and it's not recognized.
I cannot ru pyright correctly. Some options aren't recognized. I've installed it with uv run pip install pyright.
Perhaps we can remove dependencies related to the translations framework, except markdown, when you add the submodule.

@nvdaes
Copy link
Author

nvdaes commented Dec 21, 2025

Seems that we cannot run pre-commit inside GitHub Actions, and that that steps should be removed.
Looks like an extra secret is required so that pre-commit has appropriate credentials. Otherwise, testing with an add-on, thw workflow seems to be run properly:
https://github.com/nvdaes/translateNvdaAddonsWithCrowdin/actions/runs/20409142470/job/58643266187

In this case nothing is updated since the readme and i18nsources hashes are the same.

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.

2 participants