codeant-ai-for-open-source[bot] commented on code in PR #41885:
URL: https://github.com/apache/superset/pull/41885#discussion_r3545981114
##########
superset/translations/ru/LC_MESSAGES/messages.po:
##########
@@ -490,41 +489,35 @@ msgstr[0] "%s строка"
msgstr[1] "%s строки"
msgstr[2] "%s строк"
-#, fuzzy, python-format
+#, python-format
msgid "%s s ago"
msgid_plural "%s s ago"
-msgstr[0] "30 дней назад"
-msgstr[1] ""
-msgstr[2] ""
+msgstr[0] "%s сек. назад"
+msgstr[1] "%s сек. назад"
+msgstr[2] "%s сек. назад"
#, python-format
msgid "%s saved metric(s)"
-msgstr "Сохраненная мер: %s"
+msgstr "Сохраненных мер: %s"
-#, fuzzy, python-format
+#, python-format
msgid "%s second"
msgid_plural "%s seconds"
-msgstr[0] "5 секунд"
-msgstr[1] ""
-msgstr[2] ""
+msgstr[0] "% сек."
+msgstr[1] "% сек."
+msgstr[2] "% сек."
Review Comment:
**Suggestion:** The Russian plural forms dropped the `%s` substitution token
(`% сек.`), which will break string interpolation for this python-format
message at runtime. Keep the `%s` placeholder in every plural form (for
example, before the unit text) so formatting receives and renders the numeric
value correctly. [incorrect variable usage]
<details>
<summary><b>Severity Level:</b> Critical 🚨</summary>
```mdx
- ❌ RU locale crashes interpolating second-based time labels.
- ⚠️ Time-ago badges fail for Russian users.
```
</details>
<details>
<summary><b>Steps of Reproduction ✅ </b></summary>
```mdx
1. Configure Superset to use Russian locale as default (see
BABEL_DEFAULT_LOCALE in
/workspace/superset/superset/config.py; PR testing instructions also mention
setting
BABEL_DEFAULT_LOCALE="ru").
2. Note that the singular/plural message for seconds is defined in the base
catalog at
/workspace/superset/superset/translations/messages.pot (grep results) and
translated in
the Russian catalog at
/workspace/superset/translations/ru/LC_MESSAGES/messages.po lines
504–508.
3. When any view or API code calls ngettext("%s second", "%s seconds",
seconds) and then
applies Python %-formatting with the seconds value, Babel will select one of
the Russian
msgstr entries from lines 506–508.
4. Because the Russian translations at 506–508 removed the %s placeholder
and instead
contain a bare "%" followed by text, Python’s string interpolation raises a
ValueError
(“incomplete format”) for RU locale, causing the corresponding UI component
(e.g., “X
seconds ago” status labels) to fail rendering.
```
</details>
[](https://app.codeant.ai/fix-in-ide?tool=cursor&prompt_id=a896bfccb90e41e5bc0d2ce931a22da1&service=github&base_url=https%3A%2F%2Fgithub.com&org=apache&repo=apache%2Fsuperset)
[](https://app.codeant.ai/fix-in-ide?tool=vscode-claude&prompt_id=a896bfccb90e41e5bc0d2ce931a22da1&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/ru/LC_MESSAGES/messages.po
**Line:** 504:508
**Comment:**
*Incorrect Variable Usage: The Russian plural forms dropped the `%s`
substitution token (`% сек.`), which will break string interpolation for this
python-format message at runtime. Keep the `%s` placeholder in every plural
form (for example, before the unit text) so formatting receives and renders the
numeric value correctly.
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%2F41885&comment_hash=f8de4a5e950191e271c31f79e47b668bf3ad882c6f379169cee45be61461cd14&reaction=like'>👍</a>
| <a
href='https://app.codeant.ai/feedback?pr_url=https%3A%2F%2Fgithub.com%2Fapache%2Fsuperset%2Fpull%2F41885&comment_hash=f8de4a5e950191e271c31f79e47b668bf3ad882c6f379169cee45be61461cd14&reaction=dislike'>👎</a>
##########
superset/translations/ru/LC_MESSAGES/messages.po:
##########
@@ -1822,13 +1781,11 @@ msgstr "Произошла ошибка при получении списка
msgid "An error occurred while fetching schema values: %s"
msgstr "Произошла ошибка при извлечении значений схемы: %s"
-#, fuzzy
msgid "An error occurred while fetching semantic layer types"
-msgstr "Произошла ошибка при получении доступных тем"
+msgstr "Произошла ошибка при получении доступных типов слоев аннотаций"
Review Comment:
**Suggestion:** The translation adds a stray `%s` token that does not exist
in the source string, so users will see an unresolved placeholder in UI text.
Remove the extra `%s` (or align the source/translation placeholders) so the
message renders cleanly. [typo]
<details>
<summary><b>Severity Level:</b> Major ⚠️</summary>
```mdx
- ⚠️ Semantic layer errors show stray “%s” placeholder.
- ⚠️ Future formatting may crash Russian error UI.
```
</details>
<details>
<summary><b>Steps of Reproduction ✅ </b></summary>
```mdx
1. Enable the semantic layer feature in Superset and set locale to Russian
(BABEL_DEFAULT_LOCALE="ru").
2. Observe the base non-parameterized msgid "An error occurred while
fetching semantic
layers" in /workspace/superset/superset/translations/messages.pot and its
Russian msgstr
with an added "%s" at
/workspace/superset/translations/ru/LC_MESSAGES/messages.po lines
1784–1785.
3. Trigger a semantic layer fetch failure (for example, open the semantic
views screen in
the UI while the semantic-layer backend is misconfigured), causing the
frontend or API
layer to render the plain error string without any formatting arguments.
4. Under RU locale, the translated string at 1785 contains a "%s" token even
though no
python-format arguments are supplied; users either see a literal "%s" in the
error text
or, if any future code tries to format this string, a formatting error,
resulting in
confusing or broken error messages around semantic layer fetch operations.
```
</details>
[](https://app.codeant.ai/fix-in-ide?tool=cursor&prompt_id=2cdd40883f814ebe879f654175c06648&service=github&base_url=https%3A%2F%2Fgithub.com&org=apache&repo=apache%2Fsuperset)
[](https://app.codeant.ai/fix-in-ide?tool=vscode-claude&prompt_id=2cdd40883f814ebe879f654175c06648&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/ru/LC_MESSAGES/messages.po
**Line:** 1784:1785
**Comment:**
*Typo: The translation adds a stray `%s` token that does not exist in
the source string, so users will see an unresolved placeholder in UI text.
Remove the extra `%s` (or align the source/translation placeholders) so the
message renders cleanly.
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%2F41885&comment_hash=15883fe287a563e590355f8c08c9f655e6748bf309b983186e38ffd3ec1124d6&reaction=like'>👍</a>
| <a
href='https://app.codeant.ai/feedback?pr_url=https%3A%2F%2Fgithub.com%2Fapache%2Fsuperset%2Fpull%2F41885&comment_hash=15883fe287a563e590355f8c08c9f655e6748bf309b983186e38ffd3ec1124d6&reaction=dislike'>👎</a>
##########
superset/translations/ru/LC_MESSAGES/messages.po:
##########
@@ -14600,7 +14267,7 @@ msgstr "Произошла ошибка при удалении регистра
msgid "There was an issue deleting rules: %s"
msgstr "Произошла ошибка при удалении правил: %s"
-#, fuzzy, python-format
+#, python-format
msgid "There was an issue deleting the selected %s"
msgstr "Произошла ошибка при удалении выбранных %s: %s"
Review Comment:
**Suggestion:** The singular message was translated with two `%s`
placeholders while the source has one, which will trigger formatting errors
when rendered. Reduce the translation to a single `%s` placeholder to match the
source contract. [incorrect variable usage]
<details>
<summary><b>Severity Level:</b> Critical 🚨</summary>
```mdx
- ❌ Bulk delete errors crash for Russian-language users.
- ⚠️ Users lose diagnostics on failed deletions.
```
</details>
<details>
<summary><b>Steps of Reproduction ✅ </b></summary>
```mdx
1. Set BABEL_DEFAULT_LOCALE="ru" so Russian translations from
/workspace/superset/translations/ru/LC_MESSAGES/messages.po are active in
the UI.
2. Note the python-format msgid "There was an issue deleting the selected
%s" and its
Russian msgstr at lines 14272–14273, where the translation introduces two
"%s"
placeholders.
3. From any list view that supports bulk actions (e.g., charts, dashboards,
datasets),
delete a selection that encounters a backend error, causing the server to
format this
msgid with a single argument (the object type or name).
4. Under RU locale, the translated string at 14273 expects two substitution
values but
only receives one; Python’s %-formatting raises a TypeError, and the
bulk-delete error
banner fails to render, leaving users without feedback on why deletion
failed.
```
</details>
[](https://app.codeant.ai/fix-in-ide?tool=cursor&prompt_id=d1c78d68fde34538b33d083f419ade66&service=github&base_url=https%3A%2F%2Fgithub.com&org=apache&repo=apache%2Fsuperset)
[](https://app.codeant.ai/fix-in-ide?tool=vscode-claude&prompt_id=d1c78d68fde34538b33d083f419ade66&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/ru/LC_MESSAGES/messages.po
**Line:** 14272:14273
**Comment:**
*Incorrect Variable Usage: The singular message was translated with two
`%s` placeholders while the source has one, which will trigger formatting
errors when rendered. Reduce the translation to a single `%s` placeholder to
match the source contract.
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%2F41885&comment_hash=fa7e2b05a9f807d1b302689154b67b71642781ec57e80a080bf8ae75c01fe664&reaction=like'>👍</a>
| <a
href='https://app.codeant.ai/feedback?pr_url=https%3A%2F%2Fgithub.com%2Fapache%2Fsuperset%2Fpull%2F41885&comment_hash=fa7e2b05a9f807d1b302689154b67b71642781ec57e80a080bf8ae75c01fe664&reaction=dislike'>👎</a>
##########
superset/translations/ru/LC_MESSAGES/messages.po:
##########
@@ -14563,26 +14233,23 @@ msgstr "Произошла ошибка при обновлении роли. П
msgid "There was an error updating the user. Please, try again."
msgstr ""
-"Произошла ошибка при обновлении пользователя. Пожалуйста, попробуйте еще "
-"раз."
+"Произошла ошибка при обновлении пользователя. Пожалуйста, попробуйте еще раз."
-#, fuzzy
msgid "There was an error while fetching groups"
-msgstr "Произошла ошибка при получении списка пользователей"
+msgstr "Произошла ошибка при получении групп"
-#, fuzzy
msgid "There was an error while fetching permissions"
-msgstr "Произошла ошибка при получении списка пользователей"
+msgstr "Произошла ошибка при получении прав"
msgid "There was an error while fetching users"
msgstr "Произошла ошибка при получении списка пользователей"
msgid "There was an error with your request"
msgstr "Произошла ошибка с вашим запросом"
-#, fuzzy, python-format
+#, python-format
msgid "There was an issue cancelling the task: %s"
-msgstr "Произошла ошибка при удалении %s: %s"
+msgstr "Произошла ошибка при удалении задачи %s: %s"
Review Comment:
**Suggestion:** This translation introduces an extra `%s` placeholder even
though the source message has only one, so formatting will fail with argument
count mismatch. Keep exactly one `%s` placeholder in the translated string.
[incorrect variable usage]
<details>
<summary><b>Severity Level:</b> Critical 🚨</summary>
```mdx
- ❌ Task cancellation errors crash RU error display.
- ⚠️ Administrators lose visibility into cancel failures.
```
</details>
<details>
<summary><b>Steps of Reproduction ✅ </b></summary>
```mdx
1. Configure Superset to use Russian locale (BABEL_DEFAULT_LOCALE="ru") and
enable the
Global Task Framework so task cancellation errors are surfaced to the UI.
2. Observe that the base message is defined in
/workspace/superset/superset/translations/messages.pot and the Russian
translation in
/workspace/superset/translations/ru/LC_MESSAGES/messages.po at lines
14252–14253, marked
with "#, python-format".
3. Trigger a task cancellation failure (for example, cancelling a
long-running background
task), which causes backend code to format the msgid "There was an issue
cancelling the
task: %s" with a single error string argument.
4. Under RU locale, Babel returns the msgstr at 14253 containing two "%s"
placeholders but
only one argument is supplied; Python’s %-formatting raises "TypeError: not
enough
arguments for format string", breaking error reporting for task cancellation.
```
</details>
[](https://app.codeant.ai/fix-in-ide?tool=cursor&prompt_id=fa622073725349e1bcacdd6c8b6bcca3&service=github&base_url=https%3A%2F%2Fgithub.com&org=apache&repo=apache%2Fsuperset)
[](https://app.codeant.ai/fix-in-ide?tool=vscode-claude&prompt_id=fa622073725349e1bcacdd6c8b6bcca3&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/ru/LC_MESSAGES/messages.po
**Line:** 14252:14253
**Comment:**
*Incorrect Variable Usage: This translation introduces an extra `%s`
placeholder even though the source message has only one, so formatting will
fail with argument count mismatch. Keep exactly one `%s` placeholder 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%2F41885&comment_hash=c1d01eb5a642cef041feccdec097475147072173c48cc1335b206be012aadbd8&reaction=like'>👍</a>
| <a
href='https://app.codeant.ai/feedback?pr_url=https%3A%2F%2Fgithub.com%2Fapache%2Fsuperset%2Fpull%2F41885&comment_hash=c1d01eb5a642cef041feccdec097475147072173c48cc1335b206be012aadbd8&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]