Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 36 additions & 7 deletions .github/workflows/download-translations.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@ on:
# Run every day at 1 AM UTC
- cron: "0 1 * * *"
workflow_dispatch: # Manual triggering
inputs:
language_code:
description: 'Language code to download translations for (leave empty to download all languages)'
required: false
default: ''
type: string

concurrency:
group: crowdin-download
Expand All @@ -22,23 +28,46 @@ jobs:
echo "Skipping Crowdin sync — no project ID set."
exit 0
fi

- name: Checkout
uses: actions/checkout@v4
with:
ref: master

- name: Synchronize with Crowdin
- name: Download all translations from Crowdin
uses: crowdin/github-action@v2
with:
upload_sources: false
upload_translations: false
create_pull_request: true
crowdin_branch_name: master
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: "master"
pull_request_body: "New Crowdin pull request with translations"
pull_request_title: "New Crowdin translations"
upload_sources: false
upload_translations: false
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
CROWDIN_API_TOKEN: ${{ secrets.CROWDIN_API_TOKEN }}
CROWDIN_PROJECT_ID: ${{ secrets.CROWDIN_PROJECT_ID }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
if: ${{ inputs.language_code == '' }}

- name: Download selected translations from Crowdin
uses: crowdin/github-action@v2
with:
create_pull_request: true
crowdin_branch_name: master
download_language: ${{ inputs.language_code }}
download_translations: true
localization_branch_name: l10n_crowdin_translations-${{ inputs.language_code }}
pull_request_base_branch_name: "master"
pull_request_body: "New Crowdin pull request with translations"
pull_request_title: "New Crowdin translations for ${{ inputs.language_code }}"
upload_sources: false
upload_translations: false
env:
CROWDIN_API_TOKEN: ${{ secrets.CROWDIN_API_TOKEN }}
CROWDIN_PROJECT_ID: ${{ secrets.CROWDIN_PROJECT_ID }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
if: ${{ inputs.language_code != '' }}

8 changes: 8 additions & 0 deletions .github/workflows/upload-sources.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,17 @@ jobs:
- name: Checkout
uses: actions/checkout@v4

- name: Make sure CROWDIN_PROJECT_ID is set
run: |
if [ -z "${{ secrets.CROWDIN_PROJECT_ID }}" ]; then
echo "CROWDIN_PROJECT_ID is not set. Please see instructions in CROWDIN.md"
exit 1
fi

- name: Crowdin push
uses: crowdin/github-action@v2
with:
crowdin_branch_name: master
upload_sources: true
upload_translations: false
download_translations: false
Expand Down