fix(webui): follow browser language on first visit (#6591)

Co-authored-by: ovo-agentx <351813579+ovo-agentx@users.noreply.github.com>
This commit is contained in:
chengyongruandovo-agentx authored and GitHub committed 2026-11-07 00:46:09 +08:00
1 parent 0ee302253f
commit 12c7d116a0
6 files changed
+108 -8

No files matched your search

+3 -1
View File
@@ -62,7 +62,9 @@ function readStoredLocale(): SupportedLocale | null {
}
export function resolveInitialLocale(): SupportedLocale {
return readStoredLocale() ?? defaultLocale;
return readStoredLocale() ?? normalizeLocale(
typeof navigator === "undefined" ? null : navigator.languages?.[0] || navigator.language,
);
}
export function persistLocale(locale: SupportedLocale): void {