Skip to content

fix(i18n-fr): improve French translation on 6.1 branch#41340

Open
jeanpommier wants to merge 3 commits into
apache:6.1from
pi-geosolutions:6.1
Open

fix(i18n-fr): improve French translation on 6.1 branch#41340
jeanpommier wants to merge 3 commits into
apache:6.1from
pi-geosolutions:6.1

Conversation

@jeanpommier

Copy link
Copy Markdown

SUMMARY

Bring some improvements in the French translations. Striking changes are:

  • fix several really erroneous translations
  • replace "ensemble de données" (dataset) by "jeu de données", which is a much more commonly used term for this

+ some extra improvements as it goes

If approved, I'll make another PR backporting as much as I can into master

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

For instance, when editing the user profile, we had:
image

now:

image

TESTING INSTRUCTIONS

  • Build Superset with the translations
  • activate french translations
LANGUAGES = {
    'fr': {'flag': 'fr', 'name': 'French'},
    'en': {'flag': 'us', 'name': 'English'},
}
  • check for instance the "Edit user" form

@dosubot dosubot Bot added the i18n:french Translation related to French language label Jun 23, 2026
@bito-code-review

bito-code-review Bot commented Jun 23, 2026

Copy link
Copy Markdown
Contributor

Bito Automatic Review Skipped - Branch Excluded

Bito didn't auto-review because the source or target branch is excluded from automatic reviews.
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.
You can change the branch exclusion settings here, or contact your Bito workspace admin at evan@preset.io.

@github-actions github-actions Bot added the i18n Namespace | Anything related to localization label Jun 23, 2026
@netlify

netlify Bot commented Jun 23, 2026

Copy link
Copy Markdown

Deploy Preview for superset-docs-preview ready!

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

#, 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à"

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.

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.

Fix in Cursor Fix in VSCode Claude

(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
👍 | 👎

Comment on lines 14689 to 14691
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"

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.

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".

Fix in Cursor Fix in VSCode Claude

(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 fix
👍 | 👎

@codecov

codecov Bot commented Jun 24, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
⚠️ Please upload report for BASE (6.1@f204888). Learn more about missing BASE report.

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           
Flag Coverage Δ
hive 39.95% <ø> (?)
mysql 60.50% <ø> (?)
postgres 60.56% <ø> (?)
presto 39.97% <ø> (?)
python 60.82% <ø> (?)
sqlite 60.21% <ø> (?)

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.

@rusackas

Copy link
Copy Markdown
Member

Can we target this to master instead of the 6.1 branch first? Then we should be able to cherry pick it to 6.1.

@jeanpommier

Copy link
Copy Markdown
Author

Can we target this to master instead of the 6.1 branch first? Then we should be able to cherry pick it to 6.1.

Hi Evan,
Yes, OK, will do

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

i18n:french Translation related to French language i18n Namespace | Anything related to localization size/XL

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants