Skip to content

fix(chart): fix labels translation and enhance french translations#40223

Closed
AliGouta wants to merge 1 commit into
apache:masterfrom
AliGouta:fix/translation-issue-40207
Closed

fix(chart): fix labels translation and enhance french translations#40223
AliGouta wants to merge 1 commit into
apache:masterfrom
AliGouta:fix/translation-issue-40207

Conversation

@AliGouta
Copy link
Copy Markdown
Contributor

SUMMARY

This PR should fix the translation to other languages many static labels and descriptions in the UI.

Fixes SC #40207 Partial UI Translation for Superset Components.

Root cause: labels and descriptions are not translated in controlPanels. Labels in filter config forms are not also forcibly translated because t() is not called.

Fix: Call of t() before rendering in the UI which makes translation of description and labels. Also, French translations is poorly done. We extend the translation and fix many entries.

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

Before:

before

After:

after

TESTING INSTRUCTIONS

Building a new image:

docker build --build-arg BUILD_TRANSLATIONS=true -t superset:fix-40207 .

Deploy and run the image

ADDITIONAL INFORMATION

  • [ X] Has associated issue: 40207
  • Required feature flags:
  • Changes UI
  • Includes DB Migration (follow approval process in SIP-59)
    • Migration is atomic, supports rollback & is backwards-compatible
    • Confirm DB migration upgrade and downgrade tested
    • Runtime estimates and downtime expectations provided
  • Introduces new feature or API
  • Removes existing feature or API

@AliGouta AliGouta requested a review from sfirke as a code owner May 18, 2026 14:34
@dosubot dosubot Bot added change:frontend Requires changing the frontend i18n:french Translation related to French language i18n:general Related to translations labels May 18, 2026
@bito-code-review
Copy link
Copy Markdown
Contributor

bito-code-review Bot commented May 18, 2026

Bito Automatic Review Skipped - Large PR

Bito didn't auto-review this change because the pull request exceeded the line limit. No action is needed if you didn't intend for the agent to review it. Otherwise, to manually trigger a review, type /review in a comment and save.

@netlify
Copy link
Copy Markdown

netlify Bot commented May 18, 2026

Deploy Preview for superset-docs-preview ready!

Name Link
🔨 Latest commit f3638e6
🔍 Latest deploy log https://app.netlify.com/projects/superset-docs-preview/deploys/6a0b2fb34ef3c2000823c15c
😎 Deploy Preview https://deploy-preview-40223--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.

Comment on lines +4558 to +4560
#, python-format
msgid "Dataset %(table)s already exists"
msgstr "L’ensemble de données %(name)s existe déjà"
msgstr "Le jeu de données %(name)s existe déjà"
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔴 Architect Review — CRITICAL

The translation for msgid "Dataset %(table)s already exists" uses a different placeholder name (%(name)s instead of %(table)s), which will cause a runtime formatting error when the French string is rendered.

Suggestion: Update the French msgstr to use the same placeholder name as the source (%(table)s) for this entry, and ensure all python-format translations preserve the exact placeholder names used in msgid.

Fix in Cursor | Fix in VSCode Claude

(Use Cmd/Ctrl + Click for best experience)

Prompt for AI Agent 🤖
This is an **Architect / Logical Review** comment left during a code review. These reviews are first-class, important findings — not optional suggestions. Do NOT dismiss this as a 'big architectural change' just because the title says architect review; most of these can be resolved with a small, localized fix once the intent is understood.

**Path:** superset/translations/fr/LC_MESSAGES/messages.po
**Line:** 4558:4560
**Comment:**
	*CRITICAL: The translation for `msgid "Dataset %(table)s already exists"` uses a different placeholder name (`%(name)s` instead of `%(table)s`), which will cause a runtime formatting error when the French string is rendered.

