Skip to content

feat(web): persist language preference - #359

Open
seekskyworld wants to merge 1 commit into
openpi-dev:mainfrom
seekskyworld:feat/issue-350-language-preference
Open

feat(web): persist language preference#359
seekskyworld wants to merge 1 commit into
openpi-dev:mainfrom
seekskyworld:feat/issue-350-language-preference

Conversation

@seekskyworld

Copy link
Copy Markdown

Problem

Implements the language-preference slice of #350. The Web workbench selected a locale only from the browser and lost the choice on reload.

Value

Users can keep a deliberate English/Chinese preference across reloads without involving Session or credential storage.

Approach

Read a validated openpi.language value from browser-local storage, fall back to navigator detection, and add an accessible language toggle. Invalid values are ignored and storage failures degrade to in-memory behavior.

Validation

  • npx tsc --noEmit
  • node --test --experimental-strip-types tests/web/app-render.test.ts
  • git diff --check

Impact

  • User-visible behavior: adds a language toggle and reload persistence.
  • Model-visible context/tools: none.
  • Runtime/lifecycle: none.
  • Persisted config/data: browser-local language key only; no Session data or secrets.
  • Compatibility/risk: unsupported storage values fall back to browser detection.

Signed-off-by: seekskyworld <djh1813553759@gmail.com>

@tt-a1i tt-a1i left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

需要改:语言偏好绕开了 /openpi-setup

web/ui/app.jsen/zh 写进 localStorageopenpi.language)。包级、用户可选的偏好必须走 extensions/setupsetup-config.ts、无参 /openpi-setup 状态、SETUP.md 和 README。#371 的主题已经按这条合同做了。

请把语言做成和 #371 一样的 snapshot 偏好,不要在浏览器里开第二份真相。切换语言 的 aria/title 写死中文也请一并改掉。

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