-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
fix(dashboard): complete i18n support for shared components #4327
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- Replace hardcoded Chinese strings with i18n translations in: - PluginSetSelector.vue - ProviderSelector.vue - PersonaSelector.vue - KnowledgeBaseSelector.vue - T2ITemplateEditor.vue - AstrBotConfigV4.vue - ConfigItemRenderer.vue - ProxySelector.vue - ListConfigItem.vue - Add missing translations to locale files: - core/shared.json: personaSelector, t2iTemplateEditor - core/common.json: autoDetect - features/settings.json: network.proxySelector - Change prop defaults from hardcoded Chinese to empty strings, allowing components to use i18n fallback translations
Contributor
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey - 我发现了 1 个问题,并给出了一些总体反馈:
- 对于
ListConfigItem.vue,现在buttonText和dialogTitle默认值为空字符串,建议添加基于 i18n 的兜底文案(类似其他 selector 组件),这样这些 props 即使在调用方未显式传入时,也依然有合理的默认值。 - 在
PersonaSelector.vue中,你新增加了一个单独的personaSelector.cancelSelection文案键,而其他对话框复用的是core.common.cancel/confirm;建议这里也复用这些公共键,以便在所有对话框中保持一致性。
给 AI Agent 的提示词
Please address the comments from this code review:
## Overall Comments
- For `ListConfigItem.vue`, now that `buttonText` and `dialogTitle` default to empty strings, consider adding i18n-backed fallbacks (similar to the selector components) so these props still have sensible defaults without relying on callers.
- In `PersonaSelector.vue`, you introduced a dedicated `personaSelector.cancelSelection` key while other dialogs reuse `core.common.cancel`/`confirm`; consider reusing the shared common keys here as well for consistency across dialogs.
## Individual Comments
### Comment 1
<location> `dashboard/src/components/shared/AstrBotConfigV4.vue:236` </location>
<code_context>
<div v-if="createSelectorModel(itemKey).value && createSelectorModel(itemKey).value.length > 0"
class="selected-plugins-full-width">
<div class="plugins-header">
- <small class="text-grey">已选择的插件:</small>
+ <small class="text-grey">{{ t('core.shared.pluginSetSelector.selectedPluginsLabel') }}:</small>
</div>
<div class="d-flex flex-wrap ga-2 mt-2">
</code_context>
<issue_to_address>
**suggestion:** 将特定语言的标点放在翻译之外会降低本地化的灵活性。
当前模板中冒号仍然是硬编码的,而只有标签文本被本地化,这会把 UI 绑定到中文的全角冒号形式。建议将冒号移入翻译字符串中,这样每个语言环境就可以自行决定使用什么标点和空格格式。
建议实现方式:
```
<div class="plugins-header">
<small class="text-grey">{{ t('core.shared.pluginSetSelector.selectedPluginsLabel') }}</small>
</div>
```
要完整实现这一建议,请更新你的 i18n 资源文件,使 `core.shared.pluginSetSelector.selectedPluginsLabel` 在各个语言环境中都包含适当的标点,例如:
- Chinese: `"selectedPluginsLabel": "已选择的插件:"`
- English: `"selectedPluginsLabel": "Selected plugins:"`
</issue_to_address>帮我变得更有用!请在每条评论上点 👍 或 👎,我会根据你的反馈改进后续的评审质量。
Original comment in English
Hey - I've found 1 issue, and left some high level feedback:
- For
ListConfigItem.vue, now thatbuttonTextanddialogTitledefault to empty strings, consider adding i18n-backed fallbacks (similar to the selector components) so these props still have sensible defaults without relying on callers. - In
PersonaSelector.vue, you introduced a dedicatedpersonaSelector.cancelSelectionkey while other dialogs reusecore.common.cancel/confirm; consider reusing the shared common keys here as well for consistency across dialogs.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- For `ListConfigItem.vue`, now that `buttonText` and `dialogTitle` default to empty strings, consider adding i18n-backed fallbacks (similar to the selector components) so these props still have sensible defaults without relying on callers.
- In `PersonaSelector.vue`, you introduced a dedicated `personaSelector.cancelSelection` key while other dialogs reuse `core.common.cancel`/`confirm`; consider reusing the shared common keys here as well for consistency across dialogs.
## Individual Comments
### Comment 1
<location> `dashboard/src/components/shared/AstrBotConfigV4.vue:236` </location>
<code_context>
<div v-if="createSelectorModel(itemKey).value && createSelectorModel(itemKey).value.length > 0"
class="selected-plugins-full-width">
<div class="plugins-header">
- <small class="text-grey">已选择的插件:</small>
+ <small class="text-grey">{{ t('core.shared.pluginSetSelector.selectedPluginsLabel') }}:</small>
</div>
<div class="d-flex flex-wrap ga-2 mt-2">
</code_context>
<issue_to_address>
**suggestion:** Embedding locale-specific punctuation outside the translation makes localization less flexible.
The colon remains hard-coded in the template while only the label is localized, tying the UI to a Chinese-style full-width colon. Move the colon into the translation string so each locale can choose its own punctuation and spacing.
Suggested implementation:
```
<div class="plugins-header">
<small class="text-grey">{{ t('core.shared.pluginSetSelector.selectedPluginsLabel') }}</small>
</div>
```
To fully implement the suggestion, update your i18n resource files so that `core.shared.pluginSetSelector.selectedPluginsLabel` includes the appropriate punctuation for each locale, for example:
- Chinese: `"selectedPluginsLabel": "已选择的插件:"`
- English: `"selectedPluginsLabel": "Selected plugins:"`
</issue_to_address>Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
Member
Author
|
顺带想了想napcat可能需要一个比较稳定的环境,给k8s部署方式加了个自用的简单固定主机名和初次启动生成machine id |
Soulter
approved these changes
Jan 5, 2026
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:L
This PR changes 100-499 lines, ignoring generated files.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Replace hardcoded Chinese strings with i18n translations in:
Add missing translations to locale files:
Change prop defaults from hardcoded Chinese to empty strings, allowing components to use i18n fallback translations
修复了面板上一部分未使用i18n的部分,添加相关翻译项。
Modifications / 改动点
Screenshots or Test Results / 运行截图或测试结果
Checklist / 检查清单
requirements.txt和pyproject.toml文件相应位置。/ I have ensured that no new dependencies are introduced, OR if new dependencies are introduced, they have been added to the appropriate locations inrequirements.txtandpyproject.toml.Summary by Sourcery
改进共享仪表盘组件及相关配置选择器的国际化覆盖率。
Bug Fixes:
Enhancements:
Original summary in English
Summary by Sourcery
Improve internationalization coverage for shared dashboard components and related configuration selectors.
Bug Fixes:
Enhancements: