Fix the dev server????

This commit is contained in:
rift 2024-07-24 15:38:59 -05:00
parent 721fa7bcda
commit 0262ee9ff0
6 changed files with 5009 additions and 12 deletions

View file

@ -1,9 +1,13 @@
import { defineConfig } from 'astro/config';
import { defineConfig } from "astro/config";
import tailwind from "@astrojs/tailwind";
import icon from "astro-icon";
// https://astro.build/config
export default defineConfig({
integrations: [tailwind(), icon()]
});
integrations: [tailwind(), icon()],
i18n: {
defaultLocale: "en-US",
locales: ["en-US", "jp"],
},
});

4988
pnpm-lock.yaml generated Normal file

File diff suppressed because it is too large Load diff

View file

@ -4,6 +4,7 @@ import { isMobileNavOpen } from "../store.js";
import Logo from "./Logo.astro";
import HeaderButton from "./HeaderButton.astro";
import { Icon } from "astro-icon/components";
const lang = getLangFromUrl(Astro.url);
const t = useTranslations(lang);
---

View file

@ -1,8 +1,10 @@
---
import { STATIC_PATHS } from "../../i18n/utils";
import Layout from "../../layouts/Layout.astro";
export function getStaticPaths() {
const STATIC_PATHS = [
{ params: { lang: "en_US" } },
{ params: { lang: "jp" } },
];
return STATIC_PATHS;
}
---

View file

@ -1,8 +1,10 @@
---
import { STATIC_PATHS } from "../../i18n/utils";
import Layout from "../../layouts/Layout.astro";
export function getStaticPaths() {
const STATIC_PATHS = [
{ params: { lang: "en_US" } },
{ params: { lang: "jp" } },
];
return STATIC_PATHS;
}
---

View file

@ -11,14 +11,14 @@ loading...
try {
let parsed = JSON.parse(currentLang).value;
switch (parsed) {
case "en_US":
redirect("/en_US/");
case "en-US":
redirect("/en-US/");
break;
case "jp":
redirect("/jp/");
break;
default:
redirect("/en/");
redirect("/en-US/");
break;
}
} catch {
@ -32,9 +32,9 @@ loading...
} else {
localStorage.setItem(
"selectedLanguage",
JSON.stringify({ value: "en_US" })
JSON.stringify({ value: "en-US" })
);
redirect("/en_US/");
redirect("/en-US/");
}
}
</script>