nese (zh-CN) localization support - #140
Open
ziyu121 wants to merge 1 commit into
Open
Conversation
- 添加完整的简体中文翻译文件 (zh-CN.json) - 所有界面文本使用 i18next 翻译函数 - 修正 70+ 个文件中的硬编码英文 - 支持通过浏览器语言自动切换 (zh-CN) - 新增 I18nProvider 客户端组件 - 安装 i18next, react-i18next, i18next-browser-languagedetector 涉及范围: - 侧边栏、首页、设置、任务、协议、动态 - 连接器、技能、质量、MCP 服务器 - 所有 layout 文件 - 通用组件 (命令面板、搜索、快捷键、确认对话框等) 测试: - npm run dev 正常运行 - 所有界面正常显示中文
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.
添加简体中文本地化支持
Changes
zh-CN.jsonSimplified Chinese translation filet()translation functionzh-CNis setI18nProviderclient component for Next.js App Router compatibilityScope
layout.tsxfilesTesting
npm run devruns without errorsen.json) works properly when neededTechnical Details
Uses
i18next+react-i18nextframeworkTranslation files located at
src/i18n/locales/All text loaded via
t('key')function callsNotes
en.jsonremains as the fallback languageUsers with
zh-CNbrowser language will see Chinese automaticallyExtensibility
This PR sets up a fully functional i18n infrastructure that makes adding new languages straightforward:
-Adding a new language** only requires:
en.jsonto a new locale file (e.g.,fr.json,es.json,ja.json)resourcesobject insrc/i18n/index.ts-No code changes** needed in UI components when adding new languages
All text is centralized in JSON files, making translation management easy
修改内容
新增完整的
zh-CN.json简体中文翻译文件所有界面文本已替换为
t()翻译函数修正 70+ 个文件中的硬编码英文文本
支持浏览器语言自动检测 (zh-CN)
新增
I18nProvider客户端组件,兼容 Next.js App Router涉及范围
侧边栏、首页、设置、任务、协议、动态
测试
npm run dev正常运行,无编译错误en.json) 正常工作技术实现
i18next+react-i18next框架src/i18n/目录管理翻译文件t('key')方式加载