From 0f599d206913a68c554e92ed998da3b274324184 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Leonardo=20Mur=C3=A7a?= Date: Thu, 5 Jun 2025 00:37:48 -0300 Subject: [PATCH] Just testing an hypotesis --- src/lib/translations/index.js | 6 +++--- src/routes/+layout.server.js | 7 ++++--- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/src/lib/translations/index.js b/src/lib/translations/index.js index 825ac45..e354002 100644 --- a/src/lib/translations/index.js +++ b/src/lib/translations/index.js @@ -127,7 +127,7 @@ export const { } = new i18n(config); locale.subscribe(($locale) => { - if (typeof document !== 'undefined') { - document.cookie = `locale=${$locale}; path=/; SameSite=None; Secure`; - } + // if (typeof document !== 'undefined') { + // document.cookie = `locale=${$locale}; path=/; SameSite=None; Secure`; + // } }); diff --git a/src/routes/+layout.server.js b/src/routes/+layout.server.js index 195496e..17c341b 100644 --- a/src/routes/+layout.server.js +++ b/src/routes/+layout.server.js @@ -41,9 +41,10 @@ function localeFromHeader(header) { /** @type {import('@sveltejs/kit').ServerLoad}*/ export async function load({ url, request, cookies }) { - const cookieLocale = localeFromCookies(cookies); - const headerLocale = localeFromHeader(request.headers.get('accept-language')); - const language = cookieLocale || headerLocale || SUPPORTED_LOCALES.EN_US; + // const cookieLocale = localeFromCookies(cookies); + // const headerLocale = localeFromHeader(request.headers.get('accept-language')); + // const language = cookieLocale || headerLocale || SUPPORTED_LOCALES.EN_US; + const language = SUPPORTED_LOCALES.EN_US; const route = url.pathname; await loadTranslations(language, route);