fix: 为前端的EdgeTTS,Gemini TTS,GSVI TTS(API)适配器添加i18n#5403
fix: 为前端的EdgeTTS,Gemini TTS,GSVI TTS(API)适配器添加i18n#5403Li-shi-ling wants to merge 10 commits intoAstrBotDevs:masterfrom
Conversation
Summary of ChangesHello @Li-shi-ling, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! 此拉取请求旨在解决前端EdgeTTS、Gemini TTS和GSVI TTS(API)适配器缺少国际化支持的问题。通过在后端配置默认文件中添加新的TTS服务配置项,并同步更新前端的多语言配置文件,确保了这些文本转语音服务的配置选项能够以用户选择的语言正确显示和理解。这提升了应用程序的用户体验和可访问性,使得不同语言的用户都能轻松配置和使用这些TTS功能。 Highlights
Changelog
Activity
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Hey - 我发现了 1 个问题,并且给出了一些整体层面的反馈:
- 在
default.py中新增的配置项描述和提示目前都直接写成了中文;建议保持default.py与语言无关(language-neutral),把所有面向用户的文本都移到 i18n JSON 中,这样描述才可以被正确本地化。 - 新增的一些键,比如
character、emotion、rate、volume和pitch,都比较通用,在共享配置命名空间中可能会有歧义;建议通过前缀或命名空间进行区分(例如gsvitts_character、edge_tts_rate),以提高清晰度并避免命名冲突。 edge-tts-voice这个键使用了连字符(hyphen),而其他选项使用的是下划线;统一命名规范(例如改为edge_tts_voice)可以提升各配置字段之间的一致性。
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- The new config item descriptions and hints added in `default.py` are all hardcoded in Chinese; consider keeping `default.py` language-neutral and moving human-facing text entirely into the i18n JSONs so that descriptions can be localized properly.
- Some of the newly added keys like `character`, `emotion`, `rate`, `volume`, and `pitch` are quite generic and may be ambiguous in a shared config namespace; consider prefixing or namespacing them (e.g., `gsvitts_character`, `edge_tts_rate`) for clarity and to avoid collisions.
- The `edge-tts-voice` key uses a hyphen while other options use underscores; aligning the naming convention (e.g., `edge_tts_voice`) would improve consistency across configuration fields.
## Individual Comments
### Comment 1
<location path="astrbot/core/config/default.py" line_range="1537-1541" />
<code_context>
},
},
"items": {
+ "gemini_tts_api_key": {
+ "description": "Google Gemini TTS API 密钥",
+ "type": "string",
+ "hint": "请在 Google Cloud Console 获取 Gemini TTS API 密钥,用于身份验证和服务调用。",
+ },
+ "gemini_tts_api_base": {
</code_context>
<issue_to_address>
**🚨 suggestion (security):** 考虑在配置 schema 中将 Gemini TTS API 密钥标记为机密/敏感字段。
如果配置 schema 支持 `secret` / `is_password`(或类似)的标记,请将 `gemini_tts_api_key` 标记为敏感字段,这样界面可以对其做遮挡显示,降低意外泄露的风险(例如日志或截图中被暴露),并与其他 API 密钥的处理方式保持一致。
```suggestion
"gemini_tts_api_key": {
"description": "Google Gemini TTS API 密钥",
"type": "string",
"hint": "请在 Google Cloud Console 获取 Gemini TTS API 密钥,用于身份验证和服务调用。",
"secret": True,
},
```
</issue_to_address>帮我变得更有用!请在每条评论上点 👍 或 👎,我会根据你的反馈来改进之后的代码评审。
Original comment in English
Hey - I've found 1 issue, and left some high level feedback:
- The new config item descriptions and hints added in
default.pyare all hardcoded in Chinese; consider keepingdefault.pylanguage-neutral and moving human-facing text entirely into the i18n JSONs so that descriptions can be localized properly. - Some of the newly added keys like
character,emotion,rate,volume, andpitchare quite generic and may be ambiguous in a shared config namespace; consider prefixing or namespacing them (e.g.,gsvitts_character,edge_tts_rate) for clarity and to avoid collisions. - The
edge-tts-voicekey uses a hyphen while other options use underscores; aligning the naming convention (e.g.,edge_tts_voice) would improve consistency across configuration fields.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- The new config item descriptions and hints added in `default.py` are all hardcoded in Chinese; consider keeping `default.py` language-neutral and moving human-facing text entirely into the i18n JSONs so that descriptions can be localized properly.
- Some of the newly added keys like `character`, `emotion`, `rate`, `volume`, and `pitch` are quite generic and may be ambiguous in a shared config namespace; consider prefixing or namespacing them (e.g., `gsvitts_character`, `edge_tts_rate`) for clarity and to avoid collisions.
- The `edge-tts-voice` key uses a hyphen while other options use underscores; aligning the naming convention (e.g., `edge_tts_voice`) would improve consistency across configuration fields.
## Individual Comments
### Comment 1
<location path="astrbot/core/config/default.py" line_range="1537-1541" />
<code_context>
},
},
"items": {
+ "gemini_tts_api_key": {
+ "description": "Google Gemini TTS API 密钥",
+ "type": "string",
+ "hint": "请在 Google Cloud Console 获取 Gemini TTS API 密钥,用于身份验证和服务调用。",
+ },
+ "gemini_tts_api_base": {
</code_context>
<issue_to_address>
**🚨 suggestion (security):** Consider marking the Gemini TTS API key as a secret/sensitive field in the config schema.
If the config schema supports a `secret`/`is_password` (or similar) flag, please mark `gemini_tts_api_key` as sensitive so UIs can mask it and reduce the risk of accidental exposure (e.g., in logs or screenshots), consistent with other API keys.
```suggestion
"gemini_tts_api_key": {
"description": "Google Gemini TTS API 密钥",
"type": "string",
"hint": "请在 Google Cloud Console 获取 Gemini TTS API 密钥,用于身份验证和服务调用。",
"secret": True,
},
```
</issue_to_address>Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
|
astrbot/core/agent/handoff.py是被ruff改的! |
额,能指出来在哪吗? |
我用编译器检查了,没有json格式错误啊 |
|
对于命名空间的问题 |

前端的EdgeTTS,Gemini TTS,GSVI TTS(API)缺少i18n文件的注册
这个修改添加了其对应的i18n
Fixed #5390
Modifications / 改动点
修改了
astrbot\core\config\default.py
dashboard\src\i18n\locales\en-US\features\config-metadata.json
dashboard\src\i18n\locales\zh-CN\features\config-metadata.json
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.没有新依赖库
没有恶意代码