GitHub user glaterza added a comment to the discussion: Proposal: a translation 
guide, with shared principles and per-language conventions

Thanks — I'll open it.

First, something I found on the way there. The `--add-comments` change edits 
`babel_update.sh`, so I ran the script to confirm the comments come through. 
They do. The script's normalization step does not.

The line is:

```bash
msgcat --sort-by-msgid --no-wrap --no-location 
superset/translations/messages.pot -o superset/translations/messages.pot
```

`msgcat` has no `--sort-by-msgid` option; its sort flag is `-s/--sort-output`. 
It prints `unrecognized option '--sort-by-msgid'` and exits 1. I checked 
gettext **0.23.2**, which CI installs on `ubuntu-26.04`, and **1.0**. Both 
reject it. `babel_update.sh` has no `set -e`, so the script continues and exits 
0. The step has not run since it was added in #29782.

The scope is limited. `pybabel extract` two lines above already passes 
`--no-location` and `--sort-output`, so `msgcat`'s only remaining contribution 
is `--no-wrap`. The effect is that `messages.pot` is not unwrapped: **473** of 
its entries carry their text on continuation lines, against **38** after 
normalization.

The fix is one line — `--sort-output` plus `|| exit 1` — and a comment.

## The question is what to do with the backlog

Running the repaired `msgcat` over the current template produces a **2209-line 
diff** (527 insertions, 1682 deletions). That diff is the `msgcat` step applied 
to the template as committed, not a regeneration. I parsed both versions with 
Babel and compared — **5117 messages before, 5117 after, same set, no extracted 
comment or flag changed**. Only wrapping and order move. No `msgid` changes, so 
no translation is invalidated.

Three options:

1. **Fix it and take the reformat now.** Separate commit, so the one-line fix 
reads on its own and the rest is tool output.
2. **Fix it and leave the reformat.** The PR stays one line. The 2209 lines 
then land on whoever next runs `babel_update.sh`, inside a PR about something 
else.
3. **Delete the line.** If an unwrapped `.pot` isn't wanted, dropping a step 
that has never run is the alternative.

I'd pick 1, but 3 is reasonable and I'd rather you choose.

## Separate finding, possibly its own issue

I extracted from current `master` and compared against the committed template:

| | count |
|---|---|
| committed `messages.pot` | 5117 |
| fresh `pybabel extract` from source | 5424 |
| in source, **not** in the template | **416** |
| in the template, no longer in source | 109 |

Both figures exclude whitespace-only variants. Those 416 strings have not 
reached any of the 30 catalogs, so they cannot be translated in any language. 
Examples: `% of column total`, `%s chart updated`, `%s MCP scopes`.

This is independent of the `msgcat` bug. `superset-translations.yml` runs 
`babel_update.sh` against base and PR and compares translated/fuzzy counts in 
the `.po` catalogs; it does not compare the committed template against a fresh 
extract, and the regression step is `continue-on-error: true`.

I can open a separate issue with the full lists if that's useful.


GitHub link: 
https://github.com/apache/superset/discussions/43562#discussioncomment-18458448

----
This is an automatically sent email for [email protected].
To unsubscribe, please send an email to: 
[email protected]


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

Reply via email to