Skip to content

fix(dashboard): add sub-command count label#8388

Merged
RC-CHN merged 1 commit into
AstrBotDevs:masterfrom
he-yufeng:fix/plugin-subcommands-count-i18n
May 28, 2026
Merged

fix(dashboard): add sub-command count label#8388
RC-CHN merged 1 commit into
AstrBotDevs:masterfrom
he-yufeng:fix/plugin-subcommands-count-i18n

Conversation

@he-yufeng

@he-yufeng he-yufeng commented May 28, 2026

Copy link
Copy Markdown
Contributor

Summary

  • add the missing detail.subCommandsCount translation used by the plugin detail command-group row
  • keep zh-CN, en-US, and ru-RU locale files in sync so the dashboard no longer renders [MISSING: features.extension.detail.subCommandsCount]

Fixes #8378

To verify

  • node -e JSON.parse(fs.readFileSync(...)) over the three extension locale files
  • npm run typecheck
  • git diff --check

Summary by Sourcery

Add the missing sub-commands count translation to the dashboard extension detail view and synchronize the affected locale files.

Bug Fixes:

  • Restore the missing features.extension.detail.subCommandsCount label so the dashboard no longer renders a missing-translation placeholder.

Enhancements:

  • Align en-US, zh-CN, and ru-RU extension locale files to keep translation keys consistent across languages.

@dosubot dosubot Bot added size:XS This PR changes 0-9 lines, ignoring generated files. area:webui The bug / feature is about webui(dashboard) of astrbot. labels May 28, 2026

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey - I've left some high level feedback:

  • Since this key now needs to stay in sync across multiple locale files, consider introducing a shared base locale or a generation script to reduce the risk of future divergence between en-US, zh-CN, and ru-RU.
  • For detail.subCommandsCount, verify whether any of the supported languages require locale-specific pluralization rules, and if so, consider using your i18n library's pluralization features instead of a single static label.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- Since this key now needs to stay in sync across multiple locale files, consider introducing a shared base locale or a generation script to reduce the risk of future divergence between en-US, zh-CN, and ru-RU.
- For `detail.subCommandsCount`, verify whether any of the supported languages require locale-specific pluralization rules, and if so, consider using your i18n library's pluralization features instead of a single static label.

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request adds a new localization key subCommandsCount to the English, Russian, and Chinese translation files. The reviewer pointed out that the translation strings for English and Russian do not handle pluralization correctly, which will lead to grammatically incorrect outputs for certain counts, and provided suggestions to use the proper i18n pluralization syntax.

"docsEmpty": "No documentation",
"changelogTitle": "Changelog",
"changelogEmpty": "No changelog",
"subCommandsCount": "{count} sub-commands",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The translation string "{count} sub-commands" does not handle pluralization. If there is only 1 sub-command, it will display as "1 sub-commands", which is grammatically incorrect. Consider using the pluralization syntax supported by the i18n library (such as vue-i18n's pipe | syntax).

Suggested change
"subCommandsCount": "{count} sub-commands",
"subCommandsCount": "{count} sub-command | {count} sub-commands",

"docsEmpty": "Документация отсутствует",
"changelogTitle": "Журнал изменений",
"changelogEmpty": "Журнал изменений отсутствует",
"subCommandsCount": "{count} подкоманд",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The translation string "{count} подкоманд" does not handle Russian pluralization rules. In Russian, nouns have different plural forms depending on the number (e.g., "1 подкоманда", "2 подкоманды", "5 подкоманд"). Using a single static string will result in grammatically incorrect phrases like "1 подкоманд" or "2 подкоманд". Consider using the pluralization syntax supported by the i18n library.

Suggested change
"subCommandsCount": "{count} подкоманд",
"subCommandsCount": "{count} подкоманда | {count} подкоманды | {count} подкоманд",

@dosubot dosubot Bot added the lgtm This PR has been approved by a maintainer label May 28, 2026
@RC-CHN RC-CHN merged commit 9688a64 into AstrBotDevs:master May 28, 2026
21 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:webui The bug / feature is about webui(dashboard) of astrbot. lgtm This PR has been approved by a maintainer size:XS This PR changes 0-9 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]插件详情页 i18n key 缺失导致显示 [MISSING]

3 participants