Validate the correctness of the flagged issue. If correct, How can I resolve this? If you propose a fix, implement it and please make it concise.
If a suggested approach is provided above, use it as the authoritative instruction. If no explicit code suggestion is given, you MUST still draft and apply your own minimal, localized fix — do not punt back with 'no suggestion provided, review manually'. Keep the change as small as possible: add a guard clause, gate on a loading state, reorder an await, wrap in a conditional, etc. Do not refactor surrounding code or expand scope beyond the finding.
Once fix is implemented, also check other comments on the same PR, and ask user if the user wants to fix the rest of the comments as well. if said yes, then fetch all the comments validate the correctness and implement a minimal fix

Comment on lines +14496 to +14506
#, fuzzy
msgid "Theme not found."
msgstr "Thème non trouvé."
msgstr "Modèle CSS non trouvé."


msgid "Themes"
msgstr "Thèmes"

#, fuzzy
msgid "Themes could not be deleted."
msgstr "Les thèmes n'ont pas pu être supprimés."
msgstr "L'ensemble de données n'a pas pu être supprimé."
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟠 Architect Review — HIGH

Theme-related French translations are incorrect: msgid "Theme not found." is translated as "Modèle CSS non trouvé." and msgid "Themes could not be deleted." as "L'ensemble de données n'a pas pu être supprimé.", referring to different resources than the source messages and misleading users in theme management flows.

Suggestion: Correct these msgstr values to accurately refer to themes (e.g. "Thème introuvable." / "Les thèmes n'ont pas pu être supprimés.") and re-check other touched fuzzy theme strings for semantic accuracy before release.

Fix in Cursor | Fix in VSCode Claude

(Use Cmd/Ctrl + Click for best experience)

Prompt for AI Agent 🤖
This is an **Architect / Logical Review** comment left during a code review. These reviews are first-class, important findings — not optional suggestions. Do NOT dismiss this as a 'big architectural change' just because the title says architect review; most of these can be resolved with a small, localized fix once the intent is understood.

**Path:** superset/translations/fr/LC_MESSAGES/messages.po
**Line:** 14496:14506
**Comment:**
	*HIGH: Theme-related French translations are incorrect: `msgid "Theme not found."` is translated as "Modèle CSS non trouvé." and `msgid "Themes could not be deleted."` as "L'ensemble de données n'a pas pu être supprimé.", referring to different resources than the source messages and misleading users in theme management flows.

Validate the correctness of the flagged issue. If correct, How can I resolve this? If you propose a fix, implement it and please make it concise.
If a suggested approach is provided above, use it as the authoritative instruction. If no explicit code suggestion is given, you MUST still draft and apply your own minimal, localized fix — do not punt back with 'no suggestion provided, review manually'. Keep the change as small as possible: add a guard clause, gate on a loading state, reorder an await, wrap in a conditional, etc. Do not refactor surrounding code or expand scope beyond the finding.
Once fix is implemented, also check other comments on the same PR, and ask user if the user wants to fix the rest of the comments as well. if said yes, then fetch all the comments validate the correctness and implement a minimal fix

@github-actions github-actions Bot added the i18n Namespace | Anything related to localization label May 18, 2026
@AliGouta AliGouta force-pushed the fix/translation-issue-40207 branch from ef89629 to 00b1f2c Compare May 18, 2026 15:05
@hainenber hainenber linked an issue May 18, 2026 that may be closed by this pull request
3 tasks
{typeof controlItem.config.label === 'function'
? (controlItem.config.label as Function)()
: controlItem.config.label}
: typeof controlItem.config.label === 'string'
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hi @AliGouta, the translation function is only applicable for hardcoded English strings.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@hainenber I considered this simple option to fix the issue, well, I just created a new PR with another option:
option 2-fix translation issue. It seems there is a problem loading the i118 translation package when rendering. in option 2, I consider another option which might be better.

@AliGouta AliGouta force-pushed the fix/translation-issue-40207 branch from 00b1f2c to f3638e6 Compare May 18, 2026 15:26
@AliGouta AliGouta closed this May 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

change:frontend Requires changing the frontend i18n:french Translation related to French language i18n:general Related to translations i18n Namespace | Anything related to localization size/XXL

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants