codeant-ai-for-open-source[bot] commented on code in PR #45584:
URL: https://github.com/apache/superset/pull/45584#discussion_r4343628390


##########
.github/workflows/sync-translation-catalogs.yml:
##########
@@ -0,0 +1,79 @@
+name: Sync Translation Catalogs
+
+# superset/translations/messages.pot is kept in sync with source by
+# check_pot_drift.py on every PR, but individual locale .po catalogs can
+# drift behind it: a PR that adds a translatable string is only required to
+# regenerate messages.pot, not to propagate the new entries into every
+# language file via `pybabel update`. Nothing else catches that gap -
+# check_translation_regression.py only compares relative counts between a
+# base ref and a PR, so pre-existing drift cancels out on both sides. This
+# job runs the catch-up on a schedule and opens a PR when there's drift to
+# commit, instead of letting it silently accumulate between manual passes.
+on:
+  schedule:
+    - cron: "0 6 * * 1" # Mondays at 06:00 UTC
+  workflow_dispatch: {}
+
+permissions:
+  contents: read
+
+concurrency:
+  group: sync-translation-catalogs
+  cancel-in-progress: false
+
+jobs:
+  sync-translation-catalogs:
+    runs-on: ubuntu-26.04
+    permissions:
+      contents: write
+      pull-requests: write
+    steps:
+      - name: "Checkout master"
+        uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # 
v7.0.1
+        with:
+          ref: master
+          persist-credentials: true
+
+      - name: Setup Python
+        uses: $/.github/actions/setup-backend/
+
+      - name: Install gettext tools
+        uses: 
awalsh128/cache-apt-pkgs-action@553a35bb8ebd9fcabcb1c9451aa4c98e1b4ca8a9 # 
v1.6.3
+        with:
+          packages: gettext
+          version: 1.0
+
+      - name: Run babel_update
+        run: ./scripts/translations/babel_update.sh
+
+      - name: Check for drift
+        id: diff
+        run: |
+          if git diff --quiet -- superset/translations; then
+            echo "has_changes=false" >> "$GITHUB_OUTPUT"
+          else
+            echo "has_changes=true" >> "$GITHUB_OUTPUT"
+          fi
+
+      - name: Open or update sync PR
+        if: steps.diff.outputs.has_changes == 'true'
+        env:
+          GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+          BRANCH: chore/sync-translation-catalogs-automated
+        run: |
+          git config user.name "GitHub Action"
+          git config user.email "[email protected]"
+          git checkout -b "$BRANCH"
+          git add superset/translations
+          git commit -m "chore(i18n): sync translation catalogs with 
messages.pot" \
+            -m "Automated catch-up: propagates pending messages.pot entries 
into every locale catalog via babel_update.sh. All new entries land 
untranslated (--no-fuzzy-matching); no existing translation is touched."
+          git push --force origin "$BRANCH"

Review Comment:
   ✅ **Customized review instruction saved!**
   
   **Instruction:**
   > Do not flag force-pushing the bot branch in this workflow; it is fully 
regenerated from master, and manual edits belong in master or a separate PR.
   
   **Applied to:**
     - `.github/workflows/sync-translation-catalogs.yml`
   
   ---
   💡 *To manage or update this instruction, visit: [CodeAnt AI 
Settings](https://app.codeant.ai/org/settings/learnings)*



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to