diff --git a/.github/workflows/auto-translate.yml b/.github/workflows/auto-translate.yml new file mode 100644 index 000000000..f29029146 --- /dev/null +++ b/.github/workflows/auto-translate.yml @@ -0,0 +1,28 @@ +name: Check for Updates to Translations + +on: + push: + branches: + - 'trunk' + 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: 'Check and update translations' + permissions: + contents: write + pull-requests: write + uses: newfold-labs/workflows/.github/workflows/reusable-translations.yml@main + with: + text_domain: 'wp-module-onboarding' + pr_branch_name: 'trunk' + secrets: + TRANSLATOR_API_KEY: ${{ secrets.TRANSLATOR_API_KEY }} diff --git a/.github/workflows/i18n-update.yml b/.github/workflows/i18n-update.yml deleted file mode 100644 index 9671cc7bd..000000000 --- a/.github/workflows/i18n-update.yml +++ /dev/null @@ -1,24 +0,0 @@ -name: i18n Update Action - -on: - push: - branches: - - 'trunk' - workflow_dispatch: # Allows manual trigger with a branch input - inputs: - base_branch: - description: 'Base branch for the pull request' - required: false - default: 'trunk' - -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 091123535..8a8f40a71 100644 --- a/composer.json +++ b/composer.json @@ -71,6 +71,14 @@ "@i18n-php", "@i18n-json" ], + "i18n-ci-pre": [ + "@i18n-pot", + "@i18n-po" + ], + "i18n-ci-post": [ + "@i18n-json", + "@i18n-php" + ], "lint": [ "vendor/bin/phpcs . --standard=phpcs.xml" ]