From 51800819c10ea1359bc0aa782d1aea3b3a5527c8 Mon Sep 17 00:00:00 2001 From: Narrat Date: Mon, 27 Jan 2025 20:15:36 +0100 Subject: [PATCH] add Github action for syncing translation files --- .github/workflows/sync_pot.yaml | 29 +++++++++++++++++++++++++++++ extras/translations/sync_pot_po.sh | 9 +++++++++ 2 files changed, 38 insertions(+) create mode 100644 .github/workflows/sync_pot.yaml create mode 100755 extras/translations/sync_pot_po.sh diff --git a/.github/workflows/sync_pot.yaml b/.github/workflows/sync_pot.yaml new file mode 100644 index 00000000..f275e5d9 --- /dev/null +++ b/.github/workflows/sync_pot.yaml @@ -0,0 +1,29 @@ +name: Translations - sync translation files with tomb script + +on: + push: + branches: master + paths: + - 'tomb' + +jobs: + Translations: + runs-on: ubuntu-latest + steps: + - name: Checkout repo + uses: actions/checkout@v3 + - name: Install deps + run: | + sudo apt-get update -y -q + sudo apt-get install -y -q gettext + - name: Run sync script + run: | + cd extras/translations/ + ./sync_pot_po.sh + - name: Create PR + uses: peter-evans/create-pull-request@v5 + with: + commit-message: sync translation files + title: '[Chore] sync translation files' + body: > + This PR is auto-generated diff --git a/extras/translations/sync_pot_po.sh b/extras/translations/sync_pot_po.sh new file mode 100755 index 00000000..43841841 --- /dev/null +++ b/extras/translations/sync_pot_po.sh @@ -0,0 +1,9 @@ +#! /usr/bin/sh +# (create a new pot template from the current tomb script via script) +# use the pot file as reference to update all the po files + +perl generate_translatable_strings.pl > tomb.pot + +for po in ./*.po; do + msgmerge --update ${po} tomb.pot +done