From 272424ac3e1a6ad3747a0a2d5035c650c22de5b2 Mon Sep 17 00:00:00 2001 From: Ruben Taelman Date: Sat, 7 Dec 2024 14:10:46 +0100 Subject: [PATCH] Enable Crowdin translations --- .github/workflows/crowdin.yml | 28 ++++++++++++++++++++++++ crowdin.yml | 41 +++++++++++++++++++++++++++++++++++ 2 files changed, 69 insertions(+) create mode 100644 .github/workflows/crowdin.yml create mode 100644 crowdin.yml diff --git a/.github/workflows/crowdin.yml b/.github/workflows/crowdin.yml new file mode 100644 index 0000000000..85b323afd0 --- /dev/null +++ b/.github/workflows/crowdin.yml @@ -0,0 +1,28 @@ +name: "Crowdin Sync Translations" + +on: + schedule: + - cron: '0 7 * * *' + workflow_dispatch: + +jobs: + synchronize-with-crowdin: + runs-on: ubuntu-latest + + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Crowdin action + uses: crowdin/github-action@v2 + with: + upload_sources: true + upload_translations: false + download_translations: true + localization_branch_name: l10n_crowdin_translations + create_pull_request: true + pull_request_title: 'New Translations' + pull_request_body: 'New translations by [Crowdin GitHub Action](https://github.com/crowdin/github-action)' + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + CROWDIN_PROJECT_ID: ${{ secrets.CROWDIN_PROJECT_ID }} # A numeric ID, found at https://crowdin.com/project//tools/api + CROWDIN_PERSONAL_TOKEN: ${{ secrets.CROWDIN_PERSONAL_TOKEN }} diff --git a/crowdin.yml b/crowdin.yml new file mode 100644 index 0000000000..222238f28a --- /dev/null +++ b/crowdin.yml @@ -0,0 +1,41 @@ +project_id_env: CROWDIN_PROJECT_ID +api_token_env: CROWDIN_PERSONAL_TOKEN +base_path: . + +preserve_hierarchy: true + +files: + - source: loader-common/src/main/resources/assets/cyclopscore/lang/en_us.json + translation: loader-common/src/main/resources/assets/cyclopscore/lang/%locale_with_underscore%.json + languages_mapping: + locale_with_underscore: + af: af_za + ar: ar_sa + ca: ca_es + cs: cs_cz + da: da_dk + de: de_de + el: el_gr + en-US: en_us + es-ES: es_es + fi: fi_fi + fr: fr_fr + he: he_il + hu: hu_hu + it: it_it + ja: ja_jp + ko: ko_kr + nl: nl_nl + no: no_no + pl: pl_pl + pt-BR: pt_br + pt-PT: pt_pt + ro: ro_ro + ru: ru_ru + sr: sr_sp + sv-SE: sv_se + tr: tr_tr + uk: uk_ua + vi: vi_vn + zh-CN: zh_cn + zh-TW: zh_tw