Just testing an hypotesis
Some checks are pending
Deploy / deploy (push) Waiting to run

This commit is contained in:
Leonardo Murça 2025-06-05 00:37:48 -03:00
parent 563af3d90f
commit 0f599d2069
2 changed files with 7 additions and 6 deletions

View file

@ -127,7 +127,7 @@ export const {
} = new i18n(config); } = new i18n(config);
locale.subscribe(($locale) => { locale.subscribe(($locale) => {
if (typeof document !== 'undefined') { // if (typeof document !== 'undefined') {
document.cookie = `locale=${$locale}; path=/; SameSite=None; Secure`; // document.cookie = `locale=${$locale}; path=/; SameSite=None; Secure`;
} // }
}); });

View file

@ -41,9 +41,10 @@ function localeFromHeader(header) {
/** @type {import('@sveltejs/kit').ServerLoad}*/ /** @type {import('@sveltejs/kit').ServerLoad}*/
export async function load({ url, request, cookies }) { export async function load({ url, request, cookies }) {
const cookieLocale = localeFromCookies(cookies); // const cookieLocale = localeFromCookies(cookies);
const headerLocale = localeFromHeader(request.headers.get('accept-language')); // const headerLocale = localeFromHeader(request.headers.get('accept-language'));
const language = cookieLocale || headerLocale || SUPPORTED_LOCALES.EN_US; // const language = cookieLocale || headerLocale || SUPPORTED_LOCALES.EN_US;
const language = SUPPORTED_LOCALES.EN_US;
const route = url.pathname; const route = url.pathname;
await loadTranslations(language, route); await loadTranslations(language, route);