sadpandajoe commented on code in PR #44395:
URL: https://github.com/apache/superset/pull/44395#discussion_r4045586695


##########
scripts/translations/babel_update.sh:
##########
@@ -49,8 +49,14 @@ pybabel extract \
   --project=Superset \
   -k _ -k __ -k t -k tn:1,2 -k tct .
 
-# Normalize .pot file
-msgcat --sort-by-msgid --no-wrap --no-location 
superset/translations/messages.pot -o superset/translations/messages.pot
+# Normalize the .pot: sort by msgid, keep each message on one line, drop source
+# locations. msgcat's sort flag is `--sort-output`; the `--sort-by-msgid`
+# spelling used here before is not a msgcat option, and gettext rejects the 
call
+# with `unrecognized option` (verified on 0.23.2 and 1.0). With no `set -e` in
+# this script that failure was non-fatal, so the step never ran and the 
template
+# was published unnormalized. `|| exit 1` makes a failed normalization stop the
+# script instead.
+msgcat --sort-output --no-wrap --no-location 
superset/translations/messages.pot -o superset/translations/messages.pot || 
exit 1

Review Comment:
   The translation-regression check only compares `.po` translation counts, so 
it would miss losing `--no-wrap` again or continuing into `pybabel update` 
after a normalization failure. Could we add a focused regression test that 
checks sorted, unwrapped, location-free output on a small fixture and injects a 
failing `msgcat` to assert a nonzero exit before `pybabel update` runs?



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