|
|
|
name: Update translations from Transifex
|
|
|
|
|
|
|
|
on: workflow_dispatch
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
update-translations:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v3
|
|
|
|
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.0'
|
|
|
|
tools: composer, wp-cli/wp-cli-bundle
|
|
|
|
- name: Generate MO files
|
|
|
|
run: wp i18n make-mo languages
|
|
|
|
- name: Commit updated translation files
|
|
|
|
uses: stefanzweifel/git-auto-commit-action@v4.16.0
|
|
|
|
with:
|
|
|
|
commit_message: 'chore(l10n): update translations'
|
|
|
|
file_pattern: '*.mo'
|