mirror of
https://github.com/apache/superset.git
synced 2026-07-08 15:55:33 +00:00
feat(i18n): skip do-not-translate entries in backfill_po
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 <noreply@anthropic.com>
This commit is contained in:
@@ -342,6 +342,12 @@ uses Claude AI to generate draft translations for any missing entries. All
|
||||
AI-generated strings are marked `#, fuzzy` and tagged with an attribution
|
||||
comment so that human reviewers know they need to be checked before merging.
|
||||
|
||||
The script never touches entries that must stay literal — msgids in its curated
|
||||
`DO_NOT_TRANSLATE` set (icon names, enum values, SQL keywords, API field names,
|
||||
example placeholders) and any entry carrying an explicit do-not-translate
|
||||
translator comment (e.g. the ru catalog's `# Не переводить`). Those are left
|
||||
untranslated so they fall back to the source token.
|
||||
|
||||
#### Prerequisites
|
||||
|
||||
```bash
|
||||
|
||||
Reference in New Issue
Block a user