Issues / #2686

#2686 [Feature]: a language pack for the web app (i18n), Simplified Chinese first, UTF-8 only

open · @MrKop-git · 0 コメント · GitHub で見る

Setup & installServer & APIDocumentationWindows

本文

## What do you want to do?

The web app (Chat / Monitor / About, `serve/web`) is English-only: every label, tooltip, table header and status line is a literal string in `index.html`, or built at runtime in `app.js` (toasts, the Monitor's rows and facts, the requests table). On a Chinese Windows the rest of Strata is localised (`README.zh-CN.md`, the installer speaks Chinese) but the page you actually use is not.

I would like a small language-pack layer in the web app:

- one key per user-visible string: `data-i18n` on the nodes in `index.html`, and the same keys for the strings `app.js` builds at runtime;
- one JSON pack per language under `serve/web/i18n/<lang>.json`, `en.json` first (the strings exactly as they are today, so the default path stays byte-identical for English users) and `zh-CN.json` with Simplified Chinese;
- **UTF-8 everywhere, never GBK / cp936** — the page already declares `<meta charset="utf-8">` and `server.py` serves `text/html; charset=utf-8`; the packs and their `.js`/`.json` files must stay UTF-8 (no BOM issues, no console code page involved);
- the language picked from the browser's own (`navigator.languages`) with a switch in About > Settings, remembered in `localStorage`, English when nothing matches;
- tell the browser not to machine-translate the page while a real translation exists (`translate="no"` / `lang`), so Chrome's translate feature stops fighting the UI (see the jitter bug filed next to this one).

Goal: a Chinese user opens `http://127.0.0.1:<port>` and reads Chinese without touching the code; an English user sees exactly the page they see now.

## Notes

Web app only. No change to the engine, the OpenAI/Anthropic APIs, the model's answers, or the installer's own console text. Any other language can be added later by dropping in another `<lang>.json`.

関連リンク

インストール・モデル・リリースへの站内リンク。