Add scripts to allow addons from personal repos to be synchronized with Crowdin#1
Add scripts to allow addons from personal repos to be synchronized with Crowdin#1nvdaes wants to merge 58 commits intonvaccess:masterfrom
Conversation
… addedwith dev role to Crowdin if they use a project not owned by them to upload source files)
…flow to upload/update files in Crowdin
…k pass creating a PR at nvdaes/translateNvdaaddonsWithCrowdin repo
| strictSetInference = true | ||
|
|
||
| # Compliant rules | ||
| reportAbstractUsage = true |
There was a problem hiding this comment.
it's probably better to keep these rules than dropping to NVDA's standard
PurposeAdd-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
Development approachUse the Crowdin registration repo to add scripts usable by individual add-ons in personal repos. |
|
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. |
|
Export translations to Crowdin running the workflow with update=False works properly: https://github.com/nvdaes/translateNvdaAddonsWithCrowdin/actions/runs/19802210157 |
|
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 |
|
If someone can help with this issue when update xliff, I'll be grateful. |
|
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 |
|
@seanbudd wrote:
OK. |
|
@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. |
|
I'm testing this locally with act and docker, with help of GitHub Copilot agent mode in VS Code. Maybe others want to test locally too, so Copilot has suggested a configuration for Docker to install gettext, and the configuration file is added to .gitignore by Copilot, reviewed by me. Changes in the workflow have been suggested by Copilot to install gettext, and I've asked it to add a dry-run to avoid upload and download from Crowsin, and also to avoid git push, not supported by act. I've also found out that 3.13 version is not recognized when testing locally, so we're using 3.13.11 for ubuntu. |
|
Is it okay if we leave this as draft until #7 is resolved? |
|
Sean wrote:
Yes. |
|
@nvdaes - now that nvaccess/nvdaL10n#1 is merged, can we use the l10nUtil exe from https://github.com/nvaccess/nvdaL10n/actions/runs/23521126188 here in #1 and close #7? |
|
@seanbudd wrote:
I think it would be better to build the executable by checking out the repo, since the artifact may be deleted after the retention period. Let me know if you disagree. |
|
I disagree - instead we could create a release and upload the artifact with every master push |
|
To be clear - I think we should be building the release from nvaccess/nvdal10n. This repo and NVDA only needs the exe |
|
I'm testing in the reportSymbols add-on, using the buildAddon workflow to build the pot file, though seems that Gettext can be installed on Windows too. But the buildAddon workflow is failing at least due to Pyright. https://github.com/nvdaes/reportSymbols/actions/runs/23554914090/job/68578896225 |
|
Even removing code checks from build, the crowdin workflow is failing due to absence of modules like sha256. I'm thinking about uploading source files in all cases instead of checking if they should uploaded from scratch or updated, since the same command is used now. Previously the crowdinSync.py file was used for updates, but this is not the case now. |
|
Seems that it's difficult to download the l10nUtil.exe file using gh (GitHub CLI), and it's not possible with curl. |
|
@nvdaes - can you create a workflow in |
Requested in nvaccess/AddonTemplate#1 Summary This creates a release when pushing to the main branch, uploading the l10nUtil.exe as an asset. Additional note I've included dependency updates from dependabot. @seanbudd , we can revert uv.lock if you want. We use the ncipollo/release action since I find it more updated than other similar actions and it uses node24. See
|
I think that it would be better to use the nvdaaddons/crowdinRegistration repo, or this template, to export translations periodically, and add-on authors would use their secrets.CROWDIN_TOKEN just to upload md and pot file to Crowdin. https://github.com/nvdaes/readFeeds/actions/runs/23920196250/job/69764310501 |
|
Anotheridea that I'm thinking about is to create an action (nvdaes/l10n or something like that), like the build-discussion action for the store. This potentially would make possible to create a branch with translations for personal repos. I can determine where to export translations on the action repo. Also, I can parse the json file with approved submitters available on the store to upload source files (readme.md and nvda.pot) for each available add-on, periodically. |
Blocked by #7