Skip to content

Commit cfe8b6e

Browse files
committed
Add Crowdin workflow
1 parent f6b5623 commit cfe8b6e

File tree

3 files changed

+99
-0
lines changed

3 files changed

+99
-0
lines changed
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
name: Crowdin Download 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@v2
20+
with:
21+
upload_sources: false
22+
upload_translations: false
23+
download_translations: true
24+
localization_branch_name: l10n_crowdin_translations
25+
create_pull_request: true
26+
auto_approve_imported: true
27+
pull_request_title: 'New Crowdin Translations'
28+
pull_request_body: 'New Crowdin translations by [Crowdin GH Action](https://github.com/crowdin/github-action)'
29+
pull_request_base_branch_name: 'main'
30+
31+
env:
32+
# A classic GitHub Personal Access Token with the 'repo' scope selected (the user should have write access to the repository).
33+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
34+
35+
# A numeric ID, found at https://crowdin.com/project/<projectName>/tools/api
36+
CROWDIN_PROJECT_ID: ${{ vars.CROWDIN_PROJECT_ID }}
37+
38+
# Visit https://crowdin.com/settings#api-key to create this token
39+
CROWDIN_PERSONAL_TOKEN: ${{ secrets.CROWDIN_PERSONAL_TOKEN }}

.github/workflows/crowdin-upload.yml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: Crowdin Upload 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@v2
20+
with:
21+
upload_sources: true
22+
upload_translations: true
23+
download_translations: false
24+
# localization_branch_name: l10n_crowdin_translations
25+
# create_pull_request: true
26+
# auto_approve_imported: true
27+
# pull_request_title: 'New Crowdin Translations'
28+
# pull_request_body: 'New Crowdin translations by [Crowdin GH Action](https://github.com/crowdin/github-action)'
29+
# pull_request_base_branch_name: 'main'
30+
env:
31+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
32+
33+
# A numeric ID, found at https://crowdin.com/project/<projectName>/tools/api
34+
CROWDIN_PROJECT_ID: ${{ vars.CROWDIN_PROJECT_ID }}
35+
36+
# Visit https://crowdin.com/settings#api-key to create this token
37+
CROWDIN_PERSONAL_TOKEN: ${{ secrets.CROWDIN_PERSONAL_TOKEN }}

crowdin.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
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": "/languages/wp-module-onboarding.pot",
10+
"translation": "/languages/wp-module-onboarding-%locale%.po",
11+
"languages_mapping": {
12+
"locale": {
13+
"de": "de_DE",
14+
"en-AU": "en_AU",
15+
"en-GB": "en_GB",
16+
"es-ES": "es_ES",
17+
"fr": "fr_FR",
18+
"it": "it_IT",
19+
"nl": "nl_NL"
20+
}
21+
}
22+
}
23+
]

0 commit comments

Comments
 (0)