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


##########
superset/translations/ja/LC_MESSAGES/messages.po:
##########
@@ -2075,8 +2079,8 @@ msgstr "「%s」をシステムのダークテーマに設定してもよろし
 
 #, python-format
 msgid ""
-"Are you sure you want to set \"%s\" as the system default theme? This "
-"will apply to all users who haven't set a personal preference."
+"Are you sure you want to set \"%s\" as the system default theme? This will "
+"apply to all users who haven't set a personal preference."
 msgstr "「%s」をシステムのダークテーマとして設定してもよろしいですか?これは個人設定を行っていないすべてのユーザーに適用されます。。"
 

Review Comment:
   **Suggestion:** The new confirmation string for setting the system default 
theme is translated as “system dark theme,” which changes the meaning and can 
mislead admins into applying the wrong global theme setting. Update the 
Japanese `msgstr` to refer to the default theme (not dark theme) so the action 
prompt matches the actual operation. [logic error]
   
   <details>
   <summary><b>Severity Level:</b> Major ⚠️</summary>
   
   ```mdx
   - ⚠️ System default theme change mislabelled as dark theme.
   - ⚠️ Admins may misconfigure global theme due to mistranslation.
   ```
   </details>
   <details>
   <summary><b>Steps of Reproduction ✅ </b></summary>
   
   ```mdx
   1. Open the themes list UI, implemented at
   `superset-frontend/src/pages/ThemeList/index.tsx:268-280`, and note that the
   `handleSetSystemDefault` callback calls `showConfirm` with the title `t('Set 
System
   Default Theme')` and the body `t('Are you sure you want to set "%s" as the 
system default
   theme? This will apply to all users who haven't set a personal preference.',
   theme.theme_name)`.
   
   2. Run Superset with the UI locale set to Japanese (so that
   `superset/translations/ja/LC_MESSAGES/messages.po` is used by `t()`), then 
in the Themes
   page click the action that triggers `handleSetSystemDefault` for a theme 
(this issues the
   confirmation dialog wired to that msgid).
   
   3. Observe that the Japanese translation for this msgid is defined in
   `superset/translations/ja/LC_MESSAGES/messages.po` at lines 21–25 (diff hunk 
lines
   2082–2085): the `msgid` is “Are you sure you want to set "%s" as the system 
default theme?
   …”, but the `msgstr` reads
   “「%s」をシステムのダークテーマとして設定してもよろしいですか?これは個人設定を行っていないすべてのユーザーに適用されます。。”, which 
explicitly says
   “system dark theme” instead of “system default theme”.
   
   4. Confirm that the backend endpoint invoked by this action is the 
default-theme setter,
   not the dark-theme setter: `superset/themes/api.py:568-573` defines
   `set_system_default(self, pk: int)` with summary “Set a theme as the system 
default
   theme”, and `handleSetSystemDefault` calls 
`setSystemDefaultTheme(theme.id!)` in
   `index.tsx:15`, so the dialog’s Japanese text is misleading admins into 
thinking they are
   setting the system dark theme while they are actually changing the system 
default theme.
   ```
   </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=d9f59e4c68934d2085debc3dfe0855dd&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=d9f59e4c68934d2085debc3dfe0855dd&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/ja/LC_MESSAGES/messages.po
   **Line:** 2082:2085
   **Comment:**
        *Logic Error: The new confirmation string for setting the system 
default theme is translated as “system dark theme,” which changes the meaning 
and can mislead admins into applying the wrong global theme setting. Update the 
Japanese `msgstr` to refer to the default theme (not dark theme) so the action 
prompt matches the actual operation.
   
   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%2F41466&comment_hash=ebf670f92b812dbfa59840d6fe077fca8750eb4b22afff54c817a9cd234f5f26&reaction=like'>👍</a>
 | <a 
href='https://app.codeant.ai/feedback?pr_url=https%3A%2F%2Fgithub.com%2Fapache%2Fsuperset%2Fpull%2F41466&comment_hash=ebf670f92b812dbfa59840d6fe077fca8750eb4b22afff54c817a9cd234f5f26&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