diff --git a/.github/workflows/i18n-pull.yml b/.github/workflows/i18n-pull.yml index 4ea0e1952..62c278321 100644 --- a/.github/workflows/i18n-pull.yml +++ b/.github/workflows/i18n-pull.yml @@ -56,6 +56,17 @@ jobs: ref: ${{ github.ref }} token: ${{ secrets.CROWDIN_GH_TOKEN }} + - name: Setup Node + uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0 + with: + node-version-file: .nvmrc + + - name: Enable Corepack + run: corepack enable + + - name: Install script dependencies + run: pnpm install --frozen-lockfile --ignore-scripts + - name: Configure Git author id: git-author uses: MarcoIeni/git-config@59144859caf016f8b817a2ac9b051578729173c4 # v0.1.2 @@ -95,6 +106,9 @@ jobs: shell: bash run: sudo chown -R $USER:$USER . + - name: Prune stale ICU translations + run: pnpm scripts i18n-icu-contract prune-local + - name: Create Pull Request uses: peter-evans/create-pull-request@5f6978faf089d4d20b00c7766989d076bb2fc7f1 # v8.1.1 with: diff --git a/.github/workflows/i18n-push.yml b/.github/workflows/i18n-push.yml index 9a0de81d4..6146c3752 100644 --- a/.github/workflows/i18n-push.yml +++ b/.github/workflows/i18n-push.yml @@ -4,11 +4,14 @@ on: push: branches: ['main'] paths: - - '.github/workflows/i18n.push.yml' + - '.github/workflows/i18n-push.yml' - 'apps/*/src/locales/en-US/**' - 'apps/*/locales/en-US/**' - 'packages/*/src/locales/en-US/**' - 'packages/*/locales/en-US/**' + - 'scripts/i18n-icu-contract.ts' + - 'package.json' + - 'pnpm-lock.yaml' - 'crowdin.yml' workflow_dispatch: @@ -56,6 +59,18 @@ jobs: uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 with: ref: ${{ github.ref }} + fetch-depth: 2 + + - name: Setup Node + uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0 + with: + node-version-file: .nvmrc + + - name: Enable Corepack + run: corepack enable + + - name: Install script dependencies + run: pnpm install --frozen-lockfile --ignore-scripts - name: Query branch name id: branch-name @@ -79,3 +94,9 @@ jobs: env: CROWDIN_PROJECT_ID: ${{ vars.CROWDIN_PROJECT_ID }} CROWDIN_PERSONAL_TOKEN: ${{ secrets.CROWDIN_PERSONAL_TOKEN }} + + - name: Clear stale ICU translations in Crowdin + run: pnpm scripts i18n-icu-contract clear-crowdin-changed --base-ref HEAD^ --crowdin-branch "[${{ github.repository_owner }}.${{ github.event.repository.name }}] ${{ steps.branch-name.outputs.safe_branch_name }}" + env: + CROWDIN_PROJECT_ID: ${{ vars.CROWDIN_PROJECT_ID }} + CROWDIN_PERSONAL_TOKEN: ${{ secrets.CROWDIN_PERSONAL_TOKEN }} diff --git a/.github/workflows/turbo-ci.yml b/.github/workflows/turbo-ci.yml index e25448c86..a31fcb8bc 100644 --- a/.github/workflows/turbo-ci.yml +++ b/.github/workflows/turbo-ci.yml @@ -204,4 +204,5 @@ jobs: - name: Verify intl:extract has been run run: | pnpm turbo run intl:extract --force - git diff --exit-code --color */*/src/locales/en-US/index.json + pnpm scripts i18n-icu-contract prune-local --check + git diff --exit-code --color */*/src/locales/*/index.json diff --git a/apps/app-frontend/package.json b/apps/app-frontend/package.json index a2e5bfaf5..9df74bb68 100644 --- a/apps/app-frontend/package.json +++ b/apps/app-frontend/package.json @@ -10,6 +10,7 @@ "lint": "eslint . && prettier --check .", "fix": "eslint . --fix && prettier --write .", "intl:extract": "formatjs extract \"src/**/*.{vue,ts,tsx,js,jsx,mts,cts,mjs,cjs}\" --ignore \"**/*.d.ts\" --ignore node_modules --out-file src/locales/en-US/index.json --format crowdin --preserve-whitespace", + "intl:prune-local": "pnpm -w scripts i18n-icu-contract prune-local --scope apps/app-frontend", "test": "vue-tsc --noEmit" }, "dependencies": { diff --git a/apps/app-frontend/src/components/ui/world/WorldItem.vue b/apps/app-frontend/src/components/ui/world/WorldItem.vue index f9b447000..ba4597bd5 100644 --- a/apps/app-frontend/src/components/ui/world/WorldItem.vue +++ b/apps/app-frontend/src/components/ui/world/WorldItem.vue @@ -244,7 +244,7 @@ const messages = defineMessages({