Skip to content

Update translations from Transifex #21

Update translations from Transifex

Update translations from Transifex #21

name: Update translations from Transifex
on: workflow_dispatch
jobs:
update-translations:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
token: ${{ secrets.PAT_FOR_GITHUB_ACTIONS }}
- name: Install Transifex Client
run: |
curl -o- https://raw.githubusercontent.com/transifex/cli/master/install.sh | bash
source ~/.bashrc
- name: Pull translations from Transifex
run: tx pull --all --force --minimum-perc=25
env:
TX_TOKEN: ${{ secrets.TX_TOKEN }}
- name: Setup PHP with tools
uses: shivammathur/setup-php@v2
with:
php-version: '8.1'
tools: composer, wp-cli/wp-cli-bundle
- name: Generate MO files
run: wp i18n make-mo languages
- name: Create Pull Request for MO files
id: cprtransifex
uses: peter-evans/create-pull-request@v5
with:
token: ${{ secrets.PAT_FOR_GITHUB_ACTIONS }}
commit-message: 'chore(l10n): update languages/*.mo'
labels: automerge-mo
title: 'chore(l10n): update languages/*.mo'
body: 'This pull request updates the MO files for the latest changes in the POT file.'
branch: chore/update-mo-files
- name: Merge pull request with updated MO files
if: ${{ steps.cprtransifex.outputs.pull-request-number }}
uses: "pascalgn/automerge-action@v0.15.6"
env:
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
MERGE_LABELS: automerge-mo
MERGE_METHOD: squash
PULL_REQUEST: "${{ steps.cprtransifex.outputs.pull-request-number }}"