mirror of
https://github.com/open-webui/open-webui.git
synced 2026-10-05 02:41:34 +00:00
fix: DEFAULT_LOCALE is ignored on a user's first visit (#31551)
Since v0.11.4 a new visitor always got their browser's language even when an admin set DEFAULT_LOCALE, because the browser language was remembered as if the user had picked it, so the configured default never applied. The configured default now applies on the first visit again, as it did up to v0.11.3. A language the user picks in Settings and a ?lang= link still take precedence, and instances without DEFAULT_LOCALE keep following the browser language. Fixes #31548
This commit is contained in:
parent
5338aeca89
commit
4987711391
1 changed files with 4 additions and 1 deletions
|
|
@ -1269,7 +1269,10 @@
|
|||
// Initialize i18n even if we didn't get a backend config,
|
||||
// so `/error` can show something that's not `undefined`.
|
||||
|
||||
await initI18n(localStorage?.locale, backendConfig?.i18n ?? {});
|
||||
await initI18n(
|
||||
localStorage?.locale ?? backendConfig?.default_locale,
|
||||
backendConfig?.i18n ?? {}
|
||||
);
|
||||
if (!localStorage.locale) {
|
||||
const languages = await getLanguages();
|
||||
const browserLanguages = navigator.languages
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue