From 49877113915d889163ba414cd7b65a96bb66e99e Mon Sep 17 00:00:00 2001 From: Classic298 <27028174+Classic298@users.noreply.github.com> Date: Wed, 30 Sep 2026 17:25:16 +0200 Subject: [PATCH] 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 --- src/routes/+layout.svelte | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/routes/+layout.svelte b/src/routes/+layout.svelte index 1e8919a5c9..a3272177af 100644 --- a/src/routes/+layout.svelte +++ b/src/routes/+layout.svelte @@ -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