fix: localize provider source config UI#4933
Merged
Soulter merged 7 commits intoAstrBotDevs:masterfrom Feb 8, 2026
Merged
Conversation
Contributor
There was a problem hiding this comment.
Hey - 我在这里给出了一些总体反馈:
- 在
convert_to_i18n_keys中,新的convert_items辅助函数只会向下传递选定的键(description、hint、labels、name、items、template_schema),并会丢弃 item 字段上的其他自定义属性(例如options、slider或未来可能新增的标志位);建议像之前那样显式将这些已知属性加入白名单并保留它们,以避免悄悄丢失元数据。 - 现在
providerTypes是一个 computed 值,需确保所有使用它的地方都把它当作响应式数据来处理(例如在脚本中使用.value,只在模板中直接使用);或者,如果你实际上不需要它在 JS 层面保持响应式,考虑将其重命名为providerTypeOptions,并让它作为一个由 computed 翻译映射派生出来的普通数组。
提供给 AI 代理的提示词
Please address the comments from this code review:
## Overall Comments
- In `convert_to_i18n_keys`, the new `convert_items` helper only propagates selected keys (`description`, `hint`, `labels`, `name`, `items`, `template_schema`) and drops any other custom attributes on item fields (e.g. `options`, `slider`, or future flags); consider explicitly whitelisting and preserving those known attributes as was done before to avoid silently losing metadata.
- Now that `providerTypes` is a computed, ensure all its usages treat it as reactive (e.g. `.value` in script, direct use only in templates) or consider renaming it to `providerTypeOptions` and keeping it as a plain array derived from a computed translation map if you don't actually need it to be reactive at the JS level.帮我变得更有用!请在每条评论上点击 👍 或 👎,我会根据你的反馈改进之后的评审。
Original comment in English
Hey - I've left some high level feedback:
- In
convert_to_i18n_keys, the newconvert_itemshelper only propagates selected keys (description,hint,labels,name,items,template_schema) and drops any other custom attributes on item fields (e.g.options,slider, or future flags); consider explicitly whitelisting and preserving those known attributes as was done before to avoid silently losing metadata. - Now that
providerTypesis a computed, ensure all its usages treat it as reactive (e.g..valuein script, direct use only in templates) or consider renaming it toproviderTypeOptionsand keeping it as a plain array derived from a computed translation map if you don't actually need it to be reactive at the JS level.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- In `convert_to_i18n_keys`, the new `convert_items` helper only propagates selected keys (`description`, `hint`, `labels`, `name`, `items`, `template_schema`) and drops any other custom attributes on item fields (e.g. `options`, `slider`, or future flags); consider explicitly whitelisting and preserving those known attributes as was done before to avoid silently losing metadata.
- Now that `providerTypes` is a computed, ensure all its usages treat it as reactive (e.g. `.value` in script, direct use only in templates) or consider renaming it to `providerTypeOptions` and keeping it as a plain array derived from a computed translation map if you don't actually need it to be reactive at the JS level.Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
Contributor
Author
|
platform也有漏网吗,让我看一下 |
Contributor
Author
|
@Soulter 平台消息类别下的各平台名称我没有做更改,若要更改的话有些复杂可能引入未知问题,其次是我认为平台名称本身就是其官方名称,没有再行翻译的必要性 |
Soulter
approved these changes
Feb 8, 2026
united-pooh
pushed a commit
to united-pooh/AstrBot
that referenced
this pull request
Feb 19, 2026
* fix: localize provider source ui * feat: localize provider metadata keys * chore: add provider metadata translations * chore: format provider i18n changes * fix: preserve metadata fields in i18n conversion * fix: internationalize platform config and dialog * fix: add Weixin official account platform icon --------- Co-authored-by: Soulter <905617992@qq.com>
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.

在模型提供商源配置界面中,多处文案未接入 i18n,且 provider 高级配置使用旧元数据导致中英文混杂、语言切换不生效。此改动
统一对 provider 元数据做 i18n 转换并补齐中英文资源,使配置页在中英文环境下正常展示。
Modifications / 改动点
后端:复用 ConfigMetadataI18n 转换 provider 元数据(包含嵌套 items/template_schema),并保持 config_template 不丢
失。
前端:AstrBotConfig.vue 支持 i18n key 翻译;provider tabs 文案在语言切换时可响应更新;provider source “新增”按钮接入
i18n。
资源:补齐 provider_group 配置项的中英文翻译,包括 gm_thinking_config / anth_thinking_config 等高级配置项。
This is NOT a breaking change. / 这不是一个破坏性变更。
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
本地化提供方来源配置的元数据和 UI,使后端元数据与前端面板在 i18n 上得到正确支持。
Bug Fixes:
Enhancements:
Chores:
Original summary in English
Summary by Sourcery
Localize provider source configuration metadata and UI to correctly support i18n across backend metadata and frontend panels.
Bug Fixes:
Enhancements:
Chores: