Skip to content

Commit 306e197

Browse files
authored
ci: add crowdin (#55)
1 parent 770c99e commit 306e197

File tree

2 files changed

+49
-0
lines changed

2 files changed

+49
-0
lines changed

.github/crowdin/config.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

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

0 commit comments

Comments
 (0)