ci(i18n): enforce controlled crowdin localization workflow and pr validation

Add Crowdin pull request validation script, centralize locale configuration, and update GitHub workflows to enforce sparse target catalog validation.
This commit is contained in:
neon
2026-08-06 00:00:04 +00:00
parent 6a0a9a3d53
commit b9e041d1b7
16 changed files with 608 additions and 71 deletions
+19
View File
@@ -190,6 +190,25 @@ jobs:
node-version: ${{ env.NODE_VERSION }}
pnpm-version: ${{ env.PNPM_VERSION }}
- name: Enforce localization change policy
shell: bash
env:
IS_CROWDIN: ${{ steps.crowdin.outputs.is_crowdin }}
PR_BASE_SHA: ${{ github.event.pull_request.base.sha }}
PR_HEAD_SHA: ${{ github.event.pull_request.head.sha }}
run: |
set -euo pipefail
validator="$RUNNER_TEMP/validate-locale-pr.mjs"
if git cat-file -e "$PR_BASE_SHA:scripts/validate-locale-pr.mjs" 2>/dev/null; then
git show "$PR_BASE_SHA:scripts/validate-locale-pr.mjs" > "$validator"
else
git show "$PR_HEAD_SHA:scripts/validate-locale-pr.mjs" > "$validator"
fi
node "$validator" "$PR_BASE_SHA" "$PR_HEAD_SHA" "$IS_CROWDIN"
- name: Test PR policy scripts
run: node --test scripts/validate-locale-pr.test.mjs
- name: Lint PR title
shell: bash
env:
+1 -1
View File
@@ -60,7 +60,7 @@ jobs:
CROWDIN_ALLOWED_TRANSLATION_LOSSES: ${{ inputs.allowed_translation_losses }}
CROWDIN_PROJECT_ID: ${{ vars.CROWDIN_PROJECT_ID }}
CROWDIN_TOKEN: ${{ secrets.CROWDIN_TOKEN }}
run: node client/scripts/sync-crowdin-translations.mjs
run: pnpm --filter client sync:crowdin
- name: Validate translation catalogs
run: pnpm --filter client validate:locales