codeant-ai-for-open-source[bot] commented on code in PR #36114:
URL: https://github.com/apache/superset/pull/36114#discussion_r3488387489


##########
superset/translations/it/LC_MESSAGES/messages.po:
##########
@@ -7721,39 +7180,34 @@ msgstr ""
 
 #, python-format
 msgid "Invalid tab ids: %(tab_ids)s"
-msgstr ""
+msgstr "Id schede non validi: %s(tab_ids)s"

Review Comment:
   **Suggestion:** The source string uses named interpolation (`%(tab_ids)s`), 
but the translation changed it to positional `%s(tab_ids)s`. This breaks the 
formatting contract with the caller (which passes `tab_ids` by name), resulting 
in malformed output instead of the actual invalid tab ids. Keep the named 
placeholder exactly as `%(tab_ids)s` in the translated string. [api mismatch]
   
   <details>
   <summary><b>Severity Level:</b> Major ⚠️</summary>
   
   ```mdx
   - ❌ Italian error message shows malformed tab id placeholder text.
   - ⚠️ Report validation errors harder to interpret for Italian users.
   - ⚠️ Future refactors assuming named placeholders may break formatting.
   ```
   </details>
   <details>
   <summary><b>Steps of Reproduction ✅ </b></summary>
   
   ```mdx
   1. In the backend, open `superset/commands/report/base.py` and inspect
   `_validate_active_tabs` around lines 18–23 (shown in the current file as 
lines 18–23 in
   the snippet):
   
      - When invalid dashboard tab ids are detected, it appends a 
`ValidationError` created
      with:
   
        - `_("Invalid tab ids: %(tab_ids)s", tab_ids=str(invalid_tab_ids)),`
   
      so the message is formatted using a named placeholder `%(tab_ids)s`.
   
   2. In the Italian catalog 
`superset/translations/it/LC_MESSAGES/messages.po`, locate the
   corresponding entry around lines 7182–7183:
   
      - `7182 msgid "Invalid tab ids: %(tab_ids)s"`
   
      - `7183 msgstr "Id schede non validi: %s(tab_ids)s"`.
   
      The translation incorrectly uses a positional `%s` plus literal 
`(tab_ids)s` instead of
      the named `%(tab_ids)s` placeholder.
   
   3. Trigger report validation that hits this code path, for example by 
creating or updating
   a report on a dashboard with an invalid `activeTabs` or `anchor` state so 
that
   `invalid_tab_ids` in `_validate_active_tabs` (in 
`superset/commands/report/base.py`)
   becomes non-empty and the `ValidationError` is raised.
   
   4. With the Italian locale active, the call to `_()` resolves `msgid 
"Invalid tab ids:
   %(tab_ids)s"` to the broken Italian `msgstr "Id schede non validi: 
%s(tab_ids)s"`, and
   Python’s `%` operator formats it with the mapping `{'tab_ids': '...'}`. 
Because the format
   string now expects a positional `%s` instead of a named `%(tab_ids)s`, the 
inserted value
   is the stringified mapping (e.g. `{'tab_ids': \"{'A','B'}\"}`) followed by 
the literal
   `(tab_ids)s`, producing malformed and confusing output instead of the 
