fix(i18n-fr): improve French translation on 6.1 branch#41340
fix(i18n-fr): improve French translation on 6.1 branch#41340jeanpommier wants to merge 3 commits into
Conversation
Those might be harder to get into upstream
|
Bito Automatic Review Skipped - Branch Excluded |
✅ Deploy Preview for superset-docs-preview ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
| #, fuzzy, 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.
Suggestion: The format placeholder does not match the source string (%(name)s vs %(table)s). At runtime, interpolation will fail for this translation because the formatter only provides the table key. Use the exact same placeholder name as in msgid. [api mismatch]
Severity Level: Critical 🚨
- ❌ French catalog compilation may fail due to placeholder mismatch.
- ❌ Dataset duplication error crashes when formatted under French locale.Steps of Reproduction ✅
1. Open `superset/translations/fr/LC_MESSAGES/messages.po` and locate the entry around
lines 4551–4553, where `#, fuzzy, python-format` precedes `msgid "Dataset %(table)s
already exists"` and `msgstr "Le jeu de données %(name)s existe déjà"`.
2. Run the i18n compilation step (e.g. `pybabel compile` as configured for Superset),
which processes `messages.po` and validates Python-style placeholders for entries marked
`python-format`.
3. During compilation, the tooling compares placeholders and finds that `msgid` uses the
`table` key while the French `msgstr` uses `name`, causing a format validation error for
this catalog entry.
4. In any runtime path that formats this message as `gettext("Dataset %(table)s already
exists") % {"table": <value>}` under the `fr` locale, the French translation will be used
and will expect a `name` key, raising a `KeyError` at formatting time.(Use Cmd/Ctrl + Click for best experience)
Prompt for AI Agent 🤖
This is a comment left during a code review.
**Path:** superset/translations/fr/LC_MESSAGES/messages.po
**Line:** 4553:4553
**Comment:**
*Api Mismatch: The format placeholder does not match the source string (`%(name)s` vs `%(table)s`). At runtime, interpolation will fail for this translation because the formatter only provides the `table` key. Use the exact same placeholder name as in `msgid`.
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.
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| msgstr "" | ||
| "Il y a eu un problème lors de la suppression des ensembles de données " | ||
| "Il y a eu un problème lors de la suppression des jeux de données " | ||
| "sélectionnés : %s" |
There was a problem hiding this comment.
Suggestion: This translation introduces a %s placeholder that does not exist in the source text. That creates a formatting contract mismatch and can trigger gettext/msgfmt format errors or runtime interpolation failures. Remove the extra placeholder so placeholder counts match msgid. [api mismatch]
Severity Level: Major ⚠️
- ⚠️ French export-datasets error string may break format checks.
- ⚠️ Potential runtime TypeError if string formatted incorrectly.Steps of Reproduction ✅
1. In `superset/translations/fr/LC_MESSAGES/messages.po` around lines 14688–14691, find
the `#, fuzzy, python-format` entry with `msgid "There was an issue exporting the selected
datasets"` and a multi-line `msgstr` beginning at line 14689 that ends with `"sélectionnés
: %s"`.
2. Compare this to the source catalog `superset/translations/messages.pot` at lines
12312–12313, where the same `msgid "There was an issue exporting the selected datasets"`
has an empty `msgstr` and no `%s` placeholder in the English text.
3. Run the translation compilation step (e.g. `pybabel compile`), which validates
Python-format entries and detects that the French `msgstr` introduces an extra `%s` format
specifier not present in the `msgid`, producing a format mismatch error or warning for
this message.
4. If any code path later formats this message under the French locale assuming no
placeholders (e.g. using the translated string with implicit or explicit interpolation and
no arguments), the stray `%s` in the French `msgstr` can trigger a `TypeError` due to "not
enough arguments for format string".(Use Cmd/Ctrl + Click for best experience)
Prompt for AI Agent 🤖
This is a comment left during a code review.
**Path:** superset/translations/fr/LC_MESSAGES/messages.po
**Line:** 14689:14691
**Comment:**
*Api Mismatch: This translation introduces a `%s` placeholder that does not exist in the source text. That creates a formatting contract mismatch and can trigger gettext/msgfmt format errors or runtime interpolation failures. Remove the extra placeholder so placeholder counts match `msgid`.
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.
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 fixHinted by codeant-ai on this PR
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## 6.1 #41340 +/- ##
======================================
Coverage ? 63.71%
======================================
Files ? 2547
Lines ? 132481
Branches ? 30699
======================================
Hits ? 84416
Misses ? 46587
Partials ? 1478
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:
|
|
Can we target this to |
Hi Evan, |
SUMMARY
Bring some improvements in the French translations. Striking changes are:
+ some extra improvements as it goes
If approved, I'll make another PR backporting as much as I can into
masterBEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
For instance, when editing the user profile, we had:

now:
TESTING INSTRUCTIONS