Skip to content

Commit 82a9e6b

Browse files
authored
Add the translation download to the release steps (#547)
## Why Every release now needs `npm run i18n:download` in the version-bump PR. Skip it and the build ships old translations or none, and nothing fails. #546 documented the release without this step. translate.wordpress.org now has the project, and Polish is at 100%, so the next release will ship a catalog. ## What changes - `RELEASING.md` step 1 gains the download as sub-step 4: run it, commit `src/languages/`, and paste the coverage table into the bump PR. It says what is held back (right-to-left locales), what it prints when nothing qualifies, that it removes every other catalog in `src/languages/`, and that a failed run changes nothing. - The "exactly three changed lines" check now reads "outside `src/languages/`". - `RELEASING.md` step 3 says the Windows artifact may download with a `dist_` prefix, which has to be removed before it is attached to the release. - `CONTRIBUTING.md`'s "Back:" bullet links to the step, and loses the sentence saying translate.wordpress.org doesn't have the project yet. Not here: the CI check #543 suggests, which would fail a bump PR whose `src/languages/` doesn't match translate.wordpress.org. ## How to test this Platforms: any. Run from the repository root on this branch. 1. Read `RELEASING.md` step 1. Each claim in sub-step 4 matches `scripts/download-translations.cjs`. 2. Run `npm run i18n:download`. It writes `src/languages/pl.json` and prints a coverage table listing `pl`. Clean up with `git checkout -- src/languages && git clean -f src/languages`. 3. Click the `CONTRIBUTING.md#translatable-strings` link in `RELEASING.md` and the `RELEASING.md` link in `CONTRIBUTING.md`'s "Back:" bullet. Both land on the right heading. **What must not have happened:** no file outside `RELEASING.md` and `CONTRIBUTING.md` changes. Step 2's download removes any untracked catalog in `src/languages/`, so move one aside first if you want to keep it. ## Risks and limitations - The branch was rebuilt on trunk after #546 merged. It used to carry #544's commits from before it was squash-merged, which conflicted with trunk in 12 files. - Pre-PR review: 1 medium and 3 low findings, all fixed; 2 nits left. ## Related Fixes #543 together with #546. --- <details> <summary>Review outcome (required — see AGENTS.md)</summary> - **Review:** completed. Fresh-context Explore agent on `24086a8` against trunk `6d5f334`. - Medium, fixed: the step said `No locales downloaded.` prints when no locale is over 80%. It prints only when nothing ships, nothing is held back and nothing is removed. - Low, fixed: right-to-left locales are listed after the table under the plain-text `Not shipped:`, and only when they reach 80%. - Low, fixed: the download removes every other catalog in `src/languages/`, untracked ones included. - Low, fixed: a failed run leaves `src/languages/` unchanged. - Nits, left: the link could point at the subsection instead of `#translatable-strings`, and step 1's sub-steps now run to 6, which overlaps the section numbers. Nothing refers to them by number. - **Since review:** `24086a8 → 7ebde3f`: the four fixes above in step 1, and the `dist_` note in step 3. Not re-reviewed; both are docs only. - **CodeRabbit:** not requested. </details> 🤖 Generated with [Claude Code](https://claude.com/claude-code)
1 parent 53d5272 commit 82a9e6b

2 files changed

Lines changed: 6 additions & 3 deletions

File tree

‎CONTRIBUTING.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ To see what is wrapped, run the app in the pseudo-locale from the repository roo
8787
Translations happen on translate.wordpress.org, in the project `meta/contributor-toolkit`: <https://translate.wordpress.org/projects/meta/contributor-toolkit/>. The Meta team creates a project like this on request, from the WordPress.org Meta Trac or the #meta channel on Make WordPress Slack; translating the app as a whole is tracked in [#540](https://github.com/WordPress/contributor-toolkit/issues/540).
8888

8989
- **Out:** every push to trunk that touches `src/` runs [`i18n-pot.yml`](.github/workflows/i18n-pot.yml), which regenerates the `.pot` and commits it to the `translations` branch. translate.wordpress.org imports its strings from <https://raw.githubusercontent.com/WordPress/contributor-toolkit/translations/contributor-toolkit.pot>. Nothing to do by hand; run `npm run i18n:pot` from the repository root to see the same file locally, at `contributor-toolkit.pot` in the repository root.
90-
- **Back:** in the version-bump pull request for a release, run `npm run i18n:download` from the repository root. It writes a catalog to `src/languages/` for every locale at least 80% translated, removes the catalog of any locale that fell below that, and prints a table; commit `src/languages/` and paste the table into the pull request. To include strings awaiting approval, run `npm run i18n:download -- --status=current,waiting` from the repository root; approved and waiting strings count toward the same 80% cutoff and appear in the exported catalogs. Use `--status=waiting` for waiting strings only, or include `fuzzy` in the comma-separated status list. Add `--locales=de,fr` to limit downloads and removals to those locale slugs, leaving other catalogs untouched. Explicitly specifying `--status` or `--locales` (`--locale` is accepted as an alias) bypasses the 80% cutoff; locale eligibility rules still apply. Unknown flags are rejected before any catalogs change. To choose another project, pass its full path, for example `--project=meta/contributor-toolkit` (the default). Until translate.wordpress.org has the project, the script says so and changes nothing, and the release ships in English.
90+
- **Back:** in the version-bump pull request for a release ([step 1 of RELEASING.md](RELEASING.md#1-open-the-version-bump-pull-request)), run `npm run i18n:download` from the repository root. It writes a catalog to `src/languages/` for every locale at least 80% translated, removes the catalog of any locale that fell below that, and prints a table; commit `src/languages/` and paste the table into the pull request. To include strings awaiting approval, run `npm run i18n:download -- --status=current,waiting` from the repository root; approved and waiting strings count toward the same 80% cutoff and appear in the exported catalogs. Use `--status=waiting` for waiting strings only, or include `fuzzy` in the comma-separated status list. Add `--locales=de,fr` to limit downloads and removals to those locale slugs, leaving other catalogs untouched. Explicitly specifying `--status` or `--locales` (`--locale` is accepted as an alias) bypasses the 80% cutoff; locale eligibility rules still apply. Unknown flags are rejected before any catalogs change. To choose another project, pass its full path, for example `--project=meta/contributor-toolkit` (the default).
9191

9292
The app picks the catalog for the language chosen in its settings, or else for the operating system's language. Right-to-left locales such as Arabic, Hebrew and Persian pass the cut-off and still do not ship, and the table names them: the page already follows a catalog's text direction, but the app's styles are not right-to-left yet, so those locales wait until they are. Every other locale over the cut-off ships, even one no operating system language selects, such as `pirate`; the table names those too.
9393

‎RELEASING.md‎

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,9 @@ Versions are `X.Y.Z` for a stable release and `X.Y.Z-beta.N` for a beta. Tags ad
1717
python3 -c "import json;d=json.load(open('package-lock.json'));print(d['version'], d['packages']['']['version'])"
1818
```
1919

20-
4. Run `npm run lint` and `npm test`.
21-
5. Open the pull request, titled `Bump version to X.Y.Z`. [#533](https://github.com/WordPress/contributor-toolkit/pull/533) is a good model. `git diff trunk` must show exactly three changed lines.
20+
4. Run `npm run i18n:download` and commit `src/languages/`. It writes a catalog for every locale at least 80% translated on translate.wordpress.org, removes every other catalog in `src/languages/` (an untracked one included), and prints a coverage table. Right-to-left locales are held back even at 80%, and the output lists them after the table under `Not shipped:`. When no locale reaches 80% and there is no catalog to remove, it prints `No locales downloaded.` instead of a table. If it exits with an error, nothing in `src/languages/` changed; run it again. Skipping this step ships the previous release's translations, or none, and nothing fails. See [Translatable strings](CONTRIBUTING.md#translatable-strings) in `CONTRIBUTING.md`.
21+
5. Run `npm run lint` and `npm test`.
22+
6. Open the pull request, titled `Bump version to X.Y.Z`, and paste the coverage table into its description, or the script's message if it printed no table. [#533](https://github.com/WordPress/contributor-toolkit/pull/533) is a good model. `git diff trunk` must show exactly three changed lines outside `src/languages/`.
2223

2324
## 2. Check the signed artifacts
2425

@@ -32,6 +33,8 @@ Buildkite builds signed Windows, macOS and Linux artifacts for the pull request'
3233

3334
Update the branch with trunk first if it has fallen behind, and check the artifacts again on the new head. Download the three files from the build you checked last. They are what the release ships.
3435

36+
The Windows file may download as `dist_wordpress-contributor-toolkit-X.Y.Z-win-x64.exe`, because the Windows build uploads it from `dist\`. Rename it to remove the `dist_` prefix before you attach it to the release, so its name matches the other two and the one in step 2.
37+
3538
Then squash-merge. The merged commit has the same content as that build, and it is the one you tag.
3639

3740
## 4. Publish the GitHub release

0 commit comments

Comments
 (0)