Skip to content

Conversation

@RC-CHN
Copy link
Member

@RC-CHN RC-CHN commented Jan 5, 2026

  • 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

修复了面板上一部分未使用i18n的部分,添加相关翻译项。

Modifications / 改动点

  • This is NOT a breaking change. / 这不是一个破坏性变更。

Screenshots or Test Results / 运行截图或测试结果

image image image

Checklist / 检查清单

  • 😊 如果 PR 中有新加入的功能,已经通过 Issue / 邮件等方式和作者讨论过。/ If there are new features added in the PR, I have discussed it with the authors through issues/emails, etc.
  • 👀 我的更改经过了良好的测试,并已在上方提供了“验证步骤”和“运行截图”。/ My changes have been well-tested, and "Verification Steps" and "Screenshots" have been provided above.
  • 🤓 我确保没有引入新依赖库,或者引入了新依赖库的同时将其添加到了 requirements.txtpyproject.toml 文件相应位置。/ I have ensured that no new dependencies are introduced, OR if new dependencies are introduced, they have been added to the appropriate locations in requirements.txt and pyproject.toml.
  • 😮 我的更改没有引入恶意代码。/ My changes do not introduce malicious code.

Summary by Sourcery

改进共享仪表盘组件及相关配置选择器的国际化覆盖率。

Bug Fixes:

  • 将共享仪表盘组件中硬编码的中文 UI 文本替换为基于 i18n 的翻译。
  • 通过清除硬编码的中文默认属性文本,使共享选择器组件能够依赖 i18n。

Enhancements:

  • 为 T2I 模板编辑器、角色选择器、插件集选择器、提供方选择器、知识库选择器、代理选择器以及列表配置项等共享组件添加模块级的 i18n 使用方式。
  • 为共享组件、通用操作以及网络代理设置扩展本地化字典中缺失的键,以支持完整的多语言 UI。
Original summary in English

Summary by Sourcery

Improve internationalization coverage for shared dashboard components and related configuration selectors.

Bug Fixes:

  • Replace hardcoded Chinese UI strings in shared dashboard components with i18n-backed translations.
  • Allow shared selector components to rely on i18n by clearing hardcoded Chinese default prop texts.

Enhancements:

  • Add module-scoped i18n usage for shared components such as T2I template editor, persona selector, plugin set selector, provider selector, knowledge base selector, proxy selector, and list config items.
  • Extend locale dictionaries with missing keys for shared components, common actions, and network proxy settings to support full multilingual UI.

- 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
@auto-assign auto-assign bot requested review from Fridemn and Raven95676 January 5, 2026 00:59
@dosubot dosubot bot added size:L This PR changes 100-499 lines, ignoring generated files. area:webui The bug / feature is about webui(dashboard) of astrbot. labels Jan 5, 2026
Copy link
Contributor

@sourcery-ai sourcery-ai bot left a 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,现在 buttonTextdialogTitle 默认值为空字符串,建议添加基于 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>

Sourcery 对开源项目免费——如果你觉得这些评论有帮助,欢迎分享 ✨
帮我变得更有用!请在每条评论上点 👍 或 👎,我会根据你的反馈改进后续的评审质量。
Original comment in English

Hey - I've found 1 issue, and left some high level feedback:

  • 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.
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>

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.

@RC-CHN
Copy link
Member Author

RC-CHN commented Jan 5, 2026

顺带想了想napcat可能需要一个比较稳定的环境,给k8s部署方式加了个自用的简单固定主机名和初次启动生成machine id

@dosubot dosubot bot added the lgtm This PR has been approved by a maintainer label Jan 5, 2026
@Soulter Soulter merged commit 9bcf9bf into AstrBotDevs:master Jan 5, 2026
6 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:L This PR changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants