diff --git a/src/lib/server/controllers/controller.js b/src/lib/server/controllers/controller.js index 9e16730..8de5fae 100644 --- a/src/lib/server/controllers/controller.js +++ b/src/lib/server/controllers/controller.js @@ -717,9 +717,8 @@ export const CookieConfig = () => { }; }; export const GetLocaleFromCookie = (site, cookies) => { - let selectedLang = "en"; + let selectedLang = site.i18n?.defaultLocale || "en"; const localLangCookie = cookies.get("localLang"); - if (!!localLangCookie && site.i18n?.locales.find((l) => l.code === localLangCookie)) { selectedLang = localLangCookie; } else if (site.i18n?.defaultLocale && site.i18n?.locales[site.i18n.defaultLocale]) {