Skip to content

fix(i18n): repair malformed format specifiers in the fr, it and pt catalogs - #45953

Merged
sadpandajoe merged 1 commit into
apache:masterfrom
antalotec:fix/i18n-format-specifiers
Nov 2, 2026
Merged

sadpandajoe merged 1 commit into
apache:masterfrom
antalotec:fix/i18n-format-specifiers

Conversation

@antalotec

Copy link
Copy Markdown
Contributor

SUMMARY

Three catalog entries carry format specifiers that do not match their msgid, so
msgfmt --check rejects the catalogs:

  • fr — There was an issue deleting the selected %s is translated with two %s.
    The call site (superset-frontend/src/pages/DatasetList/index.tsx) passes a single
    argument, so the second placeholder can never be filled. The translation is a
    character-for-character copy of the neighbouring ...selected %s: %s entry, which
    legitimately takes two arguments (AlertReportList/index.tsx).
  • it and pt — Added to 1 dashboard / Added to %s dashboards has a literal 1
    in msgstr[0]. gettext requires every plural form to carry the specifiers of
    msgid_plural. The call passes the count as a format argument
    (tn(singular, plural, n, n) in ExploreChartHeader/useExploreMetadataBar.tsx), so
    %s renders as the number — the same shape the es catalog already uses.

Across the four catalogs that carry these errors (fr, it, pt, sl), this takes
msgfmt --check from 7 fatal errors down to 4; the PR itself edits three of them.
Repo-wide the count is 8 to 5: de carries one more, unrelated to these — msgid "% of"
is flagged #, python-format and the German % von is not a valid format string. That
one 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 msgid and
msgid_plural use different placeholder names (%(suggestion)s vs
%(firstSuggestions)s/%(lastSuggestion)s, in
superset-frontend/src/components/ErrorMessage/ParameterErrorMessage.tsx). No
translation can satisfy that, so it needs a source-side fix and is out of scope here.

These defects are also present on the 7.0 branch (fr 3, it 5, pt 5 fatal errors), so
a backport to 7.0 would be welcome if it is still open.

TESTING INSTRUCTIONS

Validate the catalogs:

for l in fr it pt sl; do
  msgfmt --check -o /dev/null superset/translations/$l/LC_MESSAGES/messages.po
done

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):

          before                                            after
fr   "...suppression des dashboards sélectionné(e)s :"  "...des dashboards sélectionné(e)s"
it   "Aggiunto a 1 dashboard"                            unchanged
pt   "Adicionado a 1 dashboard"                          unchanged

So the fr entry drops a dangling colon that the stray %s leaves behind. The it/pt
plural forms render the same before and after: jed silently ignores the extra argument, and
the literal 1 happens to be right for n == 1. Their defect is that the entries are not
valid gettext — msgfmt --check rejects them, and the same strings raise through Python's
% formatting, which is what a catalog consumed outside jed would hit:

t.ngettext('Added to 1 dashboard', 'Added to %s dashboards', 1) % 1
# before: ValueError: not all arguments converted during string formatting
# after:  'Aggiunto a 1 dashboard'

Also run locally, all clean:

  • ./scripts/translations/babel_update.sh — exit 0
  • python scripts/translations/check_pot_drift.py — template matches a fresh extraction
  • python scripts/translations/check_translation_regression.py --compare <baseline> —
    No translation regressions; translated/fuzzy counts unchanged in all 30 catalogs

ADDITIONAL INFORMATION

  • Has associated issue:
  • Required feature flags:
  • Changes UI
  • Includes DB Migration
  • Introduces new feature or API
  • Removes existing feature or API

Developed at MYSPHERA, S.L.

🤖 Generated with Claude Code

…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]>
@github-actions github-actions Bot added i18n Namespace | Anything related to localization i18n:italian Translation related to Italian language i18n:french Translation related to French language i18n:portuguese labels Nov 2, 2026
@codeant-ai-for-open-source

Copy link
Copy Markdown
Contributor

CodeAnt  CodeAnt PR Risk

🟢  Low Risk

  • The PR appears safe to merge; no actionable issues were identified in the review.

Assessed commit: 8c573eb55b12

@netlify

netlify Bot commented Nov 2, 2026

Copy link
Copy Markdown

✅ Deploy Preview for superset-docs-preview ready!

Name Link
🔨 Latest commit 8c573eb
🔍 Latest deploy log https://app.netlify.com/projects/superset-docs-preview/deploys/6ae89854131ebba72aec0921
😎 Deploy Preview https://deploy-preview-45953--superset-docs-preview.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

@hainenber

Copy link
Copy Markdown
Contributor

Nice catch! It's a LGTM from my glance. I'll approve once the CI is green

@codecov

codecov Bot commented Nov 2, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 84.76%. Comparing base (cabd8d4) to head (8c573eb).
⚠️ Report is 10 commits behind head on master.

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           
Flag Coverage Δ
hive 34.49% <ø> (ø)
mysql 52.60% <ø> (ø)
postgres 52.61% <ø> (-0.01%) ⬇️
presto 36.22% <ø> (ø)
python 87.77% <ø> (ø)
sqlite 52.37% <ø> (ø)
unit 82.53% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@antalotec

Copy link
Copy Markdown
Contributor Author

A correction to this PR's description, for the record.

It states that the four remaining msgfmt --check errors "need a source-side fix". That is
not accurate. The singular form may also name %(lastSuggestion)s: gettext accepts a
msgstr that uses a subset of the declared arguments, and for a single suggestion that
argument holds the suggestion, since lastSuggestion is
templateKeys[templateKeys.length - 1] in ParameterErrorMessage.tsx. Four catalogs
(ca, de, mi and ro) already use that form and are both valid and correct today.

The three fixes merged here are unaffected; only the scope note was wrong. A catalog-only
change could clear the remaining four errors as well, and the underlying defect — the two
plural forms declare different placeholders, so the natural translation is the invalid one,
and 20 of the 29 catalogs took it — is now tracked in #45988.

villebro pushed a commit that referenced this pull request Nov 3, 2026
…talogs (#45953)

Co-authored-by: Claude Opus 5 <[email protected]>
(cherry picked from commit 29d337e)
hainenber pushed a commit that referenced this pull request Nov 14, 2026
@github-actions github-actions Bot added 🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels 🚢 0.20.2 First shipped in 0.20.2 labels Nov 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels i18n:french Translation related to French language i18n:italian Translation related to Italian language i18n:portuguese i18n Namespace | Anything related to localization size/XS 🚢 0.20.2 First shipped in 0.20.2

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants