Update cookie check
This commit is contained in:
parent
a26e7deeef
commit
3bbd99cc79
1 changed files with 5 additions and 3 deletions
|
@ -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 {
|
||||
|
|
Reference in a new issue