rusackas opened a new pull request, #41651:
URL: https://github.com/apache/superset/pull/41651
### SUMMARY
Follow-up hardening to `scripts/translations/backfill_po.py`. The backfill
only checked for an empty `msgstr`, so it filled entries a human translator had
**deliberately left blank** — the `ru` catalog carries 21 `# Не переводить`
("do not translate") markers on literal tokens, and the backfill translated
them anyway. CodeAnt flagged several on #41649.
These strings must stay identical to the source or they break things / are
meaningless to translate:
- **`bolt`** — an icon name (`ControlHeader.tsx` → `label={t('bolt')}`
renders the ⚡ icon); a translated value breaks the icon lookup.
- **`step-after` / `step-before`** — d3 line-interpolation enum values.
- **`error_message`** — an API field name.
- **`TEMPORAL_RANGE`, `EMAIL_REPORTS_CTA`** — code constants; SQL keywords
(`GROUP BY`, `DELETE`, …); formats/proper nouns (`WFS`, `WMS`, `XYZ`,
`ECharts`, `crontab`, `sql`); example placeholders (`superset.example.com`,
`your-project-1234-a1`, `schema1,schema2`, `10000`).
**Change:** `_is_do_not_translate(entry)` is consulted when collecting
untranslated entries. An entry is skipped if its msgid is in a curated
`DO_NOT_TRANSLATE` set (seeded from the `ru` translator's markers — these
tokens are language-independent, so the set applies to every catalog) **or** if
it carries an explicit do-not-translate translator comment in any catalog
(honoring a human's decision, e.g. `# Не переводить`). Skipped entries are
reported and left untranslated so they fall back to the source token.
The per-language backfill PRs are being updated to revert these tokens, and
the already-merged de/lv/fi catalogs get a follow-up.
### BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
N/A — internal tooling.
### TESTING INSTRUCTIONS
```bash
pytest tests/unit_tests/scripts/translations/backfill_po_test.py
```
(34 tests pass — adds curated-set, translator-comment, and pass-through
cases.)
### ADDITIONAL INFORMATION
- [ ] Has associated issue:
- [x] Required feature flags:
- [ ] Changes UI
- [ ] Includes DB Migration (follow approval process in
[SIP-59](https://github.com/apache/superset/issues/13351))
- [ ] 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]