feat(ui): add in-UI language switcher with persisted preference - #1671
Open
zhangweildlh wants to merge 1 commit into
Open
feat(ui): add in-UI language switcher with persisted preference#1671zhangweildlh wants to merge 1 commit into
zhangweildlh 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. |
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.
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).