web: i18n support — English, 简体中文, 繁體中文, Italiano

Lightweight i18n without react-i18next: a LocaleProvider context +
useLocale() hook with {{var}} interpolation, auto-detect from
navigator.language, persisted to localStorage.

98 translation keys across 4 locale files (en/zh-CN/zh-TW/it).
All user-visible strings in App/Brain/Profiling/ErrorBoundary are
now t() calls. Language switcher added to the sidebar footer.

Build clean (tsc + vite), 18 tests pass.
This commit is contained in:
ZacharyZcR
2026-07-19 04:22:46 +08:00
parent 420a0720c3
commit e486574442
11 changed files with 675 additions and 119 deletions
+4 -1
View File
@@ -2,10 +2,13 @@ import { createRoot } from "react-dom/client"
import App from "./App"
import { ErrorBoundary } from "./ErrorBoundary"
import { LocaleProvider } from "./i18n"
import "./index.css"
createRoot(document.getElementById("root")!).render(
<ErrorBoundary>
<App />
<LocaleProvider>
<App />
</LocaleProvider>
</ErrorBoundary>,
)