diff --git a/.github/workflows/cron_update_base_translation.yml b/.github/workflows/cron_update_base_translation.yml new file mode 100644 index 0000000000..32c6767ede --- /dev/null +++ b/.github/workflows/cron_update_base_translation.yml @@ -0,0 +1,28 @@ +name: 🌎 Update Base Translation + +on: + schedule: + - cron: "0 0 * * *" # Every day at 12am UTC. + workflow_dispatch: # As well as manually. + +jobs: + update: + if: github.repository == 'PCSX2/pcsx2' + name: "Update Base Translation" + runs-on: ubuntu-22.04 + steps: + - uses: actions/checkout@v3 + + - name: Update Base Translation + run: ./.github/workflows/scripts/common/update_base_translation.sh + + - name: Create Pull Request + uses: peter-evans/create-pull-request@v5 + with: + title: "Qt: Update Base Translation" + commit-message: "PAD: Update Base Translation" + committer: "PCSX2 Bot " + author: "PCSX2 Bot " + body: "Daily update of base translation sources." + branch: update-base-translation + delete-branch: true diff --git a/.github/workflows/scripts/common/update_base_translation.sh b/.github/workflows/scripts/common/update_base_translation.sh new file mode 100755 index 0000000000..71f8f8eb44 --- /dev/null +++ b/.github/workflows/scripts/common/update_base_translation.sh @@ -0,0 +1,12 @@ +#!/bin/bash + +SCRIPTDIR=$(dirname "${BASH_SOURCE[0]}") +source "$SCRIPTDIR/../linux/functions.sh" + +set -e + +# While we use custom Qt builds for our releases, the Qt6 package will be good enough +# for just updating translations. Saves building it for this action alone. +retry_command sudo apt-get -y install qt6-l10n-tools + +PATH=/usr/lib/qt6/bin:$PATH "$SCRIPTDIR/../../../../pcsx2-qt/Translations/update_en_translation.sh" diff --git a/pcsx2-qt/Translations/update_en_translation.sh b/pcsx2-qt/Translations/update_en_translation.sh new file mode 100755 index 0000000000..a425b9bed4 --- /dev/null +++ b/pcsx2-qt/Translations/update_en_translation.sh @@ -0,0 +1,9 @@ +#!/bin/bash + +SCRIPTDIR=$(dirname "${BASH_SOURCE[0]}") + +OPTS="-tr-function-alias QT_TRANSLATE_NOOP+=TRANSLATE,QT_TRANSLATE_NOOP+=TRANSLATE_SV,QT_TRANSLATE_NOOP+=TRANSLATE_STR,QT_TRANSLATE_N_NOOP3+=TRANSLATE_FMT,QT_TRANSLATE_NOOP+=TRANSLATE_NOOP" +SRCDIRS=$(realpath "$SCRIPTDIR/..")/\ $(realpath "$SCRIPTDIR/../../pcsx2")/ +OUTDIR=$(realpath "$SCRIPTDIR") + +lupdate $SRCDIRS $OPTS -no-obsolete -source-language en -ts "$OUTDIR/pcsx2-qt_en.ts"