Skip to content

Crowdin Action

Crowdin Action #2068

Workflow file for this run

name: Crowdin Action
on:
workflow_dispatch:
inputs:
locales:
# Target languages https://developer.crowdin.com/language-codes/
default: '["ar", "cs", "de", "el", "es-ES", "et", "fa", "fi", "fil", "fr", "he", "hi", "hr", "id", "it", "ja", "ko", "lt", "ms", "nl", "no", "pl", "pt-PT", "pt-BR", "ro", "ru", "sk", "sl", "sv-SE", "th", "tr", "uk", "vi", "zh-CN", "zh-TW"]'
description: "Languages"
required: true
schedule:
- cron: '30 5,12,17 * * *'
push:
branches: [ main ]
paths:
- 'en/**'
jobs:
# ------------------------
set_locales:
runs-on: ubuntu-latest
outputs:
locales: ${{ steps.generate-matrix.outputs.locales }}
steps:
- name: Generate Matrix
id: generate-matrix
run: |
if [[ ${{ github.event_name == 'workflow_dispatch' }} == true ]]; then
LOCALES='${{ inputs.locales }}'
else
LOCALES='["fr"]'
# LOCALES='["ar", "cs", "de", "el", "es-ES", "et", "fa", "fi", "fil", "fr", "he", "hi", "hr", "id", "it", "ja", "ko", "lt", "ms", "nl", "no", "pl", "pt-PT", "pt-BR", "ro", "ru", "sk", "sl", "sv-SE", "th", "tr", "uk", "vi", "zh-CN", "zh-TW"]'
fi
echo "locales=${LOCALES}" >> $GITHUB_OUTPUT
crowdin:
name: Synchronize with Crowdin
needs:
- set_locales
runs-on: ubuntu-latest
permissions: write-all
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
#GITHUB_TOKEN: ${{ secrets.GH_TOKEN_CROWDIN }}
CROWDIN_PROJECT_ID: ${{ secrets.CROWDIN_PROJECT_ID }}
CROWDIN_PERSONAL_TOKEN: ${{ secrets.CROWDIN_PERSONAL_TOKEN }}
strategy:
fail-fast: false
max-parallel: 1 # Should be 1 to avoid parallel builds
matrix:
lc: ${{ fromJSON(needs.set_locales.outputs.locales) }}
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Matrix
uses: crowdin/github-action@v1
with:
upload_sources: true
upload_translations: false
download_translations: true
commit_message: New Crowdin translations - ${{ matrix.lc }}
localization_branch_name: l10n_main_${{ matrix.lc }}
pull_request_base_branch_name: 'main'
pull_request_title: New translations - ${{ matrix.lc }}
download_language: ${{ matrix.lc }}
#env:
#GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
#CROWDIN_PROJECT_ID: ${{ secrets.CROWDIN_PROJECT_ID }}
#CROWDIN_PERSONAL_TOKEN: ${{ secrets.CROWDIN_PERSONAL_TOKEN }}