Update cookie check

This commit is contained in:
Korbs 2024-07-13 16:09:13 -04:00
parent a26e7deeef
commit 3bbd99cc79

View file

@ -7,6 +7,10 @@ import i18next, { t } from "i18next";
//// If the user is new to the site, set English as default
if (Astro.cookies.get("Language") === undefined) {
Astro.cookies.set("Language", "EN", {path: "/",sameSite: 'strict'})
} else {
var UserLanguage = Astro.cookies.get("Language").value
if (UserLanguage === "JP") {i18next.changeLanguage("jp")}
else if (UserLanguage === "EN") {i18next.changeLanguage("en")}
}
/// Telemtry
@ -16,9 +20,7 @@ if (Astro.cookies.get("Telemtry") === undefined) {
}
//// Check what language the user has set it to and switch to it
var UserLanguage = Astro.cookies.get("Language").value
if (UserLanguage === "JP") {i18next.changeLanguage("jp")}
else if (UserLanguage === "EN") {i18next.changeLanguage("en")}
// Properties
const {