feat: add Traditional Chinese translation#7095
feat: add Traditional Chinese translation#7095ZvZPvz wants to merge 6 commits intoAstrBotDevs:masterfrom
Conversation
There was a problem hiding this comment.
Hey - I've left some high level feedback:
- The list of supported locales (
['zh-CN', 'zh-HK', 'zh-TW', 'en-US', 'ru-RU']) is duplicated in multiple places; consider extracting it to a shared constant or config to avoid divergent updates in the future. - You might want to define a fallback strategy between
zh-CN,zh-HK, andzh-TW(e.g., when a key is missing in a regional variant) so that untranslated strings don’t silently break the UI.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- The list of supported locales (`['zh-CN', 'zh-HK', 'zh-TW', 'en-US', 'ru-RU']`) is duplicated in multiple places; consider extracting it to a shared constant or config to avoid divergent updates in the future.
- You might want to define a fallback strategy between `zh-CN`, `zh-HK`, and `zh-TW` (e.g., when a key is missing in a regional variant) so that untranslated strings don’t silently break the UI.Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
|
Warning Gemini is experiencing higher than usual traffic and was unable to create the review. Please try again in a few hours by commenting |
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request adds support for Traditional Chinese (Hong Kong and Taiwan) by introducing new locale files and updating the i18n configuration. Feedback highlights that several files in the new locales incorrectly use Simplified Chinese or contain untranslated English and Cantonese mixed text. A refactoring is also suggested to centralize the available locales list into a module-level constant to improve code maintainability and reduce duplication.
|
/gemini review |
|
Warning Gemini is experiencing higher than usual traffic and was unable to create the review. Please try again in a few hours by commenting |
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request introduces Traditional Chinese translations for both Hong Kong (zh-HK) and Taiwan (zh-TW) locales, updating the translation configuration accordingly. My review highlights several issues: the zh-HK translation contains significant mixed English and informal Cantonese, which should be standardized to formal written Chinese; the language list should be centralized to improve maintainability; and two session-management files contain unnecessary Byte Order Marks (BOM) that should be removed.
| // 从localStorage获取保存的语言设置 | ||
| const savedLocale = localStorage.getItem('astrbot-locale') as Locale; | ||
| const initialLocale = savedLocale && ['zh-CN', 'en-US', 'ru-RU'].includes(savedLocale) | ||
| const initialLocale = savedLocale && ['zh-CN', 'zh-HK', 'zh-TW', 'en-US', 'ru-RU'].includes(savedLocale) |
Modifications / 改动点
新增繁体中文(香港)和繁体中文(台湾)的本地化支持
Screenshots or Test Results / 运行截图或测试结果
Checklist / 检查清单
😊 If there are new features added in the PR, I have discussed it with the authors through issues/emails, etc.
/ 如果 PR 中有新加入的功能,已经通过 Issue / 邮件等方式和作者讨论过。
👀 My changes have been well-tested, and "Verification Steps" and "Screenshots" have been provided above.
/ 我的更改经过了良好的测试,并已在上方提供了“验证步骤”和“运行截图”。
🤓 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.txtandpyproject.toml./ 我确保没有引入新依赖库,或者引入了新依赖库的同时将其添加到
requirements.txt和pyproject.toml文件相应位置。😮 My changes do not introduce malicious code.
/ 我的更改没有引入恶意代码。
Summary by Sourcery
Add Traditional Chinese (Hong Kong and Taiwan) localization support across the dashboard and expose these locales in the language selection and initialization logic.
New Features: