Repository navigation
fix(i18n): enforce the do-not-translate registry across the catalogs - #45974
Merged
Merged
Conversation
do-not-translate.txt lists msgids that must stay identical to the source, but nothing rejects a catalog that translates one: apply_do_not_translate.py only stamps an advisory comment, and backfill_po.py honours the registry only for entries it generates. 233 entries across 27 catalogs translate a registered msgid, among them icon names, API field names and SQL keywords. Empty those msgstrs so gettext falls back to the source token, add Handlebars to the registry (four catalogs translate the bicycle part), and add a check plus a CI step so the registry stops being advisory. Co-Authored-By: Claude Opus 5 <[email protected]>
antalotec
requested review from
betodealmeida,
dpgaspar,
eschutho,
geido,
hainenber,
kgabryje,
mistercrunch,
nytai,
rusackas,
sadpandajoe,
sha174n and
villebro
as code owners
November 3, 2026 09:46
The gate had no test, so a later edit could quietly stop it protecting anything: with no violation left in the catalogs it would still pass CI. Pin the one comparison it turns on — a registered msgid is clean only when its msgstr is exactly empty — and cover the cases that comparison decides: " DELETE ", " " and a real translation are reported; "", an identical msgstr, an obsolete entry and an unregistered msgid are not. main() exits 1 and names the offender, or returns cleanly, and the en catalog is skipped. Co-Authored-By: Claude Opus 5 <[email protected]>
✅ Deploy Preview for superset-docs-preview ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
1 of 6 tasks
hainenber
reviewed
Nov 4, 2026
polib is a hard requirement of the script, so let a missing install fail with the interpreter's own ImportError instead of wrapping it. Co-Authored-By: Claude Opus 5.5 <[email protected]>
rusackas
approved these changes
Nov 20, 2026
rusackas
left a comment
Member
There was a problem hiding this comment.
Thanks @antalotec, LGTM! Nice to see the registry actually enforced rather than just advisory. Adding Handlebars seems right to me too, since it's the library name and not the bicycle part :)
Contributor
|
LGTM but needs to resolve the current merge conflict |
Resolve messages.pot by keeping both sides: master's new Druid HTTPS msgid and this branch's do-not-translate comment on Handlebars. Co-Authored-By: Evan Rusackas <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]>
jprinet
added a commit
to jprinet/superset
that referenced
this pull request
Nov 23, 2026
* origin/master: (393 commits) fix(a11y): name the semantic view description input (apache#46458) docs(semantic): explain datasource list modification eligibility (apache#46462) docs(semantic-layer): document NULL-preserving exclusion filters (apache#46447) fix(uploads): skip folder and system entries in columnar ZIP uploads (apache#45617) fix(i18n-es): promote 47 of the zero-context backfill entries (apache#45847) fix(mcp): return structured ChartError on SQLAlchemyError in get_chart_sql (apache#44351) fix(datasets): follow semantic view modification permissions (apache#46448) fix(docker): account for container memory limits in frontend-mem-nag.sh (apache#46373) fix(reports): carry the report's native filters in the email and Slack link (apache#46062) fix(explore): apply the dataset timezone to grained temporal filter values (apache#46175) fix(i18n): enforce the do-not-translate registry across the catalogs (apache#45974) chore(logging): log unparseable virtual dataset SQL at debug in the RLS lookup (apache#46139) fix(i18n): split parameter-suggestion plural into two messages (apache#46049) test(partition-mapping): cover Hive/Impala mirrored SQL, cache outage and migration (apache#46319) perf(dashboard): look up the dashboard once per filter_state read (apache#46314) fix(i18n): load the dayjs locale for every language with a catalog (apache#45982) test(semantic-layer): make date export parametrization deterministic (apache#46449) fix(oauth2): idempotent OAuth2 completion and resilient listener (apache#40292) fix(explore): prevent full table scan when SQL expression is used as x-axis (apache#41339) feat(mcp): radar chart type plugin (apache#43571) ... # Conflicts: # .github/workflows/docker.yml # .github/workflows/superset-frontend.yml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
SUMMARY
superset/translations/do-not-translate.txtlists msgids that must stay identical to thesource — icon names, enum and option values, SQL keywords, API field names, code constants
and example placeholders. Nothing enforces it:
apply_do_not_translate.pystamps an advisory#. do-not-translatecomment. Atranslation that ignores it is accepted.
backfill_po.pyhonours the registry for entries it generates, so it never creates aviolation — 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,WMSandXYZare respectedeverywhere):
DELETEca→ ELIMINAROVERWRITEcs→ PŘEPSATNOT GROUPED BYca→ NO AGRUPAT PERboltca→ negreta,cs→ šroub (it is an icon name)GROUP BYcs→ SESKUPIT PODLEerror_messageca→ missatge_error (an API field name)TEMPORAL_RANGEca→ RANG_TEMPORALpivoted_xlsxes→ 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-a1This PR empties those
msgstrs — the same fix #41652 applied toes,fiandth— sogettext falls back to the source token, and adds a check so the registry stops being
advisory.
What is in the diff
entry below). Where the entry also carried a stale
#, fuzzyflag, the flag goes withthe translation.
Handlebarsadded to the registry, with its#. do-not-translatemarker stamped inthe 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المقاود,trTutbarlar,plUchwyty,faهندلBars. This is the onejudgement call in the PR; happy to drop it if you would rather keep the registry to its
current contents.
scripts/translations/check_do_not_translate.pyplus a step in thebabel-extractjob. It reports every registered msgid with a non-empty
msgstrthat differs from themsgid, and exits non-zero.
A consequence worth stating
DELETEandOVERWRITEare the words typed into the delete and overwrite confirmationmodals. Emptying them means a Spanish user now types
DELETErather thanBORRAR. That iswhat 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
Also run locally, all green:
msgfmt --checkacross the 30 catalogs — 5 fatal errors, unchanged from master (theycome from unrelated defects: one source string whose
msgidandmsgid_pluralnamedifferent placeholders, and
msgid "% of"flagged#, python-formatinde), so thisintroduces none
python scripts/translations/check_pot_drift.py— template matches a fresh extractionpython 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-defson the new script — matches the result of the existingbuild_translation_index.pyin the same environmentA small inconsistency noticed, not changed here
The header comment in
do-not-translate.txtsays the marker is#. MACHINE_READ-DO_NOT_TRANSLATE, whileapply_do_not_translate.pystamps#. do-not-translate. Left alone to keep this diff to one concern.ADDITIONAL INFORMATION
Developed at MYSPHERA, S.L.
🤖 Generated with Claude Code