From b4e5ca800eddb7da26c0ed2b3919b6fb1b4b309d Mon Sep 17 00:00:00 2001 From: Sihu Hwang <129564966+hwangsihu@users.noreply.github.com> Date: Sun, 22 Feb 2026 14:03:42 +0900 Subject: [PATCH] Add Qt translation auto-update workflow This workflow works on an ArchLinux container to quickly install the latest version of Qt. --- .github/workflows/update-translations.yml | 45 +++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 .github/workflows/update-translations.yml diff --git a/.github/workflows/update-translations.yml b/.github/workflows/update-translations.yml new file mode 100644 index 0000000000..40a9e9bf07 --- /dev/null +++ b/.github/workflows/update-translations.yml @@ -0,0 +1,45 @@ +name: Update Translations + +on: + push: + branches: [ "master" ] + paths: + - 'Client/qtTeamTalk/**.cpp' + - 'Client/qtTeamTalk/**.h' + - 'Client/qtTeamTalk/**.ui' + workflow_dispatch: + +jobs: + update-translations: + runs-on: ubuntu-latest + container: archlinux:latest + + permissions: + contents: write + + steps: + - name: Install packages + run: pacman -Syu --noconfirm git qt6-declarative qt6-tools + + - name: Checkout + uses: actions/checkout@v6 + + - name: Mark workspace as safe directory + run: git config --global --add safe.directory '*' + + - name: Update translation files + id: lupdate + working-directory: ${{github.workspace}} + run: | + lupdate6 Client/qtTeamTalk -ts Client/qtTeamTalk/languages/*.ts -no-obsolete + echo "changed=$(git diff --quiet Client/qtTeamTalk/languages/ && echo false || echo true)" >> "$GITHUB_OUTPUT" + + - name: Commit updated translations + if: steps.lupdate.outputs.changed == 'true' + working-directory: ${{github.workspace}} + run: | + git config --global user.name "github-actions[bot]" + git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com" + git add Client/qtTeamTalk/languages/*.ts + git commit -m "Update translation files" + git push