diff --git a/.github/workflows/auto-translate.yml b/.github/workflows/auto-translate.yml new file mode 100644 index 0000000..129c27f --- /dev/null +++ b/.github/workflows/auto-translate.yml @@ -0,0 +1,27 @@ +name: Check for Updates to Translations + +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: '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-deactivation' + 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 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",