fix(chart): fix labels translation and enhance french translations#40223
fix(chart): fix labels translation and enhance french translations#40223AliGouta wants to merge 1 commit into
Conversation
|
Bito Automatic Review Skipped - Large PR |
✅ Deploy Preview for superset-docs-preview ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
| #, 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à" |
There was a problem hiding this comment.
🔴 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| #, 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é." |
There was a problem hiding this comment.
🟠 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 fixef89629 to
00b1f2c
Compare
| {typeof controlItem.config.label === 'function' | ||
| ? (controlItem.config.label as Function)() | ||
| : controlItem.config.label} | ||
| : typeof controlItem.config.label === 'string' |
There was a problem hiding this comment.
hi @AliGouta, the translation function is only applicable for hardcoded English strings.
There was a problem hiding this comment.
@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.
00b1f2c to
f3638e6
Compare
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:
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