功能: 添加前端国际化支持(i18n + zh-CN 中文翻译)#442
Open
BAYUNZIYUE wants to merge 8 commits into
Open
Conversation
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.
概述
为 FSM 前端添加国际化框架(基于 react-i18next + i18next),并提供完整的简体中文(zh-CN)翻译。
改动内容
新增
ui/i18n.js— i18next 初始化配置(自动检测浏览器语言,en/zh-CN 双语言)ui/locales/en/— 9 个命名空间的英文翻译文件(权威源)ui/locales/zh-CN/— 9 个命名空间的简体中文翻译文件docs/add-language-guide.md— 添加新语言适配指南修改
ui/index.js— 包裹 Suspense + i18n Providerui/App/components/ConfirmDialog.jsx— 按钮文本国际化ui/App/components/Layout.jsx— 侧边栏全国际化 + 语言切换器ui/App/views/Controls.jsx— 控制面板国际化ui/App/views/Mods/*(7 文件) — 模组管理国际化ui/App/views/Saves/*(3 文件) — 存档管理国际化ui/App/views/ServerSettings.jsx— 服务器设置国际化ui/App/views/GameSettings.jsx— 游戏设置国际化ui/App/views/Console.jsx— 控制台国际化ui/App/views/Logs.jsx— 日志国际化ui/App/views/Login.jsx— 登录页国际化ui/App/views/Help.jsx— 帮助页国际化ui/App/views/UserManagement/*(3 文件) — 用户管理国际化package.json/package-lock.json— 新增 i18n 依赖设计文档
docs/superpowers/specs/2026-06-21-fsm-i18n-design.mddocs/superpowers/plans/2026-06-21-fsm-i18n-implementation.md功能特性
npm run build编译通过零错误扩展新语言
只需 3 步:复制 en/ 文件夹 → 翻译 JSON → 在 i18n.js 和 Layout.jsx 各注册 1 行。
详见
docs/add-language-guide.md。