Skip to content

Crowdin Translations #45

Crowdin Translations

Crowdin Translations #45

Workflow file for this run

---
name: Crowdin Translations
on:
# Upload sources to Crowdin when changes are pushed to main
push:
branches:
- main
paths:
- 'l10n/bundle.l10n.json'
# Download translations on schedule (daily at 2 AM UTC)
schedule:
- cron: '0 2 * * *'
# Allow manual trigger
workflow_dispatch:
jobs:
synchronize-with-crowdin:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 20
- name: Install dependencies
run: npm ci
# Upload source files to Crowdin
- name: Upload sources to Crowdin
if: github.event_name == 'push'
uses: crowdin/github-action@v2
with:
upload_sources: true
upload_translations: false
download_translations: false
env:
CROWDIN_PROJECT_ID: ${{ secrets.CROWDIN_PROJECT_ID }}
CROWDIN_PERSONAL_TOKEN: ${{ secrets.CROWDIN_PERSONAL_TOKEN }}
# Download translations from Crowdin
- name: Download translations from Crowdin
if: >-
github.event_name == 'schedule' ||
github.event_name == 'workflow_dispatch'
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 translations from Crowdin'
pull_request_labels: 'localization, crowdin'
env:
CROWDIN_PROJECT_ID: ${{ secrets.CROWDIN_PROJECT_ID }}
CROWDIN_PERSONAL_TOKEN: ${{ secrets.CROWDIN_PERSONAL_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}