codeant-ai-for-open-source[bot] commented on code in PR #41340: URL: https://github.com/apache/superset/pull/41340#discussion_r3460235109
########## superset/translations/fr/LC_MESSAGES/messages.po: ########## @@ -14769,7 +14687,7 @@ msgstr "Il y a eu un problème lors de la suppression des graphiques sélectionn #, fuzzy, python-format msgid "There was an issue exporting the selected datasets" 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" Review 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] <details> <summary><b>Severity Level:</b> Major ⚠️</summary> ```mdx - ⚠️ French export-datasets error string may break format checks. - ⚠️ Potential runtime TypeError if string formatted incorrectly. ``` </details> <details> <summary><b>Steps of Reproduction ✅ </b></summary> ```mdx 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". ``` </details> [](https://app.codeant.ai/fix-in-ide?tool=cursor&prompt_id=f929b5f902df42aa910bccdc89bb4876&service=github&base_url=https%3A%2F%2Fgithub.com&org=apache&repo=apache%2Fsuperset) [](https://app.codeant.ai/fix-in-ide?tool=vscode-claude&prompt_id=f929b5f902df42aa910bccdc89bb4876&service=github&base_url=https%3A%2F%2Fgithub.com&org=apache&repo=apache%2Fsuperset) *(Use Cmd/Ctrl + Click for best experience)* <details> <summary><b>Prompt for AI Agent 🤖 </b></summary> ```mdx 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 ``` </details> <a href='https://app.codeant.ai/feedback?pr_url=https%3A%2F%2Fgithub.com%2Fapache%2Fsuperset%2Fpull%2F41340&comment_hash=338742a2e829d89ed03ef0f9174cf3afd873a9ba43d237655ec8a73c45fe8111&reaction=like'>👍</a> | <a href='https://app.codeant.ai/feedback?pr_url=https%3A%2F%2Fgithub.com%2Fapache%2Fsuperset%2Fpull%2F41340&comment_hash=338742a2e829d89ed03ef0f9174cf3afd873a9ba43d237655ec8a73c45fe8111&reaction=dislike'>👎</a> ########## superset/translations/fr/LC_MESSAGES/messages.po: ########## @@ -4548,71 +4546,71 @@ msgid "Databases" msgstr "Bases de données" msgid "Dataset" -msgstr "Ensemble de données" +msgstr "Jeu de données" #, 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à" Review 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] <details> <summary><b>Severity Level:</b> Critical 🚨</summary> ```mdx - ❌ French catalog compilation may fail due to placeholder mismatch. - ❌ Dataset duplication error crashes when formatted under French locale. ``` </details> <details> <summary><b>Steps of Reproduction ✅ </b></summary> ```mdx 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. ``` </details> [](https://app.codeant.ai/fix-in-ide?tool=cursor&prompt_id=4d6ad176d81c48a3bef1881fa75e395f&service=github&base_url=https%3A%2F%2Fgithub.com&org=apache&repo=apache%2Fsuperset) [](https://app.codeant.ai/fix-in-ide?tool=vscode-claude&prompt_id=4d6ad176d81c48a3bef1881fa75e395f&service=github&base_url=https%3A%2F%2Fgithub.com&org=apache&repo=apache%2Fsuperset) *(Use Cmd/Ctrl + Click for best experience)* <details> <summary><b>Prompt for AI Agent 🤖 </b></summary> ```mdx 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 ``` </details> <a href='https://app.codeant.ai/feedback?pr_url=https%3A%2F%2Fgithub.com%2Fapache%2Fsuperset%2Fpull%2F41340&comment_hash=170966ce1a3664cacc31628bd1229bd6198c0f83f5c70534b679d728c8f4327f&reaction=like'>👍</a> | <a href='https://app.codeant.ai/feedback?pr_url=https%3A%2F%2Fgithub.com%2Fapache%2Fsuperset%2Fpull%2F41340&comment_hash=170966ce1a3664cacc31628bd1229bd6198c0f83f5c70534b679d728c8f4327f&reaction=dislike'>👎</a> -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
