Skip to content

Update translations #2077

Update translations

Update translations #2077

Workflow file for this run

name: "Update translations"
on:
workflow_dispatch:
schedule:
- cron: "0 3 * * *"
permissions: {}
jobs:
update-translations:
permissions:
contents: read
strategy:
matrix:
# current transifex plan only allows 1 additional branch
branch: ['master', '6']
runs-on: ubuntu-latest
env:
TX_TOKEN: ${{ secrets.TX_TOKEN }}
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
submodules: recursive
fetch-depth: 0
ref: ${{ matrix.branch }}
persist-credentials: false
- name: install-deps
run: sudo apt install -y qt6-l10n-tools
- name: l10n-remove-old
run: |
rm translations/*.ts
git checkout translations/client_en.ts
- name: l10n-read
run: /usr/lib/qt6/bin/lupdate src -no-obsolete -ts translations/client_en.ts
- name: l10n-push-source
if: ${{ matrix.branch != 'master' }}
uses: transifex/cli-action@584fd205cbe598773b5a81ce711fa44842678189 # v2
with:
token: ${{ secrets.TX_TOKEN }}
args: push -s --branch "${{ matrix.branch }}"
- name: l10n-push-source
if: ${{ matrix.branch == 'master' }}
uses: transifex/cli-action@584fd205cbe598773b5a81ce711fa44842678189 # v2
with:
token: ${{ secrets.TX_TOKEN }}
args: push -s
- name: fix-transifex-action
run: rm -rf /tmp/tx
- name: l10n-pull
if: ${{ matrix.branch != 'master' }}
uses: transifex/cli-action@584fd205cbe598773b5a81ce711fa44842678189 # v2
with:
token: ${{ secrets.TX_TOKEN }}
args: pull --force --all --silent --branch "${{ matrix.branch }}"
- name: l10n-pull
if: ${{ matrix.branch == 'master' }}
uses: transifex/cli-action@584fd205cbe598773b5a81ce711fa44842678189 # v2
with:
token: ${{ secrets.TX_TOKEN }}
args: pull --force --all --silent
- name: Generate GitHub App token
id: app-token
uses: actions/create-github-app-token@bcd2ba49218906704ab6c1aa796996da409d3eb1 # v3.2.0
with:
app-id: ${{ secrets.TRANSLATION_APP_ID }}
private-key: ${{ secrets.TRANSLATION_APP_PRIVATE_KEY }}
- name: Create or update translations PR
uses: peter-evans/create-pull-request@5f6978faf089d4d20b00c7766989d076bb2fc7f1 # v8.1.1
with:
token: ${{ steps.app-token.outputs.token }}
branch: chore/translations-update-${{ matrix.branch }}
base: ${{ matrix.branch }}
commit-message: "chore: update translations from transifex"
title: "chore: update translations from transifex"
body: "Automated translation update from Transifex. This pull request is updated on each sync run — merging it will close it and a fresh one will be opened on the next change."
delete-branch: true
sign-commits: true