Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 36 additions & 0 deletions .github/actions/sync_to_crowdin/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Sync i18n to Crowdin

inputs:
crowdin_project_id:
required: true
description: "Crowdin Project ID"
crowdin_personal_token:
required: true
description: "Crowdin Personal Token"

runs:
using: "composite"
steps:
- name: Setup Node
uses: actions/setup-node@v6
with:
node-version: "22"
registry-url: "https://registry.npmjs.org"

- name: Install pnpm
uses: pnpm/action-setup@v4
with:
# version: 9.9.0
run_install: false

- name: Install dependencies
shell: bash
run: pnpm install

- name: Sync to Crowdin
shell: bash
run: |
pnpm crowdin:upload
env:
CROWDIN_PROJECT_ID: ${{ inputs.crowdin_project_id }}
CROWDIN_PERSONAL_TOKEN: ${{ inputs.crowdin_personal_token }}
29 changes: 5 additions & 24 deletions .github/workflows/i18n_sync.yml
Original file line number Diff line number Diff line change
Expand Up @@ -83,31 +83,12 @@ jobs:
git push
fi

- name: Setup Node
if: steps.verify-changed-files.outputs.changed == 'true'
uses: actions/setup-node@v6
with:
node-version: "22"
registry-url: "https://registry.npmjs.org"

- name: Install pnpm
if: steps.verify-changed-files.outputs.changed == 'true'
uses: pnpm/action-setup@v4
with:
# version: 9.9.0
run_install: false

- name: Install dependencies
if: steps.verify-changed-files.outputs.changed == 'true'
run: pnpm install

- name: Sync to Crowdin
if: steps.verify-changed-files.outputs.changed == 'true'
run: |
pnpm crowdin:upload
env:
CROWDIN_PROJECT_ID: ${{ secrets.CROWDIN_PROJECT_ID }}
CROWDIN_PERSONAL_TOKEN: ${{ secrets.CROWDIN_PERSONAL_TOKEN }}
if: ${{ steps.verify-changed-files.outputs.changed == 'true' || github.event_name == 'push' }}
uses: ./.github/actions/sync_to_crowdin
with:
crowdin_project_id: ${{ secrets.CROWDIN_PROJECT_ID }}
crowdin_personal_token: ${{ secrets.CROWDIN_PERSONAL_TOKEN }}

permissions:
contents: write
21 changes: 21 additions & 0 deletions .github/workflows/manual_sync_to_crowdin.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: Manual sync i18n to Crowdin

on:
workflow_dispatch:

jobs:
run_sync:
name: Run sync
runs-on: ubuntu-latest
steps:
- name: Checkout frontend codes
uses: actions/checkout@v6
with:
fetch-depth: 0
submodules: recursive

- name: Sync to Crowdin
uses: ./.github/actions/sync_to_crowdin
with:
crowdin_project_id: ${{ secrets.CROWDIN_PROJECT_ID }}
crowdin_personal_token: ${{ secrets.CROWDIN_PERSONAL_TOKEN }}