glaterza opened a new pull request, #44395:
URL: https://github.com/apache/superset/pull/44395

   ### SUMMARY
   
   `scripts/translations/babel_update.sh` normalizes `messages.pot` with
   `msgcat --sort-by-msgid`. That is not a msgcat option — the sort flag is 
`-s/--sort-output` —
   so gettext rejects the call with `unrecognized option '--sort-by-msgid'` and 
exits 1. I verified
   this on gettext **0.23.2**, the version CI installs on `ubuntu-26.04`, and 
on **1.0**.
   
   The script sets no `set -e`, so the failure is non-fatal: `babel_update.sh` 
continues and exits 0.
   The step has not run since it was introduced in #29782.
   
   `pybabel extract` above already passes `--no-location` and `--sort-output`, 
so the only
   normalization lost is `--no-wrap`. `messages.pot` carries **473** entries 
whose text sits on
   continuation lines; the repaired step leaves **38**.
   
   This PR uses msgcat's actual sort flag and adds `|| exit 1`, so a 
normalization that cannot run
   stops the script instead of publishing an unnormalized template.
   
   **The second commit** is the mechanical output of the repaired step applied 
to the template as
   committed — not a regeneration, so no extraction runs and no message is 
added or removed. Both
   versions were parsed with Babel and compared:
   
   | | value |
   |---|---|
   | messages before | 5117 |
   | messages after | 5117 |
   | msgid set | identical |
   | entries with changed extracted comments or flags | 0 |
   | `do-not-translate` markers | 27 before, 27 after |
   | `msgfmt --check-format` | passes |
   
   Only line wrapping and sort order differ. No `msgid` changes, so no existing 
translation is
   invalidated.
   
   It is committed here so the fix does not land that diff on whoever next runs 
`babel_update.sh` in
   an unrelated PR.
   
   This is the shape agreed in
   [discussion 
#43562](https://github.com/apache/superset/discussions/43562#discussioncomment-18471467):
   repair the flag, and keep the reformat as its own commit so it reads as tool 
output rather than as
   part of the change.
   
   ### BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
   
   Not applicable — build-script and translation-template change, no UI.
   
   ### TESTING INSTRUCTIONS
   
   ```bash
   # 1. The old flag is rejected by any released gettext:
   msgcat --sort-by-msgid --no-wrap superset/translations/messages.pot -o 
/dev/null; echo $?   # 1
   
   # 2. The repaired step runs, and is idempotent — a second run changes 
nothing:
   ./scripts/translations/babel_update.sh
   ./scripts/translations/babel_update.sh
   git diff --stat superset/translations/messages.pot   # stable between runs
   #
   # Note: the FIRST run also re-extracts from source, which pulls in 
pre-existing
   # template drift — 428 strings present in source but missing from the 
committed
   # template, measured at 35768da1fd. That drift is not from this PR and is 
tracked
   # separately; compare run 2 against run 1, not against HEAD.
   
   # 3. The template is still valid gettext:
   msgfmt --check-format -o /dev/null superset/translations/messages.pot; echo 
$?              # 0
   ```
   
   ### ADDITIONAL INFORMATION
   - [ ] Has associated issue:
   - [ ] Required feature flags:
   - [ ] Changes UI
   - [ ] Includes DB Migration (follow approval process in 
[SIP-59](https://github.com/apache/superset/issues/13351))
     - [ ] Migration is atomic, supports rollback & is backwards-compatible
     - [ ] Confirm DB migration upgrade and downgrade tested
     - [ ] Runtime estimates and downtime expectations provided
   - [ ] Introduces new feature or API
   - [ ] Removes existing feature or API
   


-- 
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