diff --git a/src/components/global/Head.astro b/src/components/global/Head.astro index 0127d8f..e1da580 100644 --- a/src/components/global/Head.astro +++ b/src/components/global/Head.astro @@ -3,7 +3,14 @@ import i18next, { t } from "i18next"; import { Trans, HeadHrefLangs } from "astro-i18next/components"; -if (Astro.cookies.get("Language").value === undefined) {Astro.cookies.set("Language", "EN", {path: "/",sameSite: 'strict'})} +// Cookies +/// Language +//// 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'}) +} + +//// 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")} @@ -13,11 +20,16 @@ const { Title, Description } = Astro.props + +// Components +import { ViewTransitions } from 'astro:transitions'; +import { fade } from "astro/virtual-modules/transitions.js"; --- + {Title}