Skip to content

feat(ui): add in-UI language switcher with persisted preference - #1671

Open
zhangweildlh wants to merge 1 commit into
DeusData:mainfrom
zhangweildlh:feat-ui-lang-switcher
Open

feat(ui): add in-UI language switcher with persisted preference#1671
zhangweildlh wants to merge 1 commit into
DeusData:mainfrom
zhangweildlh:feat-ui-lang-switcher

Conversation

@zhangweildlh

Copy link
Copy Markdown

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_LANG and survives reloads.

Changes

  • C (src/ui/http_server.c): POST /api/ui-config now persists ui-lang (en/zh/auto) via cbm_config_set; GET /api/ui-config echoes lang_pref (en/zh/auto).
  • C tests (tests/test_httpd.c): new ui_server_ui_config_post_persists_lang covers POST persistence and GET echo.
  • TS (graph-ui/src/lib/i18n.ts): add UiLangPref, langOptionLabels, getUiLangPref, setUiLanguage (POST + re-render).
  • TS (graph-ui/src/App.tsx): render a language <select> in the header.
  • TS tests (graph-ui/src/lib/i18n.test.ts): cover setUiLanguage and option labels.

Testing

  • Frontend: tsc -b passes; vitest 9/9 pass (incl. new switcher tests).
  • C: tests/test_httpd.c extended; compiled and run by upstream CI (this environment has no C toolchain, so CI validates the C side).

Notes

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>
@zhangweildlh
zhangweildlh requested a review from DeusData as a code owner August 16, 2026 03:06
@github-actions

Copy link
Copy Markdown

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. 0.9.1-rc.1 is out, so the release freeze that held reviews is over — but it left a large queue of open pull requests behind it, and we are reading through them oldest-first. The background is in discussion #1144.

What that means for this PR, concretely:

  • It will not be closed for inactivity. No stale bot touches pull requests here.
  • It may still sit a while before a human reads it. That is on us, not on you.
  • Older PRs are read first, so a recent one is not being skipped — it is behind a queue.

Things that will genuinely speed it up whenever review does happen:

  • Keep it rebased on main — the tree is moving quickly right now, and a conflicting branch cannot be reviewed as the diff you intended.
  • Get CI green, or say which failures you believe are pre-existing.
  • Keep the change to one claim. Bundled features and refactors get split before they get merged, which costs you a round trip.
  • Every commit needs a sign-off (git commit -s) — CI enforces DCO.

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.

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.

feat(ui): add an in-app language switcher to the graph UI

1 participant