]> git.ipfire.org Git - thirdparty/tvheadend.git/commitdiff
Automate internationalisation template updates for Transifex sync copilot/fix-1934 1935/head
authorChristian Hewitt <christianshewitt@gmail.com>
Fri, 3 Oct 2025 10:55:49 +0000 (10:55 +0000)
committerFlole <Flole998@users.noreply.github.com>
Sat, 4 Oct 2025 07:32:26 +0000 (09:32 +0200)
Signed-off-by: Christian Hewitt <christianshewitt@gmail.com>
.github/workflows/update-intl-templates.yml [new file with mode: 0644]
CONTRIBUTING.md

diff --git a/.github/workflows/update-intl-templates.yml b/.github/workflows/update-intl-templates.yml
new file mode 100644 (file)
index 0000000..0addf84
--- /dev/null
@@ -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
index 8795d3309863c170aedb66b01b040e1820566d77..64a0b6ade3610ed2ecc6448a3b8f710be17e50b5 100644 (file)
@@ -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).