intended list of
   invalid tab ids.
   ```
   </details>
   
   [![Fix in 
Cursor](https://new-codeant-butcket.s3.us-west-1.amazonaws.com/badges/fix-in-cursor-flat.svg)](https://app.codeant.ai/fix-in-ide?tool=cursor&prompt_id=5bf7dae2ef544daca14d7daeea32f975&service=github&base_url=https%3A%2F%2Fgithub.com&org=apache&repo=apache%2Fsuperset)
 [![Fix in VSCode 
Claude](https://new-codeant-butcket.s3.us-west-1.amazonaws.com/badges/fix-in-vscode-claude-flat.svg)](https://app.codeant.ai/fix-in-ide?tool=vscode-claude&prompt_id=5bf7dae2ef544daca14d7daeea32f975&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/it/LC_MESSAGES/messages.po
   **Line:** 7182:7183
   **Comment:**
        *Api Mismatch: The source string uses named interpolation 
(`%(tab_ids)s`), but the translation changed it to positional `%s(tab_ids)s`. 
This breaks the formatting contract with the caller (which passes `tab_ids` by 
name), resulting in malformed output instead of the actual invalid tab ids. 
Keep the named placeholder exactly as `%(tab_ids)s` in the translated string.
   
   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%2F36114&comment_hash=a1366a4be8879e78ba5056e57d3df820e85200192d461a85c14c33960e68be3a&reaction=like'>👍</a>
 | <a 
href='https://app.codeant.ai/feedback?pr_url=https%3A%2F%2Fgithub.com%2Fapache%2Fsuperset%2Fpull%2F36114&comment_hash=a1366a4be8879e78ba5056e57d3df820e85200192d461a85c14c33960e68be3a&reaction=dislike'>👎</a>



##########
superset/translations/it/LC_MESSAGES/messages.po:
##########
@@ -17869,85 +16612,76 @@ msgstr ""
 msgid "tag"
 msgstr ""
 
-#, fuzzy
 msgid "task"
-msgstr "Gestisci"
+msgstr "attività"
 
 msgid "temporal type icon"
-msgstr ""
+msgstr "icona tipo temporale"
 
-#, fuzzy
 msgid "text color"
-msgstr "Porta Broker"
+msgstr "colore testo"
 
 msgid "textarea"
 msgstr "textarea"
 
 msgid "the Handlebars chart documentation"
 msgstr ""
 
-#, fuzzy
 msgid "theme"
-msgstr "Tempo"
+msgstr "tema"
 
-#, fuzzy
 msgid "timestamp"
-msgstr "Formato Datetime"
+msgstr "timestamp"
 
-#, fuzzy
 msgid "to"
-msgstr "Descrizione"
+msgstr ""
 
 msgid "top"
 msgstr ""
 
 msgid "undo"
-msgstr ""
+msgstr "annulla"
 
 msgid "unknown type icon"
+msgstr "icona tipo sconosciuto"
+
+msgid "unset"
 msgstr ""
 
-#, fuzzy
 msgid "unset"
-msgstr "Colonna"
+msgstr "reimposta"

Review Comment:
   **Suggestion:** This adds a second `msgid "unset"` entry in the same 
catalog. Duplicate `msgid`s in one PO file are treated as a catalog error by 
gettext tooling and can cause the Italian catalog build/load to fail. Keep only 
one definition for this key. [possible bug]
   
   <details>
   <summary><b>Severity Level:</b> Major ⚠️</summary>
   
   ```mdx
   - ⚠️ Italian messages catalog contains duplicate msgid "unset".
   - ⚠️ Translation build/validation tooling may warn or fail on duplicates.
   - ⚠️ Future edits to "unset" risk inconsistency across duplicate entries.
   ```
   </details>
   <details>
   <summary><b>Steps of Reproduction ✅ </b></summary>
   
   ```mdx
   1. Open the Italian catalog file at 
`superset/translations/it/LC_MESSAGES/messages.po` and
   locate the two consecutive `unset` entries around lines 16648–16652:
   
      - `16648 msgid "unset"`
   
      - `16649 msgstr ""`
   
      - `16651 msgid "unset"`
   
      - `16652 msgstr "reimposta"`.
   
   2. Run gettext tooling on this catalog, for example `msgfmt --check
   superset/translations/it/LC_MESSAGES/messages.po` in the translations build 
process (the
   same style of check the author mentions running), which will see two 
separate entries with
   identical `msgid "unset"` but different `msgstr` values in the same PO file.
   
   3. Observe that gettext treats duplicated `msgid` entries as a catalog 
defect: only the
   last translation (`"reimposta"`) is actually kept at runtime, while the 
earlier one is
   silently overridden, and some gettext tooling or stricter CI configurations 
may raise
   warnings or errors on the duplicate definition.
   
   4. Once the Italian locale is enabled in Superset, any UI string that looks 
up the `msgid
   "unset"` in the it catalog will depend on this duplicated entry; the 
effective translation
   will come from the second block only, and downstream tooling (translation 
editors,
   validators, or build steps that assume unique `msgid`s) can fail or 
