Skip to content

feat: add i18n multi-language support (English + Chinese) 添加国际化支持,包含中文翻译#125

Merged
lcomplete merged 3 commits intolcomplete:devfrom
GSAlex:feature/i18n-support
Mar 21, 2026
Merged

feat: add i18n multi-language support (English + Chinese) 添加国际化支持,包含中文翻译#125
lcomplete merged 3 commits intolcomplete:devfrom
GSAlex:feature/i18n-support

Conversation

@GSAlex
Copy link
Copy Markdown
Contributor

@GSAlex GSAlex commented Mar 20, 2026

Summary / 概述

Add internationalization (i18n) support to the Huntly web client, with complete English and Chinese (zh-CN) translations.

为 Huntly Web 客户端添加国际化(i18n)支持,包含完整的英文和中文(zh-CN)翻译。

Changes / 变更内容

i18n Infrastructure / i18n 基础设施

  • Integrate react-i18next, i18next, and i18next-browser-languagedetector

  • Add i18n initialization config at app/client/src/i18n/index.ts

  • Auto-detect user's browser language with localStorage caching

  • 集成 react-i18nexti18nexti18next-browser-languagedetector

  • app/client/src/i18n/index.ts 中添加 i18n 初始化配置

  • 自动检测用户浏览器语言,并通过 localStorage 缓存语言偏好

Translation Files / 翻译文件

Add structured JSON translation files for both en and zh-CN .

enzh-CN 两种语言添加结构化 JSON 翻译文件

Component Migration / 组件迁移

Migrate all hardcoded strings to useTranslation() / t() calls across:

将所有硬编码字符串迁移为 useTranslation() / t() 调用,涉及:

  • Navigation sidebar and feeds tree / 导航侧边栏及订阅源树
  • Settings modal (all tabs) / 设置弹窗(所有标签页)
  • Home, Highlights, Search, and SignIn pages / 首页、高亮、搜索、登录页
  • Article preview and magazine item components / 文章预览及杂志列表组件
  • Sub-header and common UI elements / 副标题及公共 UI 元素

Language Switcher / 语言切换

  • Add a language dropdown in Settings > General for users to switch between English and 中文
  • 设置 > 通用中添加语言下拉菜单,支持在 English 和中文之间切换

GSAlex added 3 commits March 20, 2026 14:50
- Add react-i18next, i18next, i18next-browser-languagedetector
- Create i18n initialization with browser language detection
- Add 5 translation namespaces: common, navigation, settings, page, auth
- Add English and Chinese (zh-CN) translation files
- Migrate PrimaryNavigation, SubHeader, NavLabels to i18n
- Migrate SettingModal tabs and GeneralSetting to i18n
- Add language switcher dropdown in Settings > General
- Migrate SignIn page to i18n
@GSAlex GSAlex mentioned this pull request Mar 20, 2026
@lcomplete lcomplete merged commit 41525f2 into lcomplete:dev Mar 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants