---
import Layout from "../layouts/Layout.astro";
import Card from "../components/Card.astro";
---

loading...
<script is:inline>
  let currentLang = localStorage.getItem("selectedLanguage");
  const redirect = (loc) => (window.location.href = loc);
  if (currentLang) {
    try {
      let parsed = JSON.parse(currentLang).value;
      switch (parsed) {
        case "en_US":
          redirect("/en_US/");
          break;
        case "jp":
          redirect("/jp/");
          break;
        default:
          redirect("/en_US/");
          break;
      }
    } catch {
      localStorage.clear();
      window.location.reload();
    }
  } else {
    if (navigator.language.includes("ja")) {
      localStorage.setItem("selectedLanguage", JSON.stringify({ value: "jp" }));
      redirect("/jp/");
    } else {
      localStorage.setItem(
        "selectedLanguage",
        JSON.stringify({ value: "en_US" })
      );
      redirect("/en_US/");
    }
  }
</script>
<noscript></noscript>You need to enable JavaScript to run this app.
