Skip to content

Commit 506acc8

Browse files
committed
ci: add crowdin
1 parent 770c99e commit 506acc8

File tree

2 files changed

+48
-0
lines changed

2 files changed

+48
-0
lines changed

.github/crowdin/crowdin.yml

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
files:
2+
- source: /*.md
3+
translation: /%two_letters_code%/%original_file_name%
4+
ignore:
5+
- '/_coverpage.md'
6+
- '/_navbar.md'
7+
translation_replace:
8+
- zh: ""
9+
10+
project_id_env: CROWDIN_PROJECT_ID
11+
api_token_env: CROWDIN_PERSONAL_TOKEN

.github/workflows/crowdin.yml

+37
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: Crowdin Action
2+
3+
on:
4+
workflow_dispatch:
5+
6+
permissions:
7+
contents: write
8+
pull-requests: write
9+
10+
jobs:
11+
synchronize-with-crowdin:
12+
runs-on: ubuntu-latest
13+
14+
steps:
15+
- name: Checkout
16+
uses: actions/checkout@v4
17+
18+
- name: crowdin action
19+
uses: crowdin/github-action@v1
20+
with:
21+
upload_sources: false
22+
upload_translations: false
23+
download_translations: true
24+
download_language: zh-CN
25+
download_translations_args: --all
26+
localization_branch_name: l10n_crowdin_${{ github.ref_name }}_translations
27+
create_pull_request: true
28+
crowdin_branch_name: ${{ github.ref_name }}
29+
pull_request_team_reviewers: ${{ github.repository }}
30+
pull_request_title: 'New Crowdin Translations'
31+
pull_request_base_branch_name: ${{ github.ref_name }}
32+
base_path: ${{ github.workspace }}/docs
33+
config: '.github/crowdin/crowdin.yml'
34+
env:
35+
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
36+
CROWDIN_PROJECT_ID: ${{ secrets.CROWDIN_PROJECT_ID }}
37+
CROWDIN_PERSONAL_TOKEN: ${{ secrets.CROWDIN_PERSONAL_TOKEN }}

0 commit comments

Comments
 (0)