mirror of
https://github.com/NebulaServices/Nebula.git
synced 2025-05-13 12:00:01 -04:00
Fix the dev server????
This commit is contained in:
parent
721fa7bcda
commit
0262ee9ff0
6 changed files with 5009 additions and 12 deletions
|
@ -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
4988
pnpm-lock.yaml
generated
Normal file
File diff suppressed because it is too large
Load diff
|
@ -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);
|
||||
---
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
---
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
---
|
||||
|
|
|
@ -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>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue