diff --git a/RELEASE_OPS.md b/RELEASE_OPS.md index 652f5ee8eb..d8af2df865 100644 --- a/RELEASE_OPS.md +++ b/RELEASE_OPS.md @@ -44,6 +44,19 @@ workflow. e.g. `v1.12.01.md`) and add it to `docs/changelog/README.md`. Follow the house style: plain text, short verb-first sentences. + For the `## Translations` section, generate the credits from Crowdin instead + of writing them by hand: + ```bash + export CROWDIN_PROJECT_ID=... CROWDIN_PERSONAL_TOKEN=... + scripts/translators.sh --from --to + ``` + It pulls a Crowdin *Top Members* report for the window between the two tags, + joins each contributor against `docs/changelog/translators.json` (a + Crowdin-username/id → npub map kept next to the changelogs), and prints the + `## Translations` block grouped by language. Contributors with no npub yet are + listed under `UNMAPPED` — credit them by hand, then add their npub to + `translators.json` so the next release picks them up automatically. + 3. **Publish the release-notes note on Nostr** with Amethyst's account and paste its event id into `amethyst/build.gradle.kts`: ```kotlin diff --git a/tools/translators/translators.sh b/scripts/translators.sh similarity index 90% rename from tools/translators/translators.sh rename to scripts/translators.sh index e936d1e545..c67f5d200e 100755 --- a/tools/translators/translators.sh +++ b/scripts/translators.sh @@ -9,7 +9,7 @@ # can credit them by hand and backfill translators.json. # # Usage: -# tools/translators/translators.sh --from --to +# scripts/translators.sh --from [--to ] # # --from / --to A date (YYYY-MM-DD) or a git tag/ref. Tags are resolved to # their commit date. --to defaults to now if omitted. @@ -21,6 +21,13 @@ # CROWDIN_PROJECT_ID Crowdin numeric project id. # CROWDIN_PERSONAL_TOKEN Crowdin personal access token (needs report scope). # +# Crowdin contributors are joined against docs/changelog/translators.json, a +# Crowdin-username/id -> npub mapping kept alongside the changelogs. Anyone +# Crowdin reports who isn't in the mapping is printed under UNMAPPED so you can +# credit them by hand and backfill the JSON. The contribution window for "between +# two versions" is the commit date of the previous tag -> the commit date of the +# new tag. +# # Requires: bash, curl, jq, git. # # NOTE: This talks to the live Crowdin REST API (api.crowdin.com). The JSON field @@ -30,7 +37,7 @@ set -euo pipefail -REPO_ROOT="$(cd "$(dirname "$0")/../.." && pwd)" +REPO_ROOT="$(cd "$(dirname "$0")/.." && pwd)" API="https://api.crowdin.com/api/v2" MAPPING="$REPO_ROOT/docs/changelog/translators.json" FROM="" @@ -45,7 +52,7 @@ while [ $# -gt 0 ]; do --to) TO="${2:?--to needs a value}"; shift 2 ;; --mapping) MAPPING="${2:?--mapping needs a value}"; shift 2 ;; --raw) RAW=1; shift ;; - -h|--help) sed -n '2,30p' "$0"; exit 0 ;; + -h|--help) sed -n '2,36p' "$0"; exit 0 ;; *) die "unknown argument: $1" ;; esac done diff --git a/tools/translators/README.md b/tools/translators/README.md deleted file mode 100644 index fca6683f99..0000000000 --- a/tools/translators/README.md +++ /dev/null @@ -1,47 +0,0 @@ -# Translator credits for the changelog - -Generates the `## Translations` block for a release by asking Crowdin **who -translated between two releases** and joining them against the npub mapping kept -in the changelog folder. - -## Pieces - -- **`docs/changelog/translators.json`** — the Crowdin-user → npub mapping (lives - next to the changelogs). Keyed by Crowdin username (case-insensitive) or numeric - user id. Add a row whenever a translator gives you their npub. -- **`tools/translators/translators.sh`** — pulls a Crowdin *Top Members* report - for a date window, joins it against the mapping, and prints the credit block - grouped by language. Anyone Crowdin reports who isn't in the mapping is listed - under `UNMAPPED` so you can credit them by hand and backfill the JSON. - -## Usage - -```bash -export CROWDIN_PROJECT_ID=... # same env vars crowdin.yml already uses -export CROWDIN_PERSONAL_TOKEN=... # token needs the "reports" scope - -# Between the previous tag and now: -tools/translators/translators.sh --from v1.12.00 - -# Between two tags: -tools/translators/translators.sh --from v1.11.00 --to v1.12.00 - -# Discover Crowdin usernames to add to translators.json: -tools/translators/translators.sh --from v1.12.00 --raw -``` - -`--from` / `--to` accept either a `YYYY-MM-DD` date or a git tag/ref (resolved to -its commit date). `--to` defaults to now. - -Requires `bash`, `curl`, `jq`, `git`. - -## How the window maps to "between two versions" - -A release is a git tag, so the contribution window is the commit date of the -previous tag → the commit date of the new tag. The Crowdin Top Members report -takes that `dateFrom`/`dateTo` and returns every member who translated/approved -in it, per language. - -> The script talks to the live `api.crowdin.com` REST API. The JSON field paths -> for the downloaded report follow Crowdin's `top-members` schema; if Crowdin -> changes it, adjust the `jq` block at the bottom of `translators.sh`.