feat(ui): add in-UI language switcher with persisted preference - #1671
feat(ui): add in-UI language switcher with persisted preference#1671zhangweildlh wants to merge 1 commit into
Conversation
Support choosing UI language (Chinese / English / Follow browser) directly in the graph UI, persisting the choice to CBM_CONFIG_UI_LANG so it survives reloads. - http_server.c: handle POST /api/ui-config to persist ui-lang (en/zh/auto), echo lang_pref in GET - test_httpd.c: cover POST persistence and GET echo - i18n.ts: add UiLangPref, langOptionLabels, getUiLangPref, setUiLanguage - App.tsx: render a language select in the header - i18n.test.ts: cover setUiLanguage and option labels Non-breaking: default remains auto (follow browser Accept-Language). Fixes DeusData#1668 Signed-off-by: zhangweildlh <157947621@qq.com>
|
Thanks for opening this — it has been seen, and it is queued. This note is automated, but it is not a brush-off: it exists so you know where your PR stands instead of having to guess from silence. Current review status: working through a backlog. What that means for this PR, concretely:
Things that will genuinely speed it up whenever review does happen:
If this fixes a bug, a reproduction we can run is worth more than a description of the symptom. Thanks for contributing, and sorry in advance for the wait. |
|
Thank you for keeping this on the existing |
Summary
Add an in-UI language switcher to the graph UI so users can pick Chinese / English / Follow browser without editing config files or restarting. The choice persists to
CBM_CONFIG_UI_LANGand survives reloads.Changes
src/ui/http_server.c):POST /api/ui-confignow persistsui-lang(en/zh/auto) viacbm_config_set;GET /api/ui-configechoeslang_pref(en/zh/auto).tests/test_httpd.c): newui_server_ui_config_post_persists_langcovers POST persistence and GET echo.graph-ui/src/lib/i18n.ts): addUiLangPref,langOptionLabels,getUiLangPref,setUiLanguage(POST + re-render).graph-ui/src/App.tsx): render a language<select>in the header.graph-ui/src/lib/i18n.test.ts): coversetUiLanguageand option labels.Testing
tsc -bpasses;vitest9/9 pass (incl. new switcher tests).tests/test_httpd.cextended; compiled and run by upstream CI (this environment has no C toolchain, so CI validates the C side).Notes
auto(followAccept-Language). Nothing changes for existing users.CBM_CONFIG_UI_LANGmechanism (no new config keys).