From 4cbce2f60d0640e151e01d518523384ed61ca001 Mon Sep 17 00:00:00 2001 From: Vara Date: Mon, 23 Jun 2025 14:42:31 +0530 Subject: [PATCH 1/3] Add auto translate trigger workflow --- .github/workflows/auto-translate.yml | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 .github/workflows/auto-translate.yml diff --git a/.github/workflows/auto-translate.yml b/.github/workflows/auto-translate.yml new file mode 100644 index 0000000..249fc69 --- /dev/null +++ b/.github/workflows/auto-translate.yml @@ -0,0 +1,28 @@ +name: Auto Translate + +on: + push: + branches: + - 'main' + workflow_dispatch: + +# Cancels all previous workflow runs for the branch that have not completed. +concurrency: + # The concurrency group contains the workflow name and the branch name. + group: ${{ github.workflow }}-${{ github.ref_name }} + cancel-in-progress: true + +permissions: {} + +jobs: + translate: + name: 'Trigger Auto-Translate Workflow' + permissions: + contents: write + pull-requests: write + uses: newfold-labs/workflows/.github/workflows/auto-translate.yml@main + with: + text_domain: 'wp-module-deactivation' + secrets: + TRANSLATOR_API_KEY: ${{ secrets.TRANSLATOR_API_KEY }} + NEWFOLD_ACCESS_TOKEN: ${{ secrets.NEWFOLD_ACCESS_TOKEN }} From 1c960abeb8105bccbde4b55d9e5ed8d024284b15 Mon Sep 17 00:00:00 2001 From: Vara Date: Tue, 24 Jun 2025 12:46:23 +0530 Subject: [PATCH 2/3] Update the labels --- .github/workflows/auto-translate.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/auto-translate.yml b/.github/workflows/auto-translate.yml index 249fc69..60673b9 100644 --- a/.github/workflows/auto-translate.yml +++ b/.github/workflows/auto-translate.yml @@ -1,4 +1,4 @@ -name: Auto Translate +name: Check for Updates to Translations on: push: @@ -16,11 +16,11 @@ permissions: {} jobs: translate: - name: 'Trigger Auto-Translate Workflow' + name: 'Check and update translations' permissions: contents: write pull-requests: write - uses: newfold-labs/workflows/.github/workflows/auto-translate.yml@main + uses: newfold-labs/workflows/.github/workflows/reusable-azure-ai-translate.yml@main with: text_domain: 'wp-module-deactivation' secrets: From 8c8087a5b6c0b30b53d68983483fed4f909c064f Mon Sep 17 00:00:00 2001 From: Vara Date: Wed, 2 Jul 2025 17:57:25 +0530 Subject: [PATCH 3/3] Adjust new translation workflow --- .github/workflows/auto-translate.yml | 3 +-- .github/workflows/i18n-update.yml | 24 ------------------------ composer.json | 8 ++++++++ 3 files changed, 9 insertions(+), 26 deletions(-) delete mode 100644 .github/workflows/i18n-update.yml diff --git a/.github/workflows/auto-translate.yml b/.github/workflows/auto-translate.yml index 60673b9..129c27f 100644 --- a/.github/workflows/auto-translate.yml +++ b/.github/workflows/auto-translate.yml @@ -20,9 +20,8 @@ jobs: permissions: contents: write pull-requests: write - uses: newfold-labs/workflows/.github/workflows/reusable-azure-ai-translate.yml@main + uses: newfold-labs/workflows/.github/workflows/reusable-translations.yml@main with: text_domain: 'wp-module-deactivation' secrets: TRANSLATOR_API_KEY: ${{ secrets.TRANSLATOR_API_KEY }} - NEWFOLD_ACCESS_TOKEN: ${{ secrets.NEWFOLD_ACCESS_TOKEN }} diff --git a/.github/workflows/i18n-update.yml b/.github/workflows/i18n-update.yml deleted file mode 100644 index 2336655..0000000 --- a/.github/workflows/i18n-update.yml +++ /dev/null @@ -1,24 +0,0 @@ -name: i18n Update Action - -on: - push: - branches: - - 'main' - workflow_dispatch: # Allows manual trigger with a branch input - inputs: - base_branch: - description: 'Base branch for the pull request' - required: false - default: 'main' - -permissions: - contents: write - pull-requests: write - -jobs: - call-i18n-update: - uses: newfold-labs/workflows/.github/workflows/i18n-update.yml@main - with: - base_branch: ${{ inputs.base_branch || github.ref_name }} - secrets: - NEWFOLD_ACCESS_TOKEN: ${{ secrets.NEWFOLD_ACCESS_TOKEN }} diff --git a/composer.json b/composer.json index a09a374..d912da8 100644 --- a/composer.json +++ b/composer.json @@ -68,6 +68,14 @@ "@i18n-php", "@i18n-json" ], + "i18n-ci-pre": [ + "@i18n-pot", + "@i18n-po" + ], + "i18n-ci-post": [ + "@i18n-json", + "@i18n-php" + ], "i18n-json": "rm -f languages/*.json && vendor/bin/wp i18n make-json ./languages --no-purge --pretty-print", "i18n-mo": "vendor/bin/wp i18n make-mo ./languages", "i18n-php": "vendor/bin/wp i18n make-php ./languages",