Skip to content

Web UI: English interface (#31); CI isolation - #93

Merged
Cd1s merged 1 commit into
mainfrom
feat/english-ui
Sep 26, 2026
Merged

Cd1s merged 1 commit into
mainfrom
feat/english-ui

Conversation

@Cd1s

@Cd1s Cd1s commented Sep 26, 2026

Copy link
Copy Markdown
Owner

What

  • English UI. Chinese stays the source language.
    • In English mode, core.js loads ui/lang/en.json before the first render: 1765 strings, 122 KB (49 KB gzip). Chinese mode never fetches it.
    • It translates what h() renders: text, and the placeholder / title / aria-label / alt attributes. Exact matches first; for concatenated strings, known fragments are replaced via one precompiled regex.
    • A string that would stay half Chinese (user data such as a Chinese device name) is shown unchanged.
    • The language follows the browser; a switch sits in the nav and on the login page.
  • tools/i18n.py
    • check runs in CI. It fails when a UI literal has no translation, when a translation contains Chinese or loses its leading/trailing spaces, or when UI code bypasses h() without tr().
    • missing and fmt help maintain the file.
    • The UI conventions are in docs/MODULES.md.
  • CI

Not translated: the standalone read-only panel page (/panel), user data, and plurals.

Verification

  • mr/ui_i18n_test.go loads the real core.js and en.json in node.
  • Every page was opened in English against the mock, with all tabs and dialogs; no Chinese is left and nothing overflows at 360 px.
  • Screenshots checked in light and dark mode.
  • Chinese mode is unchanged.
  • sh tools/ci.sh: ALL CHECKS PASSED.

Closes #31

https://claude.ai/code/session_01HWeUjo1dmS7gBkCYHrVjCr

…lation

- English UI: Chinese stays the source language. In English mode core.js loads ui/lang/en.json
  (1765 strings; 122 KB, 49 KB gzip; never fetched in Chinese mode) before the first render and
  translates what h() renders (text, placeholder / title / aria-label / alt): exact match, else known
  fragments of concatenated strings via one precompiled regex; a string that would stay half Chinese
  (user data) is shown as it is. Language from the browser, a switch in the nav and on the login page.
- tools/i18n.py check (in CI): every UI literal is translated, no Chinese or lost spacing in
  translations, no text that bypasses h() without tr(); `missing` / `fmt` for maintenance.
- CI: private tmpfs over mr's runtime directories too (concurrent runs shared the notification lock);
  an opt-in stress loop for the trojan-hu first-connection failure (#51).

Closes #31

Claude-Session: https://claude.ai/code/session_01HWeUjo1dmS7gBkCYHrVjCr
@Cd1s
Cd1s merged commit 2c3df32 into main Sep 26, 2026
2 checks passed
@Cd1s
Cd1s deleted the feat/english-ui branch September 26, 2026 04:59
@Cd1s Cd1s mentioned this pull request Sep 26, 2026
52 tasks done
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.

提议:英文界面(i18n)

1 participant