-
-
Notifications
You must be signed in to change notification settings - Fork 659
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
l10nUtil: add downloadTranslationFile and uploadTranslationFile commands to allow downloading and uploading from Crowdin. #17708
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
… than just documentation.
…nds, that use the Crowdin API. Requires a Crowdin auth token which will be prompted for the first time and stored in ~/.nvda_crowdin
See test results for failed build of commit 9c16ebbbbb |
seanbudd
approved these changes
Feb 18, 2025
Co-authored-by: Sean Budd <[email protected]>
gexgd0419
pushed a commit
to gexgd0419/nvda
that referenced
this pull request
Feb 22, 2025
…nds to allow downloading and uploading from Crowdin. (nvaccess#17708) Currently, a translator must manually download and upload files from Crowdin. This can take time and is easy to use the wrong settings when importing and exporting. Description of user facing changes A translator can now download a file using the NVDA l10nUtil: l10nUtil downloadTranslationFile <language> <crowdinFilePath> [<localFilePath>] E.g. l10nUtil downloadTranslationFile fr userguide.xliff This will download the file, and preprocess it, avoiding bugs in the Crowdin exporter, including filtering of corrupt target strings. The translator can then translate the file with Poedit as normal. The translator can now upload the file back to Crowdin using the NVDA l10nUtil: l10nUtil uploadTranslationFile <language> <crowdinFilePath> [<localFilePath>] [--old <oldLocalFilePath>] E.g. l10nUtil uploadTranslationFile fr userguide.xliff --old userguide_old.xliff The --old argument allows you to provide the original downloaded file before it was last translated with Poedit, so that only added / changed translations are uploaded to Crowdin, decreasing the possibility of overriding someone elses work on this language. Note that the download and upload commands of l10nUtil require a Crowdin auth token. The first time, the token will be asked for. You will need to create a personal access token in your Crowdin settings, ensuring it has the Translations scope at a minimum. Paste this token into the user prompt. l10nUtil will save this in `/.nvda_crowdin for future use. Description of development approach l10nutil.py has new commands that use the Crowdin API.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Link to issue number:
None.
Summary of the issue:
Currently, a translator must manually download and upload files from Crowdin. This can take time and is easy to use the wrong settings when importing and exporting.
Description of user facing changes
A translator can now download a file using the NVDA l10nUtil:
E.g.
This will download the file, and preprocess it, avoiding bugs in the Crowdin exporter, including filtering of corrupt target strings.
The translator can then translate the file with Poedit as normal.
The translator can now upload the file back to Crowdin using the NVDA l10nUtil:
E.g.
The --old argument allows you to provide the original downloaded file before it was last translated with Poedit, so that only added / changed translations are uploaded to Crowdin, decreasing the possibility of overriding someone elses work on this language.
Note that the download and upload commands of l10nUtil require a Crowdin auth token. The first time, the token will be asked for. You will need to create a personal access token in your Crowdin settings, ensuring it has the Translations scope at a minimum.
Paste this token into the user prompt. l10nUtil will save this in `/.nvda_crowdin for future use.
Description of development approach
l10nutil.py has new commands that use the Crowdin API.
Testing strategy:
Manual testing of downloading, translating and uploading files for the n-PT (pirate English) language on Crowdin.
Much more testing very much welcome.
Known issues with pull request:
A more automated oauth style UX would be nice where a browser is opened and the auth token is fetched automatically. But at the moment that would involve storing a client secret in the source code which is not possible.
Code Review Checklist:
@coderabbitai summary