Repository navigation
feat(i18n): Simplified Chinese locale across the dashboard - #200
HartleyLau wants to merge 1 commit into
Conversation
Add an i18next-based zh-CN translation of the whole dashboard UI: sidebar, overview, spark detail panels, Tokens/Energy/Activity pages, showcase, all four benchmark pages (forms, tables, legends, empty states), the tool-eval simple and advanced forms (via a te.* group mirroring the server option spec), settings dialog with all help texts, add-model and confirm dialogs, and the mobile tab bar. - src/i18n: i18next setup (synchronous init, language persisted in localStorage, sparkdash:language event), en.ts as the key source of truth, zh-CN.ts, plus a module-scope t export for components outside the hook lifecycle - Wire t() through every user-facing surface; interpolation placeholders preserved; Spark/Hermes/GSM8K/MMLU etc. kept as proper nouns - scripts/i18n-translate.mjs: optional helper that translates missing zh-CN keys via any OpenAI-compatible endpoint (LM Studio / Hunyuan-MT), preserving placeholders; run with --dry to preview English strings remain the fallback: en.ts stays the reference, and any missing or future key renders in English automatically.
|
Thanks for the translation work. It cannot be merged as it stands: (Review notes prepared with Claude Code on behalf of the maintainer.) |
|
Maintainer note on direction: there are now two competing zh-CN approaches (#194 and this PR), and both rely on new i18n dependencies, which we have not decided to add. We would like to settle the i18n approach once (which loader and dependencies, how catalogs are split, how new strings are kept translated) and then review one small foundation PR before any locale catalogs. Until then neither can be merged; please do not spend more effort rebasing. We will post the decision on #194. (Review notes prepared with Claude Code on behalf of the maintainer.) |
|
Status check at 865e3e1: nothing has changed on the blockers noted on 2026-10-12. It imports (Review notes prepared with Claude Code on behalf of the maintainer.) |
|
Maintainer decision on the i18n direction (applies to #194 and #200): one loader, (Review notes prepared with Claude Code on behalf of the maintainer.) |
|
Status at 865e3e1: unchanged, and it now conflicts with main in 14 files (Overview, Settings, GpuPanel and the bench components). Under the 2026-10-15 decision the shape is a small foundation PR first, which is #226, then zh-CN catalogs in follow-ups of reviewable size; this 112-file branch, with its i18n imports not declared in (Review notes prepared with Claude Code on behalf of the maintainer.) |
|
Status at 865e3e1: unchanged, and it now conflicts with main in 14 files including (Review notes prepared with Claude Code on behalf of the maintainer.) |
|
Status at 865e3e1: unchanged, and it conflicts with main (448944c) in 14+ files including (Review notes prepared with Claude Code on behalf of the maintainer.) |
|
Rechecked 865e3e1 against main 00151b5; this branch has 20 merge conflicts. |
|
This branch has 21 conflicting files against current main. Its i18n entry imports i18next and react-i18next ( |
|
Update: the foundation PR #226 is now on main as 0ae456c ( |
Summary
Adds a complete Simplified Chinese (zh-CN) translation of the dashboard UI via i18next, with English kept as the fallback locale.
What's included
src/i18n): synchronous i18next init (no Suspense flash), language persisted per browser, asparkdash:languageevent for cross-component switches, and a module-scopetexport for components outside the hook lifecyclete.*translation key with the server string asdefaultValuefallback — new server-side options degrade gracefully to Englishscripts/i18n-translate.mjs: an optional helper that translates missing zh-CN keys through any OpenAI-compatible endpoint (developed against LM Studio + Hunyuan-MT), preserving interpolation placeholders;--drypreviewsNotes
en.tsremains the key source of truth; missing or future keys render in English automaticallyScreenshots
Overview / Tool Eval (simple) / Tool Eval (advanced) all render fully in zh-CN with the language switch in Settings.
摘要
通过 i18next 为仪表盘全部界面添加简体中文翻译,英文作为回退语言。覆盖侧栏、总览、节点详情、Token 统计、能耗、活动、演示页、四个基准测试页(含工具评测的简单与高级表单)、设置弹窗与各类对话框;
scripts/i18n-translate.mjs为可选的机翻辅助脚本。专有名词(Spark、Hermes、GSM8K 等)保持原文。