fix(vscode): default to the VS Code display language before a saved locale

The splash and the UI bundle both started in English on a fresh install
even when VS Code ran in a supported language, because only OpenChamber's
own saved locale was consulted. The HTML now exposes VS Code's display
language; the splash and detectInitialLocale use it until the user picks
a locale, which still wins.

Claude-Session: https://claude.ai/code/session_01VqV56Hez25hTxXH4ipJfzH
This commit is contained in:
Bohdan Triapitsyn
2026-09-05 15:08:15 +03:00
parent 319cf9f17a
commit c3a83b3181
3 changed files with 52 additions and 35 deletions
+7 -3
View File
@@ -201,6 +201,10 @@ half-translated locale looks like a shipped feature. `localizationBundles.test.t
enforces that, and it is the check to run whenever a feature adds a new string.
The pre-bundle loading splash in `webviewHtml.ts` is separate: its strings are
inlined in the generated HTML and chosen from OpenChamber's own saved locale
(`openchamber.i18n.v1` in webview localStorage), not from VS Code's display
language, because the splash renders before the webview bundle loads.
inlined in the generated HTML because the splash renders before the webview
bundle loads. It picks them from OpenChamber's own saved locale
(`openchamber.i18n.v1` in webview localStorage) and, before the user has
chosen one, from VS Code's display language, which the HTML exposes as
`window.__OPENCHAMBER_HOST_LANGUAGE__`. The UI bundle reads the same value as
its default locale (`detectInitialLocale`), so a fresh install in a supported
language starts in that language on both the splash and the app.