antalotec opened a new pull request, #45974:
URL: https://github.com/apache/superset/pull/45974
### SUMMARY
`superset/translations/do-not-translate.txt` lists msgids that must stay
identical to the
source — icon names, enum and option values, SQL keywords, API field names,
code constants
and example placeholders. Nothing enforces it:
- `apply_do_not_translate.py` stamps an advisory `#. do-not-translate`
comment. A
translation that ignores it is accepted.
- `backfill_po.py` honours the registry for entries it **generates**, so it
never creates a
violation — but entries translated before a term was registered, or by
hand, are
untouched.
The result is that the registry has quietly drifted out of effect. On
current `master`,
**233 entries across 27 of the 29 catalogs translate a registered msgid**,
covering 23 of
the 27 registered terms (only `step-after`, `step-before`, `WMS` and `XYZ`
are respected
everywhere):
| msgid | catalogs translating it | example |
|---|---|---|
| `DELETE` | 24 | `ca` → *ELIMINAR* |
| `OVERWRITE` | 23 | `cs` → *PŘEPSAT* |
| `NOT GROUPED BY` | 22 | `ca` → *NO AGRUPAT PER* |
| `bolt` | 22 | `ca` → *negreta*, `cs` → *šroub* (it is an icon name) |
| `GROUP BY` | 21 | `cs` → *SESKUPIT PODLE* |
| `error_message` | 20 | `ca` → *missatge_error* (an API field name) |
| `TEMPORAL_RANGE` | 18 | `ca` → *RANG_TEMPORAL* |
| `pivoted_xlsx` | 15 | `es` → *Pivotado* (an option value) |
| `deck.gl Geojson`, `EMAIL_REPORTS_CTA`, `crontab`, `dttm`, `ECharts`,
`p1`/`p5`/`p95`/`p99`, `10000`, `sql`, `WFS`, `superset.example.com`,
`schema1,schema2`, `your-project-1234-a1` | 1–11 each | |
This PR empties those `msgstr`s — the same fix #41652 applied to `es`, `fi`
and `th` — so
gettext falls back to the source token, and adds a check so the registry
stops being
advisory.
### What is in the diff
1. **237 entries emptied** across 27 catalogs (233 for the existing
registry, 4 for the new
entry below). Where the entry also carried a stale `#, fuzzy` flag, the
flag goes with
the translation.
2. **`Handlebars` added to the registry**, with its `#. do-not-translate`
marker stamped in
the template and the catalogs. It is the name of the templating library
the chart plugin
uses, and four catalogs translate the everyday sense of the word — the
bicycle part:
`ar` *المقاود*, `tr` *Tutbarlar*, `pl` *Uchwyty*, `fa` *هندلBars*. This
is the one
judgement call in the PR; happy to drop it if you would rather keep the
registry to its
current contents.
3. **`scripts/translations/check_do_not_translate.py`** plus a step in the
`babel-extract`
job. It reports every registered msgid with a non-empty `msgstr` that
differs from the
msgid, and exits non-zero.
### A consequence worth stating
`DELETE` and `OVERWRITE` are the words typed into the delete and overwrite
confirmation
modals. Emptying them means a Spanish user now types `DELETE` rather than
`BORRAR`. That is
what the registry asks for — both strings are compared against user input —
but it is a
visible change, so it should be a deliberate decision rather than a side
effect. We checked
that no catalog is currently *broken* by this: every existing translation is
already
uppercase-stable, so `toUpperCase()` matching works today in all of them.
Follow-up to #45953, which repaired malformed format specifiers in three of
these
catalogs.
### TESTING INSTRUCTIONS
```bash
python scripts/translations/check_do_not_translate.py # passes on
this branch
git stash && python scripts/translations/check_do_not_translate.py # fails
on master, listing all 233
```
Also run locally, all green:
- `msgfmt --check` across the 30 catalogs — 5 fatal errors, **unchanged from
master** (they
come from unrelated defects: one source string whose `msgid` and
`msgid_plural` name
different placeholders, and `msgid "% of"` flagged `#, python-format` in
`de`), so this
introduces none
- `python scripts/translations/check_pot_drift.py` — template matches a
fresh extraction
- `python scripts/translations/check_translation_regression.py --compare
<baseline>` —
*No translation regressions* (counts drop as entries are emptied, which
the check
correctly does not treat as a regression)
- `mypy --check-untyped-defs` on the new script — matches the result of the
existing
`build_translation_index.py` in the same environment
### A small inconsistency noticed, not changed here
The header comment in `do-not-translate.txt` says the marker is
`#. MACHINE_READ-DO_NOT_TRANSLATE`, while `apply_do_not_translate.py` stamps
`#. do-not-translate`. Left alone to keep this diff to one concern.
### ADDITIONAL INFORMATION
- [ ] Has associated issue:
- [ ] Required feature flags:
- [x] Changes UI
- [ ] Includes DB Migration
- [ ] Introduces new feature or API
- [ ] Removes existing feature or API
---
Developed at MYSPHERA, S.L.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
--
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]