Skip to content

Commit c76e555

Browse files
authored
feat: add crowdin sync to repo (#472)
* feat: crowdin.yml file * feat: gh action to sync with crowdin * precommit
1 parent df18ed7 commit c76e555

File tree

2 files changed

+35
-0
lines changed

2 files changed

+35
-0
lines changed

.github/workflows/crowdin_sync.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: Crowdin Sync
2+
3+
on:
4+
workflow_dispatch:
5+
6+
jobs:
7+
sync-translations:
8+
runs-on: ubuntu-latest
9+
10+
steps:
11+
- name: Checkout repo
12+
uses: actions/checkout@v4
13+
14+
- name: Sync with Crowdin
15+
uses: crowdin/github-action@v2
16+
with:
17+
upload_sources: true
18+
upload_translations: false
19+
download_translations: true
20+
localization_branch_name: l10n_crowdin_translations
21+
create_pull_request: true
22+
pull_request_title: "Crowdin: New translations"
23+
pull_request_body: "Crowdin synced updated translations via GitHub Action."
24+
pull_request_base_branch_name: "main"
25+
env:
26+
GITHUB_TOKEN: ${{ secrets.GH_TOKEN_CROWDIN }}
27+
CROWDIN_PROJECT_ID: ${{ secrets.CROWDIN_PROJECT_ID }}
28+
CROWDIN_PERSONAL_TOKEN: ${{ secrets.CROWDIN_PERSONAL_TOKEN }}

crowdin.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
project_id: "${{ secrets.CROWDIN_PROJECT_ID }}"
2+
api_token: "${{ secrets.CROWDIN_PERSONAL_TOKEN }}"
3+
4+
files:
5+
- source: /locales/en/LC_MESSAGES/messages.po
6+
translation: /locales/%two_letters_code%/LC_MESSAGES/messages.po
7+
type: gettext

0 commit comments

Comments
 (0)