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


##########
superset/translations/es/LC_MESSAGES/messages.po:
##########
@@ -567,13 +569,13 @@ msgstr ""
 " si eliminas las «cookies» o cambias de navegador.\n"
 "\n"
 
-#, fuzzy, python-format
+#, python-format
 msgid "... and %d more"
-msgstr "... y %s otros"
+msgstr "... y otros %s"

Review Comment:
   **Suggestion:** The translated format specifier does not match the source 
string: the source uses `%d` but the translation uses `%s`. In python-format 
gettext entries this can fail format validation/build or produce incorrect 
formatting behavior at runtime. Keep the placeholder type exactly aligned with 
the `msgid` (`%d` here). [type error]
   
   <details>
   <summary><b>Severity Level:</b> Major ⚠️</summary>
   
   ```mdx
   - ❌ pybabel compile for es locale may fail format checks.
   - ⚠️ Drag overlay label uses mismatched placeholder types for count.
   ```
   </details>
   <details>
   <summary><b>Steps of Reproduction ✅ </b></summary>
   
   ```mdx
   1. From the repo root, run the backend translation compilation command 
documented in
   `docs/developer_docs/contributing/howtos.md:16-22`: `pybabel compile -d
   superset/translations`.
   
   2. During compilation, `pybabel` parses 
`superset/translations/es/LC_MESSAGES/messages.po`
   and reaches the python-format entry at lines 572-574 where `msgid "... and 
%d more"` (line
   573) is flagged as `#, python-format` but `msgstr "... y otros %s"` (line 
574) uses `%s`
   instead of `%d`.
   
   3. Babel's python-format checker (invoked by `pybabel compile`) validates 
that translated
   format strings preserve the same placeholder types as the source; the `%d` 
vs `%s`
   mismatch in this entry causes a format validation error, preventing 
successful compilation
   of the Spanish catalog.
   
   4. Independently of the compile step, at runtime the React component
   `DragOverlayContentInner` in
   
`superset-frontend/src/components/Datasource/FoldersEditor/components/DragOverlayContent.tsx:61-105`
   calls `t('... and %d more', remainingCount)` (line 101), which relies on a
   python-format-compatible translation; keeping mismatched `%s` in the Spanish 
`msgstr`
   risks inconsistent or tool-rejected interpolation for this UI label.
   ```
   </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=825f01ed61bd4242afcc5e2625e39963&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=825f01ed61bd4242afcc5e2625e39963&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/es/LC_MESSAGES/messages.po
   **Line:** 573:574
   **Comment:**
        *Type Error: The translated format specifier does not match the source 
string: the source uses `%d` but the translation uses `%s`. In python-format 
gettext entries this can fail format validation/build or produce incorrect 
formatting behavior at runtime. Keep the placeholder type exactly aligned with 
the `msgid` (`%d` here).
   
   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%2F41265&comment_hash=a8a432483441df4c2b35b1be7c98ae24dc307bfd4adbec4435990856f1999dc9&reaction=like'>👍</a>
 | <a 
href='https://app.codeant.ai/feedback?pr_url=https%3A%2F%2Fgithub.com%2Fapache%2Fsuperset%2Fpull%2F41265&comment_hash=a8a432483441df4c2b35b1be7c98ae24dc307bfd4adbec4435990856f1999dc9&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