Skip to content

Commit cd22ac1

Browse files
committed
feat: setup Crowdin integration
1 parent 1120006 commit cd22ac1

File tree

2 files changed

+60
-0
lines changed

2 files changed

+60
-0
lines changed

.github/workflows/localization.yml

+40
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
# This workflow will run Crowdin Action that will upload new texts to Crowdin, download the newest translations and create a PR
2+
# For more information see: https://github.com/crowdin/github-action
3+
4+
name: Crowdin Sync
5+
6+
on:
7+
push:
8+
branches: [ master, feat/setup-crowdin ]
9+
10+
jobs:
11+
synchronize-with-crowdin:
12+
runs-on: ubuntu-latest
13+
permissions:
14+
contents: write
15+
pull-requests: write
16+
17+
steps:
18+
- name: Checkout
19+
uses: actions/checkout@v3
20+
21+
- name: crowdin action
22+
uses: crowdin/github-action@v1
23+
with:
24+
# Upload sources to Crowdin
25+
upload_sources: true
26+
# Upload translations to Crowdin, only use true at initial run
27+
upload_translations: true
28+
# Download translations from Crowdin
29+
download_translations: true
30+
# To the specified branch
31+
localization_branch_name: l10n_crowdin_translations
32+
# Create pull request after pushing to branch
33+
create_pull_request: true
34+
pull_request_title: 'New Crowdin Translations'
35+
pull_request_body: 'New Crowdin translations by [Crowdin GH Action](https://github.com/crowdin/github-action)'
36+
pull_request_base_branch_name: 'master'
37+
env:
38+
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
39+
CROWDIN_PROJECT_ID: ${{ secrets.CROWDIN_PROJECT_ID }}
40+
CROWDIN_PERSONAL_TOKEN: ${{ secrets.CROWDIN_PERSONAL_TOKEN }}

crowdin.yml

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
"project_id_env": "CROWDIN_PROJECT_ID"
2+
"api_token_env": "CROWDIN_PERSONAL_TOKEN"
3+
"base_path": "."
4+
5+
"preserve_hierarchy": true
6+
7+
"files": [
8+
{
9+
"source": "readme.md",
10+
"translation": "docs/readme_%two_letters_code%.md",
11+
"languages_mapping": {
12+
"two_letters_code": {
13+
"pt-BR": "pt-BR",
14+
"zh-CN": "cn",
15+
"ne-NP": "np",
16+
"ko": "kr"
17+
}
18+
}
19+
}
20+
]

0 commit comments

Comments
 (0)