From 0478c0f86e62632827e7304d870204933a574ef6 Mon Sep 17 00:00:00 2001 From: Denys Konovalov Date: Fri, 29 Mar 2024 20:14:30 +0100 Subject: [PATCH 1/3] use crowdin action for translation sync --- .github/workflows/cron-translations.yml | 35 +++++++++---------------- crowdin.yml | 12 +++++++++ 2 files changed, 25 insertions(+), 22 deletions(-) create mode 100644 crowdin.yml diff --git a/.github/workflows/cron-translations.yml b/.github/workflows/cron-translations.yml index 390aae7c07951..493e003f99e28 100644 --- a/.github/workflows/cron-translations.yml +++ b/.github/workflows/cron-translations.yml @@ -4,6 +4,8 @@ on: schedule: - cron: "7 0 * * *" # every day at 00:07 UTC workflow_dispatch: + push: + branches: ["main"] jobs: crowdin-pull: @@ -11,14 +13,19 @@ jobs: if: github.repository == 'go-gitea/gitea' steps: - uses: actions/checkout@v4 - - name: download from crowdin - uses: docker://jonasfranz/crowdin + - uses: crowdin/github-action@v1 + with: + upload_sources: true + upload_translations: false + download_sources: false + download_translations: true + push_translations: false + push_sources: false + create_pull_request: false + config: crowdin.yml env: + CROWDIN_PROJECT_ID: ${{ secrets.CROWDIN_PROJECT_ID }} CROWDIN_KEY: ${{ secrets.CROWDIN_KEY }} - PLUGIN_DOWNLOAD: true - PLUGIN_EXPORT_DIR: options/locale/ - PLUGIN_IGNORE_BRANCH: true - PLUGIN_PROJECT_IDENTIFIER: gitea - name: update locales run: ./build/update-locales.sh - name: push translations to repo @@ -31,19 +38,3 @@ jobs: commit_message: "[skip ci] Updated translations via Crowdin" remote: "git@github.com:go-gitea/gitea.git" ssh_key: ${{ secrets.DEPLOY_KEY }} - crowdin-push: - runs-on: ubuntu-latest - if: github.repository == 'go-gitea/gitea' - steps: - - uses: actions/checkout@v4 - - name: push translations to crowdin - uses: docker://jonasfranz/crowdin - env: - CROWDIN_KEY: ${{ secrets.CROWDIN_KEY }} - PLUGIN_UPLOAD: true - PLUGIN_EXPORT_DIR: options/locale/ - PLUGIN_IGNORE_BRANCH: true - PLUGIN_PROJECT_IDENTIFIER: gitea - PLUGIN_FILES: | - locale_en-US.ini: options/locale/locale_en-US.ini - PLUGIN_BRANCH: main diff --git a/crowdin.yml b/crowdin.yml new file mode 100644 index 0000000000000..35a38d768ca8c --- /dev/null +++ b/crowdin.yml @@ -0,0 +1,12 @@ +project_id_env: CROWDIN_PROJECT_ID +api_token_env: CROWDIN_KEY +base_path: "." +base_url: "https://api.crowdin.com" +preserve_hierarchy: true +files: + - source: "/options/locale/locale_en-US.ini" + translation: "/options/locale/locale_%locale%.ini" + type: "ini" + skip_untranslated_strings: true + export_only_approved: true + update_option: "update_as_unapproved" From 03c9975df113241956e3d774577873c2e9877139 Mon Sep 17 00:00:00 2001 From: Denys Konovalov Date: Sat, 30 Mar 2024 18:37:58 +0100 Subject: [PATCH 2/3] Update .github/workflows/cron-translations.yml Co-authored-by: techknowlogick --- .github/workflows/cron-translations.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/cron-translations.yml b/.github/workflows/cron-translations.yml index 493e003f99e28..b57ad084c0182 100644 --- a/.github/workflows/cron-translations.yml +++ b/.github/workflows/cron-translations.yml @@ -4,7 +4,6 @@ on: schedule: - cron: "7 0 * * *" # every day at 00:07 UTC workflow_dispatch: - push: branches: ["main"] jobs: From 78278de1ac1bc53c2ef6d44ddb2d80d034f274a1 Mon Sep 17 00:00:00 2001 From: techknowlogick Date: Sat, 30 Mar 2024 13:45:37 -0400 Subject: [PATCH 3/3] Update .github/workflows/cron-translations.yml --- .github/workflows/cron-translations.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/cron-translations.yml b/.github/workflows/cron-translations.yml index b57ad084c0182..f1b51debf1223 100644 --- a/.github/workflows/cron-translations.yml +++ b/.github/workflows/cron-translations.yml @@ -4,7 +4,6 @@ on: schedule: - cron: "7 0 * * *" # every day at 00:07 UTC workflow_dispatch: - branches: ["main"] jobs: crowdin-pull: