forked from nvdaaddons/AddonTemplate
-
Notifications
You must be signed in to change notification settings - Fork 8
Add documentation about add-on translation #36
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
Merged
Merged
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
559c65a
Add documentation about translating add-ons via Crowdin
nvdaes 6a7ac3d
Improve documentation
nvdaes 42d0394
Run pre-commit
nvdaes 57cd151
Address review comments made by Copilot
nvdaes bad3d7a
Update docs/l10n/addonAuthors.md
nvdaes b8ca26f
Update docs/l10n/addonTranslators.md
nvdaes 7a3449b
Update docs/l10n/addonTranslators.md
nvdaes 6d6845c
Update docs/l10n/addonTranslators.md
nvdaes 5e9a3e8
Update docs/l10n/addonTranslators.md
nvdaes 089c300
Address review: use cmd instead of bash for commands
nvdaes File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,61 @@ | ||
| # Translation Guide for Authors | ||
|
|
||
| ## Overview | ||
|
|
||
| This template supports translating add-ons with Crowdin. | ||
|
|
||
| ## Crowdin Project Setup | ||
|
|
||
| You need a Crowdin account and an API token with permissions to manage a project. | ||
| If you wish to use the community project [Crowdin project to translate NVDA add-ons](https://crowdin.com/project/nvdaaddons): | ||
|
|
||
| * **Request Access:** Send a message to the [NVDA translation mailing list](https://groups.io/g/nvda-translations) (**nvda-translations@groups.io**), or in the [NVDA Add-ons Mailing List](https://groups.io/g/nvda-addons) (**nvda-addons@groups.io**), requesting an invitation to join the project as a developer. | ||
| * **API Token:** Once invited, generate an API token in your Crowdin account settings. | ||
|
|
||
| ## GitHub Secrets and Variables | ||
|
|
||
| To allow the workflows to communicate with Crowdin, you must add the following secret to your GitHub repository (`Settings > Secrets and variables > Actions`): | ||
|
|
||
| * `CROWDIN_TOKEN`: Paste your Crowdin API token here. | ||
|
|
||
| Optionally, if you don't want to use the [Crowdin community project](https://crowdin.com/project/nvdaaddons), you can create repository variables from **Settings > Secrets and variables > Actions > Variables** by selecting the **Variables** tab and clicking **New repository variable**. | ||
|
|
||
| The following repository variables are supported: | ||
|
|
||
| * `CROWDIN_PROJECT_ID`: Paste the project ID of your Crowdin project. | ||
| * `L10N_UTIL_CONFIG`: The path to the YAML file containing the configuration for `l10nUtil.exe`, used by the translation scripts. | ||
| For more details, visit the [nvdaL10n repository](https://github.com/nvaccess/nvdaL10n). | ||
| * `MIN_PERCENTAGE_TRANSLATED`: Defines the minimum translation completion percentage required before a translated file is synchronized back to the repository. | ||
| The value must be between `0` and `100`. | ||
|
|
||
| Examples for `MIN_PERCENTAGE_TRANSLATED`: | ||
|
|
||
| * `50`: Import files that are at least 50% translated. | ||
| * `75`: Import files that are at least 75% translated. | ||
| * `100`: Import only fully translated files. | ||
|
|
||
| If `MIN_PERCENTAGE_TRANSLATED` is not defined, the workflow uses a default value of `50`. | ||
|
|
||
| ## Infrastructure | ||
|
|
||
| Ensure that your repository includes the following files (provided in this template): | ||
|
|
||
| * **Workflows:** `.github/workflows/crowdinL10n.yml` | ||
| * **Scripts:** The `.github/scripts/` folder containing `checkTranslation.py`, `languageMappings.json`, `setOutputs.py`, and `crowdinSync.ps1`. | ||
|
|
||
| Documentation synchronization relies on the XLIFF support built into `l10nUtil.exe`. | ||
|
|
||
| The `md2xliff` command is used to generate the source XLIFF file from the English `readme.md` documentation file. | ||
| Translated XLIFF files downloaded from Crowdin are then converted back to Markdown documentation using `l10nUtil.exe xliff2md`. | ||
|
|
||
| ## Running the Workflow | ||
|
|
||
| The translation workflow will be run weekly. | ||
| Also, you can run the workflow manually from GitHub or using GitHub CLI. | ||
|
|
||
| If you manage several add-ons, consider using different cron schedules for each repository. | ||
| Although the workflow includes a random startup delay to reduce collisions, concurrent Crowdin synchronization jobs may still occur. | ||
|
|
||
| Documentation and interface translations are synchronized only when their translation percentage reaches the configured `MIN_PERCENTAGE_TRANSLATED` threshold. | ||
|
|
||
| This validation mechanism is applied consistently to both `.po` and `.xliff` translation files. |
This file contains hidden or 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,219 @@ | ||
| # Translation Guide for Translators | ||
|
|
||
| ## Overview | ||
|
|
||
| Many NVDA add-ons use the NVDA Add-ons Crowdin project (`nvdaaddons`) to manage translations. | ||
|
|
||
| This project allows translators to contribute both interface translations and documentation translations. | ||
|
|
||
| Translations are synchronized back to add-on repositories through the localization workflow provided by the NVDA Add-on Template. | ||
|
|
||
| ## Joining the Translation Community | ||
|
|
||
| Before contributing translations, translators are encouraged to subscribe to the NVDA Translations mailing list. | ||
|
|
||
| The mailing list is the primary place for discussing translation-related topics within the NVDA community. | ||
|
|
||
| ## NVDA Translations Mailing List | ||
|
|
||
| The NVDA community maintains the NVDA Translations mailing list on Groups.io. | ||
|
|
||
| This mailing list is used to: | ||
|
|
||
| * Discuss translation-related topics. | ||
| * Request access to translation teams. | ||
| * Coordinate translation efforts. | ||
| * Report translation issues. | ||
| * Discuss problems affecting translation tools or workflows. | ||
|
|
||
| Translators are encouraged to subscribe to the mailing list: | ||
|
|
||
| https://groups.io/g/nvda-translations | ||
|
|
||
| The mailing list is often the best place to ask questions, request access to a translation team, and seek assistance from other translators and project maintainers. | ||
|
|
||
| ## Joining the Translation Project | ||
|
|
||
| To contribute translations: | ||
|
|
||
| 1. Create a Crowdin account. | ||
| 1. Subscribe to the NVDA Translations mailing list. | ||
| 1. Request access to the appropriate translation team if necessary. | ||
| 1. Join the NVDA Add-ons Crowdin project. | ||
| 1. Select the language you wish to translate. | ||
| 1. Begin translating interface strings and documentation. | ||
|
|
||
| ## Translation Methods | ||
|
|
||
| Translations can be performed using either the Crowdin web interface or local translation tools. | ||
|
|
||
| ### Crowdin Web Editor | ||
|
|
||
| Crowdin provides a web-based editor that allows translators to: | ||
|
|
||
| * Translate strings online. | ||
| * Review existing translations. | ||
| * Suggest improvements. | ||
| * Vote on translation proposals. | ||
|
|
||
| This method does not require any additional software installation. | ||
|
|
||
| ### Poedit | ||
|
|
||
| Many NVDA translators prefer to work locally using [Poedit](https://poedit.com/) because of its accessibility and ease of use. | ||
|
|
||
| Poedit supports both: | ||
|
|
||
| * Portable Object (`.po`) files used for interface translations. | ||
| * XLIFF (`.xliff`) files used for documentation translations. | ||
|
|
||
| After completing translations locally, files can be uploaded back to Crowdin using [l10nUtil.exe](https://github.com/nvaccess/nvdaL10n/releases/latest). | ||
|
|
||
| ## Translating Interface Strings | ||
|
|
||
| Interface translations are stored in Portable Object (`.po`) files. | ||
|
|
||
| These files can be translated either: | ||
|
|
||
| * Directly in Crowdin. | ||
| * Using Poedit. | ||
|
|
||
| ## Translating Documentation | ||
|
|
||
| Documentation translations are stored in XLIFF (`.xliff`) files. | ||
|
|
||
| These files are generated automatically from the add-on documentation. | ||
|
|
||
| Documentation can be translated: | ||
|
|
||
| * Directly in Crowdin. | ||
| * Using Poedit. | ||
|
|
||
| When translating documentation: | ||
|
|
||
| * Translate only the text content. | ||
| * Preserve placeholders and formatting. | ||
| * Do not modify the XLIFF structure manually. | ||
|
|
||
| ## Uploading Offline Translations | ||
|
|
||
| After translating files locally, they can be uploaded to Crowdin using [l10nUtil.exe](https://github.com/nvaccess/nvdaL10n/releases/latest) | ||
|
|
||
| Examples: | ||
|
|
||
| ```cmd | ||
| l10nUtil.exe uploadTranslationFile fr addonName.po -c addon | ||
| ``` | ||
|
|
||
| ```cmd | ||
| l10nUtil.exe uploadTranslationFile fr addonName.xliff -c addon | ||
| ``` | ||
|
|
||
| Where: | ||
|
|
||
| * `fr` is the Crowdin language code. | ||
| * `addonName.po` is a translated interface file. | ||
| * `addonName.xliff` is a translated documentation file. | ||
|
|
||
| Once uploaded, the translations become available in Crowdin and can later be synchronized back into the add-on repository. | ||
|
|
||
| ## Using l10nUtil.exe | ||
|
|
||
| To display the complete list of available commands: | ||
|
|
||
| ```cmd | ||
| l10nUtil.exe --help | ||
| ``` | ||
|
|
||
| or: | ||
|
|
||
| ```cmd | ||
| l10nUtil.exe -h | ||
| ``` | ||
|
|
||
| To display help for a specific command: | ||
|
|
||
| ```cmd | ||
| l10nUtil.exe downloadTranslationFile --help | ||
| ``` | ||
|
|
||
| or: | ||
|
|
||
| ```cmd | ||
| l10nUtil.exe downloadTranslationFile -h | ||
| ``` | ||
|
|
||
| Refer to the utility help output for a complete list of supported commands and options. | ||
|
|
||
| ## How Synchronization Works | ||
|
|
||
| Translations are not immediately imported into GitHub repositories. | ||
|
|
||
| The add-on maintainer runs a synchronization workflow that: | ||
|
|
||
| 1. Connects to the NVDA Add-ons Crowdin project. | ||
| 1. Downloads completed translations. | ||
| 1. Verifies their translation completion percentage. | ||
| 1. Synchronizes eligible translations back into the repository. | ||
|
|
||
| Depending on the repository configuration, translations may only be synchronized after reaching a minimum completion percentage. | ||
|
|
||
| This threshold is controlled by the add-on maintainer. | ||
|
|
||
| ## Why Has My Translation Not Appeared Yet? | ||
|
|
||
| Possible reasons include: | ||
|
|
||
| * The synchronization workflow has not yet run. | ||
| * The required translation completion percentage has not yet been reached. | ||
| * The maintainer has temporarily disabled synchronization. | ||
| * The translation was completed after the most recent synchronization cycle. | ||
|
|
||
| ## Best Practices | ||
|
|
||
| To improve translation quality: | ||
|
|
||
| * Maintain consistency with existing terminology. | ||
| * Preserve placeholders and formatting. | ||
| * Review existing translations before introducing new terminology. | ||
| * Coordinate with other translators whenever possible. | ||
| * Test translated files locally before uploading them when possible. | ||
|
|
||
| ## Reporting Problems | ||
|
|
||
| If you encounter translation issues: | ||
|
|
||
| * Contact the add-on maintainer. | ||
| * Open an issue in the add-on repository if appropriate. | ||
| * Ask for assistance on the NVDA Translations mailing list. | ||
| * Discuss translation-related issues with the NVDA translation community. | ||
|
|
||
| ## Frequently Asked Questions | ||
|
|
||
| ### Can I translate both documentation and interface strings? | ||
|
|
||
| Yes. | ||
|
|
||
| The NVDA Add-ons Crowdin project supports both interface translations (`.po`) and documentation translations (`.xliff`). | ||
|
|
||
| ### Do I need to use the Crowdin web interface? | ||
|
|
||
| No. | ||
|
|
||
| Many translators work directly in Crowdin, while others prefer to use Poedit and upload their completed translations afterwards using `l10nUtil.exe`. | ||
|
|
||
| Both approaches are supported by the NVDA Add-ons translation workflow. | ||
|
|
||
| ### Do I need access to GitHub? | ||
|
|
||
| Not necessarily. | ||
|
|
||
| Most translators work exclusively through Crowdin or through local translation tools combined with `l10nUtil.exe`. | ||
|
|
||
| The synchronization workflow is managed by the add-on maintainer and automatically imports translations into GitHub repositories. | ||
|
|
||
| ### Can I force synchronization? | ||
|
|
||
| No. | ||
|
|
||
| Synchronization is controlled by the add-on maintainer through the localization workflow provided by the NVDA Add-on Template. | ||
This file contains hidden or 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
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.
Uh oh!
There was an error while loading. Please reload this page.