Repository navigation
fix(i18n): repair malformed format specifiers in the fr, it and pt catalogs - #45953
Conversation
…talogs Three entries declare format specifiers their msgid does not have, so msgfmt --check fails on each catalog. The French deletion message ends in a ":%s" the source string never had, and the Italian and Portuguese singular plural forms hardcode "1" where msgid_plural uses %s. Takes msgfmt --check from 7 fatal errors to 4 across fr, it, pt and sl. The remaining 4 come from one source string whose msgid and msgid_plural name different placeholders, which no translation can satisfy. 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. |
|
Nice catch! It's a LGTM from my glance. I'll approve once the CI is green |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #45953 +/- ##
=======================================
Coverage 84.76% 84.76%
=======================================
Files 3072 3072
Lines 206129 206129
Branches 48541 48541
=======================================
Hits 174731 174731
Misses 28100 28100
Partials 3298 3298
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:
|
|
A correction to this PR's description, for the record. It states that the four remaining The three fixes merged here are unaffected; only the scope note was wrong. A catalog-only |
…talogs (#45953) Co-authored-by: Claude Opus 5 <[email protected]> (cherry picked from commit 29d337e)
…talogs (#45953) Co-authored-by: Claude Opus 5 <[email protected]>
SUMMARY
Three catalog entries carry format specifiers that do not match their
msgid, somsgfmt --checkrejects the catalogs:There was an issue deleting the selected %sis translated with two%s.The call site (
superset-frontend/src/pages/DatasetList/index.tsx) passes a singleargument, so the second placeholder can never be filled. The translation is a
character-for-character copy of the neighbouring
...selected %s: %sentry, whichlegitimately takes two arguments (
AlertReportList/index.tsx).Added to 1 dashboard/Added to %s dashboardshas a literal1in
msgstr[0]. gettext requires every plural form to carry the specifiers ofmsgid_plural. The call passes the count as a format argument(
tn(singular, plural, n, n)inExploreChartHeader/useExploreMetadataBar.tsx), so%srenders as the number — the same shape theescatalog already uses.Across the four catalogs that carry these errors (
fr,it,pt,sl), this takesmsgfmt --checkfrom 7 fatal errors down to 4; the PR itself edits three of them.Repo-wide the count is 8 to 5:
decarries one more, unrelated to these —msgid "% of"is flagged
#, python-formatand the German % von is not a valid format string. Thatone arrived with #45886 and needs a different fix, so it is out of scope here.
The remaining 4 (fr, it, pt, sl) all come from one source string whose
msgidandmsgid_pluraluse different placeholder names (%(suggestion)svs%(firstSuggestions)s/%(lastSuggestion)s, insuperset-frontend/src/components/ErrorMessage/ParameterErrorMessage.tsx). Notranslation can satisfy that, so it needs a source-side fix and is out of scope here.
These defects are also present on the
7.0branch (fr 3, it 5, pt 5 fatal errors), soa backport to 7.0 would be welcome if it is still open.
TESTING INSTRUCTIONS
Validate the catalogs:
Before: fr 2, it 2, pt 2, sl 1 fatal errors. After: 1 each (the shared source-string
defect described above).
What users see, rendered through the real frontend path (
scripts/po2json.js→ jed):So the fr entry drops a dangling colon that the stray
%sleaves behind. The it/ptplural forms render the same before and after: jed silently ignores the extra argument, and
the literal
1happens to be right forn == 1. Their defect is that the entries are notvalid gettext —
msgfmt --checkrejects them, and the same strings raise through Python's%formatting, which is what a catalog consumed outside jed would hit:Also run locally, all clean:
./scripts/translations/babel_update.sh— exit 0python scripts/translations/check_pot_drift.py— template matches a fresh extractionpython scripts/translations/check_translation_regression.py --compare <baseline>—No translation regressions; translated/fuzzy counts unchanged in all 30 catalogs
ADDITIONAL INFORMATION
Developed at MYSPHERA, S.L.
🤖 Generated with Claude Code