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:
1 parent
0ee302253f
commit
12c7d116a0
6 files changed
+108
-8
No files matched your search
@@ -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 {
|
||||
|
||||
Reference in new issue
Block a user