Skip to content

Commit f313d61

Browse files
authored
Merge pull request #359 from weni-ai/feature/crowdin
[CFE-404] - Crowdin
2 parents e672fe4 + 92e4098 commit f313d61

File tree

3 files changed

+65
-0
lines changed

3 files changed

+65
-0
lines changed
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: Crowdin Download
2+
on:
3+
schedule:
4+
- cron: '0 20 * * *' # Run the workflow every day at 20:00 UTC
5+
permissions:
6+
contents: write
7+
pull-requests: write
8+
jobs:
9+
crowdin-download:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Checkout
13+
uses: actions/checkout@v4
14+
- name: Synchronize with Crowdin
15+
uses: crowdin/github-action@v2
16+
with:
17+
upload_sources: false
18+
upload_translations: false
19+
download_translations: true
20+
localization_branch_name: crowdin_translations
21+
create_pull_request: true
22+
pull_request_title: "[CROWDIN] - New translations"
23+
pull_request_body: New Crowdin pull request with translations
24+
pull_request_base_branch_name: main
25+
env:
26+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
27+
CROWDIN_PROJECT_ID: ${{ secrets.CROWDIN_PROJECT_ID }}
28+
CROWDIN_PERSONAL_TOKEN: ${{ secrets.CROWDIN_PERSONAL_TOKEN }}

.github/workflows/crowdin-upload.yaml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
name: Crowdin Upload
2+
3+
on:
4+
push:
5+
paths: [ 'src/locales/**' ]
6+
branches: [ main ]
7+
8+
jobs:
9+
crowdin-upload:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Checkout
13+
uses: actions/checkout@v4
14+
15+
- name: Crowdin push
16+
uses: crowdin/github-action@v2
17+
with:
18+
upload_sources: true
19+
upload_translations: true
20+
download_translations: false
21+
env:
22+
CROWDIN_PROJECT_ID: ${{ secrets.CROWDIN_PROJECT_ID }}
23+
CROWDIN_PERSONAL_TOKEN: ${{ secrets.CROWDIN_PERSONAL_TOKEN }}

crowdin.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
"project_id_env": "CROWDIN_PROJECT_ID"
2+
"api_token_env": "CROWDIN_PERSONAL_TOKEN"
3+
"base_path": "."
4+
"base_url": "https://api.crowdin.com"
5+
6+
"preserve_hierarchy": true
7+
8+
9+
files: [
10+
{
11+
"source": "src/locales/en.json",
12+
"translation": "src/locales/%locale%.json",
13+
}
14+
]

0 commit comments

Comments
 (0)