Repository navigation
feat(i18n): do-not-translate registry + '#. do-not-translate' marker standard - #41651
Conversation
The backfill only checked for an empty msgstr, so it filled entries a human translator had deliberately left blank — e.g. the ru catalog's "# Не переводить" (do-not-translate) markers on literal tokens. This translated strings that must stay identical to the source: icon names (`bolt` -> the ⚡ Explore control icon), d3 enum values (`step-after`/`step-before`), API field names (`error_message`), SQL keywords, code constants, and example placeholders. Add `_is_do_not_translate`, consulted when collecting untranslated entries. An entry is skipped if its msgid is in the curated `DO_NOT_TRANSLATE` set (seeded from the ru translator's markers; language-independent) or if it carries an explicit do-not-translate translator comment in any catalog. Skipped entries are reported and left untranslated (source-token fallback). Adds unit tests for the curated set, translator-comment honoring (incl. the Cyrillic marker), and the normal-entry pass-through. Co-Authored-By: Claude Opus 4.8 <[email protected]>
✅ Deploy Preview for superset-docs-preview ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
There was a problem hiding this comment.
Code Review Agent Run #502ef6
Actionable Suggestions - 1
-
scripts/translations/backfill_po.py - 1
- Missing integration test for DNT filtering · Line 704-706
Review Details
-
Files reviewed - 2 · Commit Range:
fb8af9c..fb8af9c- scripts/translations/backfill_po.py
- tests/unit_tests/scripts/translations/backfill_po_test.py
-
Files skipped - 1
- docs/developer_docs/contributing/howtos.md - Reason: Filter setting
-
Tools
- MyPy (Static Code Analysis) - ✔︎ Successful
- Astral Ruff (Static Code Analysis) - ✔︎ Successful
- Whispers (Secret Scanner) - ✔︎ Successful
- Detect-secrets (Secret Scanner) - ✔︎ Successful
Bito Usage Guide
Commands
Type the following command in the pull request comment and save the comment.
-
/review- Manually triggers a full AI review. -
/pause- Pauses automatic reviews on this pull request. -
/resume- Resumes automatic reviews. -
/resolve- Marks all Bito-posted review comments as resolved. -
/abort- Cancels all in-progress reviews.
Refer to the documentation for additional commands.
Configuration
This repository uses Superset You can customize the agent settings here or contact your Bito workspace admin at [email protected].
Documentation & Help
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #41651 +/- ##
==========================================
+ Coverage 64.56% 64.60% +0.04%
==========================================
Files 2673 2685 +12
Lines 147634 148603 +969
Branches 34090 34222 +132
==========================================
+ Hits 95314 96002 +688
- Misses 50591 50833 +242
- Partials 1729 1768 +39
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Co-Authored-By: Claude Opus 4.8 <[email protected]>
Code Review Agent Run #04d7fbActionable Suggestions - 0Additional Suggestions - 1
Review Details
Bito Usage GuideCommands Type the following command in the pull request comment and save the comment.
Refer to the documentation for additional commands. Configuration This repository uses Documentation & Help |
…e tokens)
Follow-up to the review pass on the Persian catalog:
- 'Unpin' was translated 'اجرا کردن' ('execute'), which is wrong and
inconsistent with the Unpin action family. Corrected to 'جداکردن' (detach),
matching 'Unpin from the result panel'/'Unpin from top'.
- 'deck.gl Geojson', 'dttm', 'p1', 'p5', 'p95', 'p99' were identity
passthroughs (msgstr == English). These are do-not-translate tokens (proper
nouns, a datetime column abbreviation, percentile statistic labels), so they
are emptied to fall back to the source literal, and added to the
do-not-translate registry (#41651).
Left as-is: the 'Delayed (missed %s refresh)' plural has identical singular/
plural forms, which is correct Persian (nouns stay singular after a numeral;
18 of 39 existing plural entries do the same).
Co-Authored-By: Claude Opus 4.8 <[email protected]>
…late registry These surfaced during the Persian review as identity passthroughs (machine 'translations' equal to the English source): the percentile statistic labels p1/p5/p95/p99, the datetime column abbreviation dttm, and the proper-noun viz name 'deck.gl Geojson'. They must stay literal, so add them to the registry; apply_do_not_translate.py stamps the MACHINE_READ-DO_NOT_TRANSLATE marker into messages.pot, which propagates to every catalog. Co-Authored-By: Claude Opus 4.8 <[email protected]>
Code Review Agent Run #1ec8cbActionable Suggestions - 0Review Details
Bito Usage GuideCommands Type the following command in the pull request comment and save the comment.
Refer to the documentation for additional commands. Configuration This repository uses Documentation & Help |
Addresses code-review feedback on apply_do_not_translate.py: - Strip each registry line before the blank/comment check, so trailing whitespace or an indented comment can't yield a msgid that fails to match the .pot (Critical). - Fail fast with a non-zero exit when the registry file is missing, rather than silently producing catalogs without do-not-translate markers; an existing but empty registry remains a valid no-op (Major). - Add explicit type annotations to the module-level constants. Co-Authored-By: Claude Opus 4.8 <[email protected]>
Per review, add the explicit `Path` annotation on the module-level registry path constant, matching the sibling constants. Co-Authored-By: Claude Opus 4.8 <[email protected]>
Code Review Agent Run #32bbc8Actionable Suggestions - 0Review Details
Bito Usage GuideCommands Type the following command in the pull request comment and save the comment.
Refer to the documentation for additional commands. Configuration This repository uses Documentation & Help |
…po, annotate locals Co-Authored-By: Claude Opus 4.8 <[email protected]>
Code Review Agent Run #cfa57cActionable Suggestions - 0Review Details
Bito Usage GuideCommands Type the following command in the pull request comment and save the comment.
Refer to the documentation for additional commands. Configuration This repository uses Documentation & Help |
| # "# Не переводить"). Honored so a human's deliberate decision is never | ||
| # overridden even if a msgid is missing from the registry. | ||
| _DO_NOT_TRANSLATE_COMMENT: re.Pattern[str] = re.compile( | ||
| r"machine_read-do_not_translate|не\s+переводить" |
There was a problem hiding this comment.
Can we switch the legacy Russian translator comment to use the standard marker? Or it should be on a follow up PR?
There was a problem hiding this comment.
Checked the ru catalog — all 21 # Не переводить msgids are already in the registry, so the standard marker lands there automatically on the next babel_update.sh run. Keeping catalog regeneration out of this PR; the legacy comments stay honored by backfill_po.py regardless.
|
I'd rather to have |
Co-Authored-By: Claude Opus 4.8 <[email protected]>
Code Review Agent Run #0422a3Actionable Suggestions - 0Review Details
Bito Usage GuideCommands Type the following command in the pull request comment and save the comment.
Refer to the documentation for additional commands. Configuration This repository uses Documentation & Help |
Co-Authored-By: Claude Opus 4.8 <[email protected]>
Code Review Agent Run #2d4994Actionable Suggestions - 0Review Details
Bito Usage GuideCommands Type the following command in the pull request comment and save the comment.
Refer to the documentation for additional commands. Configuration This repository uses Documentation & Help |
Per review: machines and humans alike recognize the plain pattern, so drop the MACHINE_READ- prefix everywhere (scripts, docs, tests, and the stamped messages.pot). backfill_po.py's detection regex already matched the new form; the never-shipped machine_read alternative is removed. Co-Authored-By: Claude Fable 5 <[email protected]>
|
@hainenber agreed, the plain pattern wins... standardized in ec3b871: the marker is now |
Code Review Agent Run #794899Actionable Suggestions - 0Review Details
Bito Usage GuideCommands Type the following command in the pull request comment and save the comment.
Refer to the documentation for additional commands. Configuration This repository uses Documentation & Help |
SUMMARY
Establishes a standardized, cross-language do-not-translate convention for the translation catalogs, and teaches the AI backfill (
backfill_po.py) to honor it.Background. Some catalog entries must stay identical to the source or things break — icon names (
bolt→ the ⚡ Explore control icon), d3 enum values (step-after/step-before), API field names (error_message), SQL keywords, code constants, and example placeholders. A Russian translator had been marking these with a# Не переводитьtranslator comment (thanks @PolinaFam, @goldjee!), but translator comments are per-catalog and don't propagate, and there is no official gettext "do not translate" flag. The AI backfill, which only checked for an emptymsgstr, translated several of them (CodeAnt flagged them on #41649).The standard. gettext extracted comments (
#.) do propagate frommessages.potinto every.poonpybabel update. So:superset/translations/do-not-translate.txt— a canonical registry of do-not-translate msgids (one source of truth).scripts/translations/apply_do_not_translate.py— stamps each registry msgid inmessages.potwith a#. MACHINE_READ-DO_NOT_TRANSLATEextracted comment (format-preserving text edit; idempotent). Wired intobabel_update.shright after extraction, sopybabel updatethen propagates the marker to every catalog — consistent across languages.backfill_po.py— loads the registry and honors the#. MACHINE_READ-DO_NOT_TRANSLATEmarker (and the legacy# Не переводитьtranslator comment, for back-compat), leaving these entries untranslated (source fallback).UPDATING.md+ contributing docs — document the new standard.To mark a new string do-not-translate going forward: add its msgid to the registry. No per-catalog annotation needed.
The
messages.potin this PR already carries the 21 initial markers; they propagate to each.pothe next timebabel_update.sh/pybabel updateruns.BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
N/A — tooling + build.
TESTING INSTRUCTIONS
ADDITIONAL INFORMATION