-
Notifications
You must be signed in to change notification settings - Fork 3
57 lines (49 loc) · 1.78 KB
/
DownloadCrowdinTranslations.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
name: Download Crowdin translations
on:
workflow_dispatch:
# pull_request:
permissions:
contents: write
pull-requests: write
jobs:
pre_translate:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Compile intl TypeScript files
run: npx -p typescript tsc --project src/intl/intl.tsconfig.json
- name: Get Supported Locales
id: get_locales
run: |
supportedLocales=$(node src/intl/dist/scripts/getSupportedLocales.js)
echo "supportedLocales=$supportedLocales" >> $GITHUB_ENV
- name: Pre-translate
uses: crowdin/github-action@v2
with:
command: 'pre-translate'
command_args: '--method mt ${{ env.supportedLocales }} --file cbuilder/src/intl/cbuilder.json --engine-id ${{ vars.CROWDIN_MT_ID }} --verbose'
env:
CROWDIN_PROJECT_ID: ${{ secrets.CROWDIN_PROJECT_ID }}
CROWDIN_PERSONAL_TOKEN: ${{ secrets.CROWDIN_PERSONAL_TOKEN }}
create_pr:
runs-on: ubuntu-latest
needs: pre_translate
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Synchronize with Crowdin
uses: crowdin/github-action@v2
with:
upload_sources: false
upload_translations: false
download_translations: true
localization_branch_name: l10n_crowdin_translations
create_pull_request: true
pull_request_title: 'New Crowdin translations'
pull_request_body: 'New Crowdin pull request with translations'
pull_request_base_branch_name: 'main'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
CROWDIN_PROJECT_ID: ${{ secrets.CROWDIN_PROJECT_ID }}
CROWDIN_PERSONAL_TOKEN: ${{ secrets.CROWDIN_PERSONAL_TOKEN }}