misbehave due to the
   duplicate definition.
   ```
   </details>
   
   [![Fix in 
Cursor](https://new-codeant-butcket.s3.us-west-1.amazonaws.com/badges/fix-in-cursor-flat.svg)](https://app.codeant.ai/fix-in-ide?tool=cursor&prompt_id=81c9c114a9cf4a0e9bc68e728ec1aae8&service=github&base_url=https%3A%2F%2Fgithub.com&org=apache&repo=apache%2Fsuperset)
 [![Fix in VSCode 
Claude](https://new-codeant-butcket.s3.us-west-1.amazonaws.com/badges/fix-in-vscode-claude-flat.svg)](https://app.codeant.ai/fix-in-ide?tool=vscode-claude&prompt_id=81c9c114a9cf4a0e9bc68e728ec1aae8&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/it/LC_MESSAGES/messages.po
   **Line:** 16651:16652
   **Comment:**
        *Possible Bug: This adds a second `msgid "unset"` entry in the same 
catalog. Duplicate `msgid`s in one PO file are treated as a catalog error by 
gettext tooling and can cause the Italian catalog build/load to fail. Keep only 
one definition for this key.
   
   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%2F36114&comment_hash=a3b71eedfc952d26a6be31d9b970349b0cbb4658f7c2a5ad4c5b170a6c0f8fd8&reaction=like'>👍</a>
 | <a 
href='https://app.codeant.ai/feedback?pr_url=https%3A%2F%2Fgithub.com%2Fapache%2Fsuperset%2Fpull%2F36114&comment_hash=a3b71eedfc952d26a6be31d9b970349b0cbb4658f7c2a5ad4c5b170a6c0f8fd8&reaction=dislike'>👎</a>



##########
superset/translations/it/LC_MESSAGES/messages.po:
##########
@@ -14153,40 +13091,88 @@ msgid ""
 "to run this query."
 msgstr ""
 
-msgid "The table was deleted or renamed in the database."
+msgid "The schema of the submitted payload is invalid."
+msgstr "Lo schema del payload inviato non è valido."

Review Comment:
   **Suggestion:** This reintroduces an existing `msgid` with a second 
definition later in the file, creating another duplicate-key collision. Gettext 
expects unique `msgid`s per catalog entry, so this can trigger catalog 
validation/compilation errors. [possible bug]
   
   <details>
   <summary><b>Severity Level:</b> Major ⚠️</summary>
   
   ```mdx
   - ⚠️ Italian catalog has duplicate msgid for payload schema error.
   - ⚠️ Gettext/i18n tooling may warn or fail on duplicate keys.
   - ⚠️ Future translation edits can drift between the two duplicate blocks.
   ```
   </details>
   <details>
   <summary><b>Steps of Reproduction ✅ </b></summary>
   
   ```mdx
   1. Open `superset/translations/it/LC_MESSAGES/messages.po` and locate the 
two `msgid "The
   schema of the submitted payload is invalid."` entries:
   
      - First occurrence around lines 13043–13044 with an empty `msgstr`:
   
        - `13043 msgid "The schema of the submitted payload is invalid."`
   
        - `13044 msgstr ""`
   
      - Second occurrence around lines 13094–13095 with the Italian translation:
   
        - `13094 msgid "The schema of the submitted payload is invalid."`
   
        - `13095 msgstr "Lo schema del payload inviato non è valido."`.
   
   2. In the backend, see where this message id is used by examining
   `superset/exceptions.py:293–297`, where `MarshmallowErrorMixin` builds a 
`SupersetError`
   with:
   
      - `message=_("The schema of the submitted payload is invalid."),`
   
      so the Italian catalog must supply a single, consistent translation for 
this key.
   
   3. Run gettext compilation or validation on the Italian catalog (for example 
`msgfmt
   --check superset/translations/it/LC_MESSAGES/messages.po` in the i18n build 
pipeline);
   gettext will encounter two entries with the same `msgid` and choose the 
latter while
   potentially issuing duplicate-key diagnostics.
   
   4. When the Italian locale is active and a marshmallow schema error occurs 
anywhere that
   raises `MarshmallowErrorMixin` (e.g. invalid REST API payloads for resources 
handled by
   `superset/exceptions.py`), the system calls gettext for `msgid "The schema 
of the
   submitted payload is invalid."`; only the last duplicate entry will be used, 
and the
   presence of two definitions can cause validation/build issues or confusion 
for translators
   and tooling.
   ```
   </details>
   
   [![Fix in 
Cursor](https://new-codeant-butcket.s3.us-west-1.amazonaws.com/badges/fix-in-cursor-flat.svg)](https://app.codeant.ai/fix-in-ide?tool=cursor&prompt_id=3440d852e67f4cf4be0fb757f1679af8&service=github&base_url=https%3A%2F%2Fgithub.com&org=apache&repo=apache%2Fsuperset)
 [![Fix in VSCode 
Claude](https://new-codeant-butcket.s3.us-west-1.amazonaws.com/badges/fix-in-vscode-claude-flat.svg)](https://app.codeant.ai/fix-in-ide?tool=vscode-claude&prompt_id=3440d852e67f4cf4be0fb757f1679af8&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/it/LC_MESSAGES/messages.po
   **Line:** 13094:13095
   **Comment:**
        *Possible Bug: This reintroduces an existing `msgid` with a second 
definition later in the file, creating another duplicate-key collision. Gettext 
expects unique `msgid`s per catalog entry, so this can trigger catalog 
validation/compilation errors.
   
   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%2F36114&comment_hash=24fb293bb682d96815ead6189bd44cba4e2d1ec3f6a574c15bc47c2d18109c49&reaction=like'>👍</a>
 | <a 
href='https://app.codeant.ai/feedback?pr_url=https%3A%2F%2Fgithub.com%2Fapache%2Fsuperset%2Fpull%2F36114&comment_hash=24fb293bb682d96815ead6189bd44cba4e2d1ec3f6a574c15bc47c2d18109c49&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]

Reply via email to