codeant-ai-for-open-source[bot] commented on code in PR #40860:
URL: https://github.com/apache/superset/pull/40860#discussion_r3407618691
##########
superset/translations/fi/LC_MESSAGES/messages.po:
##########
@@ -8152,6 +8152,9 @@ msgstr "Tietokannan asetukset päivitetty"
msgid "Database type does not support file uploads."
msgstr "Tietokantityyppi ei tue tiedostojen lataamista."
+msgid "Database upload file exceeds the maximum allowed size."
+msgstr ""
Review Comment:
**Suggestion:** The new Finnish catalog entry leaves `msgstr` empty, so this
message will not be localized and users in the `fi` locale will see the English
fallback string. Add the Finnish translation (or mark it appropriately as
fuzzy/pending) to avoid shipping a partially untranslated upload error.
[incomplete implementation]
<details>
<summary><b>Severity Level:</b> Major ⚠️</summary>
```mdx
- ⚠️ Finnish users get blank text for upload size errors.
- ⚠️ Confusing UX when uploads are rejected for size limit.
```
</details>
<details>
<summary><b>Steps of Reproduction ✅ </b></summary>
```mdx
1. Open the Finnish catalog
`superset/translations/fi/LC_MESSAGES/messages.po` around
lines 8145–8180 and observe that the entry at lines 11–12 is `msgid
"Database upload file
exceeds the maximum allowed size."` followed by `msgstr ""` with no
preceding `#, fuzzy`
marker, so gettext will treat this as a valid translation to the empty
string.
2. In `superset/commands/database/exceptions.py:12-14`, note that the
`DatabaseUploadFileTooLarge` exception sets `message = _("Database upload
file exceeds the
maximum allowed size.")`, directly binding the runtime error text to this
msgid and thus
to the Finnish `msgstr ""` when the `fi` locale is active.
3. In `superset/commands/database/uploaders/base.py:4-21`,
`UploadCommand.validate_file_size()` reads
`current_app.config["UPLOAD_MAX_FILE_SIZE_BYTES"]` and, when it is
non-`None` and the
uploaded file size exceeds this limit, raises
`DatabaseUploadFileTooLarge()`, so any
oversize upload will use the localized message from the catalog.
4. The databases API metadata and upload endpoints in
`superset/databases/api.py:1705-1729` and `1790-1816` call
`UploadCommand.validate_file_size(parameters["file"])` or
`UploadCommand(...).run()` with
the uploaded file; with the Finnish locale selected and
`UPLOAD_MAX_FILE_SIZE_BYTES` set,
sending a file larger than the limit triggers `DatabaseUploadFileTooLarge`,
whose message
is looked up in the Finnish catalog and resolves to `msgstr ""`, resulting
in an empty (or
non-Finnish) error message instead of a proper Finnish translation when the
413 response
is returned.
```
</details>
[Fix in
Cursor](https://app.codeant.ai/fix-in-ide?tool=cursor&prompt_id=0427ec27e0cc4084b1075cdefa08a7cd&service=github&base_url=https%3A%2F%2Fgithub.com&org=apache&repo=apache%2Fsuperset)
| [Fix in VSCode
Claude](https://app.codeant.ai/fix-in-ide?tool=vscode-claude&prompt_id=0427ec27e0cc4084b1075cdefa08a7cd&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/fi/LC_MESSAGES/messages.po
**Line:** 8155:8156
**Comment:**
*Incomplete Implementation: The new Finnish catalog entry leaves
`msgstr` empty, so this message will not be localized and users in the `fi`
locale will see the English fallback string. Add the Finnish translation (or
mark it appropriately as fuzzy/pending) to avoid shipping a partially
untranslated upload error.
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%2F40860&comment_hash=f42434c96c6a08ef0e98866c706bff123e899bfec48b240882626a3bd1469d70&reaction=like'>👍</a>
| <a
href='https://app.codeant.ai/feedback?pr_url=https%3A%2F%2Fgithub.com%2Fapache%2Fsuperset%2Fpull%2F40860&comment_hash=f42434c96c6a08ef0e98866c706bff123e899bfec48b240882626a3bd1469d70&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]