Translation Workflow Guide
This document outlines the process for managing translations in our WordPress plugin module repositories using Crowdin and GitHub Actions.
Workflow Overview
Our translation process consists of two GitHub Actions workflows:
- Crowdin Upload Action: Uploads the latest source file (
.pot
file) to Crowdin. - Crowdin Download Action: Downloads translated
.po
files from Crowdin and creates a pull request against the selected branch.
After downloading the translations, additional steps are required to generate the necessary translation files for PHP and JavaScript.
Steps for Managing Translations
1. Upload Source File to Crowdin
If there are untranslated strings, follow these steps to upload the updated source file to Crowdin:
- Navigate to the GitHub repository.
- Go to the Actions tab.
- Select Crowdin Upload Action.
- Click Run workflow (ensure you are in the correct branch).
- The workflow will upload the updated
.pot
file to Crowdin.
2. Translate in Crowdin
- Log in to Crowdin.
- Navigate to the respective project.
- Use machine translations or manual translations to complete the missing translations.
- Ensure translations are reviewed and approved.
3. Download Translations from Crowdin
Once translations are completed in Crowdin, follow these steps to download the translated .po
files:
- Navigate to the GitHub repository.
- Go to the Actions tab.
- Select Crowdin Download Action.
- Click Run workflow.
- Specify the base branch where you want the PR to be raised (default:
main
). - The workflow will download translations and create a pull request.
4. Verify and Generate Translation Files
After the pull request is created:
- Review the translations in the
.po
files for accuracy and correctness. - Once verified, merge the pull request.
- Run the following commands to generate translation files for PHP and JS:
composer i18n-mo composer i18n-php composer i18n-json
- Commit and push the generated files if necessary.
Notes
- Ensure that the necessary Crowdin API credentials are configured in the repository secrets (
CROWDIN_PROJECT_ID
andCROWDIN_PERSONAL_TOKEN
).
By following this workflow, we can efficiently manage and maintain translations for our WordPress plugin modules.