Skip to content

feat(i18n): add optional English UI with Chinese as the default - #109

Closed
dunvu0 wants to merge 3 commits into
RuoJi6:mainfrom
dunvu0:feat/english-ui-foundation
Closed

dunvu0 wants to merge 3 commits into
RuoJi6:mainfrom
dunvu0:feat/english-ui-foundation

Conversation

@dunvu0

@dunvu0 dunvu0 commented Nov 2, 2026 •

Copy link
Copy Markdown

Adds an optional English UI to ARTEX. Chinese remains the default; English is an explicit choice in the language selector.

This update addresses the review feedback on the first version:

  • Incomplete coverage: every screen is now localized, including nested dialogs, tooltips, toasts, empty and error states. Covered areas: tasks (all tabs), chat, findings and cases, assets, traffic and evidence, Repeater, schedules, asset sync, workspace, Agents, LLM, MCP, skills, tools, notifications, interception and approvals, logs and settings.
  • Dropdown display: the language selector in the sidebar no longer stretches to the full sidebar width. It keeps a compact width on desktop and mobile.

What is translated, what stays verbatim

  • Interface labels, placeholders, validation and status labels come from web/messages/{zh-CN,en}.json (4,174 semantic messages each, ICU plurals for counts).
  • Known backend error texts (writeErr in server/*.go) and backend-generated system labels are translated at the display boundary. Unknown errors and error details are shown unchanged.
  • Bundled Agent and rule names/descriptions are translated only while they still match the seeded Chinese text. Custom or edited names stay as written.
  • Prompts, model output, saved reports, raw HTTP and evidence, and stored values are never translated or rewritten.

Agent output language

Switching the selector to English also saves output_language=en in settings (GET/PUT /api/settings). Agents then receive an English output directive at runtime, and the task Report tab uses English headings. Stored prompt versions are not modified, and Chinese (zh) remains the default.

Implementation

  • next-intl with semantic keys and a client provider compatible with the static export. No locale routes or middleware.
  • The UI language preference is stored in localStorage; missing or invalid values fall back to Chinese.
  • Language switches preserve drafts, selections, editor state, streams and timezone/schedule behavior.
  • web/I18N.md documents coverage, how to add messages, the checks, and translation attribution (ScopeWeaver, artex-global).

Rebased on current main (d36e1c3), including the new DeepSeek Search API settings and the Jev model-list change.

Validation

  • npm run i18n:check: 4,174 messages, matching keys and ICU arguments.
  • npm run test:i18n: 22 tests, including drift checks against backend error texts, Agent seeds and system labels.
  • npm run build:static and TypeScript: all static pages export.
  • npm run test:i18n:browser: 60 Chromium tests against the static export with mocked APIs, including every screen rendered in English without missing messages.
  • Go: TestOutputLanguageSettings (PostgreSQL) plus agent and report language tests.

An earlier build was also checked on a live test instance (language selector, English Agent output and report). The rebased build was verified with the automated checks above; the browser tests use mocked APIs.

🤖 Generated with Claude Code

@RuoJi6

RuoJi6 commented Nov 2, 2026

Copy link
Copy Markdown
Owner

师傅,有几个问题,师傅有空的话修完之后,我在师傅合并pr

  • 界面很多地方都未pr完全。
  • 下拉框的UI显示有问题。

@dunvu0
dunvu0 force-pushed the feat/english-ui-foundation branch from 49f3b96 to 702cdc9 Compare November 3, 2026 09:20
@dunvu0 dunvu0 changed the title feat(i18n): add optional English for auth and navigation feat(i18n): add optional English UI with Chinese as the default Nov 3, 2026
@dunvu0

dunvu0 commented Nov 3, 2026 •

Copy link
Copy Markdown
Author

@RuoJi6 Thanks for the review. I've updated the PR to address both points:

  • Incomplete coverage: every screen is now translated, including nested dialogs, tooltips, toasts, empty/error states and known backend error messages. Chinese is still the default.
  • Dropdown display: the language selector in the sidebar no longer stretches to the full sidebar width. It now has a compact width on both desktop and mobile.

The branch is rebased on the current main (d36e1c3), and the new DeepSeek Search and Jev settings are translated too. Switching to English also makes Agents and the task report write in English. Stored prompts are not modified.

The PR description has the full details and validation steps. The CI workflow needs your approval to run because this PR comes from a fork

🤖 Generated with Claude Code

dgvng and others added 3 commits November 5, 2026 23:01
Localize the remaining feature screens, nested dialogs, toasts and known
backend errors behind the existing opt-in selector; Chinese stays default.

- Catalogs cover tasks, chat, findings/cases, assets, traffic/evidence,
  Repeater, schedules, asset sync, workspace, agents, LLM, MCP, skills,
  tools, notifications, interception/approvals, logs and settings.
- Known server writeErr texts and backend system labels translate at the
  display boundary; unknown errors, stored values and raw evidence stay
  verbatim. Bundled Agent/rule metadata translates only when unchanged.
- Fragmented JSX strings become whole ICU messages with plurals.
- The language selector also stores output_language so agents and the
  task report write English when English is selected. Prompt versions
  are never modified.
- Fix the language dropdown layout in the sidebar.
- Tests: catalog/ICU checks, i18n unit tests, Go output-language tests,
  and Playwright coverage for every screen.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
CI runs Node 22 (npm 10), which requires next-intl's nested
@swc/helpers@0.5.23 to be recorded in the lockfile. The previous
lockfile was written by npm 11 and omitted it, so npm ci failed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@dunvu0
dunvu0 force-pushed the feat/english-ui-foundation branch from ea688fa to 4728f3f Compare November 5, 2026 16:25
@dunvu0 dunvu0 closed this Nov 9, 2026
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