codeant-ai-for-open-source[bot] commented on code in PR #40128:
URL: https://github.com/apache/superset/pull/40128#discussion_r3397934794
##########
superset/translations/fi/LC_MESSAGES/messages.po:
##########
@@ -7748,6 +7748,9 @@ msgstr "Kojelautaa ei voitu poistaa."
# de, es, fa, fr, it, ja, ko, lv, mi, nl, pl, pt, pt_BR, ru, sk, sl, tr, uk,
# zh, zh_TW]
#, fuzzy
+msgid "Dashboard could not be restored."
+msgstr ""
Review Comment:
**Suggestion:** The new Finnish catalog entry leaves `msgstr` empty, so this
message will not be localized and users in the Finnish locale will see the
English fallback text. Add a proper Finnish translation for this entry before
merging. [incomplete implementation]
<details>
<summary><b>Severity Level:</b> Minor ๐งน</summary>
```mdx
- โ ๏ธ Finnish users see English dashboard restore failure message.
- โ ๏ธ Inconsistent localization for dashboard-related error responses.
```
</details>
<details>
<summary><b>Steps of Reproduction โ
</b></summary>
```mdx
1. Run Superset with UI locale set to Finnish so the catalog
`superset/translations/fi/LC_MESSAGES/messages.po` is loaded for
translations.
2. Call the dashboard restore API endpoint (e.g. `PUT
/api/v1/dashboard/<uuid>/restore`)
implemented in `superset/dashboards/api.py` around lines 1278โ1287, where
`restore()`
calls `RestoreDashboardCommand(uuid).run()` and catches
`DashboardRestoreFailedError` to
return `self.response_422(message=str(ex))`.
3. Trigger a restore failure (for example, by causing the underlying
database update to
fail) so `DashboardRestoreFailedError` from
`superset/commands/dashboard/exceptions.py:81`
is raised, which defines `message = _("Dashboard could not be restored.")`
and is wired as
`restore_failed_exc` in `superset/commands/dashboard/restore.py:46`.
4. When Flask-Babel formats this message under the Finnish locale, it looks
up `msgid
"Dashboard could not be restored."` in
`superset/translations/fi/LC_MESSAGES/messages.po`
at line 7751, finds `msgstr ""` at line 7752, and therefore falls back to
the original
English string, so the Finnish UI user sees the message in English instead
of Finnish.
```
</details>
[Fix in
Cursor](https://app.codeant.ai/fix-in-ide?tool=cursor&prompt_id=a5fe891419854155a72f6e868411168b&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=a5fe891419854155a72f6e868411168b&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:** 7751:7752
**Comment:**
*Incomplete Implementation: The new Finnish catalog entry leaves
`msgstr` empty, so this message will not be localized and users in the Finnish
locale will see the English fallback text. Add a proper Finnish translation for
this entry before merging.
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%2F40128&comment_hash=972e456bdfddc1058fb33cc24100f6309c80df507b2345ff828b6c405271d738&reaction=like'>๐</a>
| <a
href='https://app.codeant.ai/feedback?pr_url=https%3A%2F%2Fgithub.com%2Fapache%2Fsuperset%2Fpull%2F40128&comment_hash=972e456bdfddc1058fb33cc24100f6309c80df507b2345ff828b6c405271d738&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]