Skip to content

Synchronize Crowdin #340

Synchronize Crowdin

Synchronize Crowdin #340

Workflow file for this run

# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# ** Synchronize Crowdin translation **
#
# Crowdin is a platform to manage the translation process in the Catroweb project:
#
# 1. We upload our english (base) translation files
# 2. Users worldwide translate our provided strings
# 3. We download the translations (In case translations are missing english is the fallback)
#
# This GitHub Action uses the official action from Crowdin to automate step 1 and 2.
# A pull request is created/updated automatically containing all new translations.
#
# - Secrets required!
#
name: Synchronize Crowdin
#
# New base strings could be uploaded on the merge of a new feature.
# However, the translation download process is independent from a pull request.
# Hence, keeping a consistent schedule once a day is more than enough.
#
# In case, an additional run is required, a manual dispatch trigger is also enabled.
#
on:
schedule:
- cron: '0 3 * * *'
workflow_dispatch:
jobs:
#
# - Two-way synchronization:
# -- In case of new strings in the repo, they are uploaded to Crowdin
# -- In case of new translation, a pull request containing all changes will be created or updated
#
# - The crowdin configuration is in `config/crowdin.yaml`. However, without credentials!
#
# - The credentials are provided as secrets to the action as environment variables.
# In case they must be updated, talk to a product owner.
#
synchronize-with-crowdin:
# Only should run on the main repo. (Running without the secrets would result in a fail anyway!)
if: github.repository == 'Catrobat/Catroweb'
name: Synchronize Crowdin Translations
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: crowdin/github-action@1.4.10
with:
upload_sources: true
upload_translations: false
download_translations: true
config: 'config/crowdin.yaml'
create_pull_request: true
pull_request_title: 'New Crowdin translations'
pull_request_body: 'This PR is automatically updated and generated by the official Crowdin GitHub Action'
pull_request_labels: 'translations, automated'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
CROWDIN_PROJECT_ID: ${{ secrets.CROWDIN_PROJECT_ID }}
CROWDIN_PERSONAL_TOKEN: ${{ secrets.CROWDIN_PERSONAL_TOKEN }}