From: Christian Hewitt Date: Fri, 3 Oct 2025 10:55:49 +0000 (+0000) Subject: Automate internationalisation template updates for Transifex sync X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=76e5dfff13fd16c4f9ef6899d3147ff5b1ce03ea;p=thirdparty%2Ftvheadend.git Automate internationalisation template updates for Transifex sync Signed-off-by: Christian Hewitt --- diff --git a/.github/workflows/update-intl-templates.yml b/.github/workflows/update-intl-templates.yml new file mode 100644 index 000000000..0addf8433 --- /dev/null +++ b/.github/workflows/update-intl-templates.yml @@ -0,0 +1,81 @@ +name: Update Internationalisation Templates + +on: + schedule: + # Run every Monday at 02:00 UTC + - cron: '0 2 * * 1' + workflow_dispatch: # Allow manual triggering + +jobs: + update-intl: + runs-on: ubuntu-latest + permissions: + contents: write + pull-requests: write + + steps: + - name: Checkout code + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Install dependencies + run: | + sudo apt-get update + sudo apt-get install -y gettext pkg-config build-essential libavahi-client-dev \ + libssl-dev zlib1g-dev wget bzip2 git-core liburiparser-dev python3 \ + python3-requests ca-certificates cmake libpcre2-dev libdvbcsa-dev + + - name: Configure build + run: | + ./configure --disable-ffmpeg_static --disable-libav --disable-hdhomerun_static --disable-pcloud_cache + + - name: Build tvheadend + run: | + make -j$(nproc) + + - name: Generate internationalisation templates + run: | + make intl + + - name: Clean up temporary files + run: | + find . -name "*.pot.new" -delete + + - name: Check for changes + id: check_changes + run: | + # Only add the .pot template files that should be updated + git add intl/tvheadend.pot intl/js/tvheadend.js.pot intl/docs/tvheadend.doc.pot + if git diff --cached --quiet; then + echo "changes=false" >> $GITHUB_OUTPUT + echo "No changes detected in internationalisation templates" + else + echo "changes=true" >> $GITHUB_OUTPUT + echo "Changes detected in internationalisation templates" + echo "Files that will be updated:" + git diff --cached --name-only + fi + + - name: Create Pull Request + if: steps.check_changes.outputs.changes == 'true' + uses: peter-evans/create-pull-request@v5 + with: + token: ${{ secrets.GITHUB_TOKEN }} + commit-message: "Update Internationalisation Templates" + title: "Update Internationalisation Templates" + body: | + This PR updates internationalisation template files to keep them in sync with current source code. + + The following files may have been updated: + + - `intl/tvheadend.pot` - Main application strings + - `intl/js/tvheadend.js.pot` - JavaScript/Web UI strings + - `intl/docs/tvheadend.doc.pot` - Documentation strings + + Generated by the `update-intl-templates` workflow. + branch: automated/update-intl-templates + delete-branch: false + labels: | + AUTOMATED + INTL diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 8795d3309..64a0b6ade 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -26,6 +26,15 @@ Tvheadend welcomes all code contributions. To ensure the process of contributing * Link related forum discussion threads for information * Link GitHub issues using the `Fixes: #1234` format so tickets auto-close on merge +## Translations + +Translations are managed through [Transifex](https://www.transifex.com/tvheadend/tvheadend/) + +* New translatable strings are added in code +* Template `.pot` files in this repo are automatically updated via GitHub Actions +* Template file changes are synced to Transifex where translators update translations +* Completed translations are synced back to this repo via pull requests + ## Documentation If your changes require documentation updates please use GitBooks to author changes and submit a merge-request. The registration link is on our public documenation site: [https://docs.tvheadend.org](https://docs.tvheadend.org).