mirror of
https://github.com/NebulaServices/Nebula.git
synced 2025-05-13 20:10: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 tailwind from "@astrojs/tailwind";
|
||||||
|
|
||||||
import icon from "astro-icon";
|
import icon from "astro-icon";
|
||||||
|
|
||||||
// https://astro.build/config
|
// https://astro.build/config
|
||||||
export default defineConfig({
|
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 Logo from "./Logo.astro";
|
||||||
import HeaderButton from "./HeaderButton.astro";
|
import HeaderButton from "./HeaderButton.astro";
|
||||||
import { Icon } from "astro-icon/components";
|
import { Icon } from "astro-icon/components";
|
||||||
|
|
||||||
const lang = getLangFromUrl(Astro.url);
|
const lang = getLangFromUrl(Astro.url);
|
||||||
const t = useTranslations(lang);
|
const t = useTranslations(lang);
|
||||||
---
|
---
|
||||||
|
|
|
@ -1,8 +1,10 @@
|
||||||
---
|
---
|
||||||
import { STATIC_PATHS } from "../../i18n/utils";
|
|
||||||
import Layout from "../../layouts/Layout.astro";
|
import Layout from "../../layouts/Layout.astro";
|
||||||
|
|
||||||
export function getStaticPaths() {
|
export function getStaticPaths() {
|
||||||
|
const STATIC_PATHS = [
|
||||||
|
{ params: { lang: "en_US" } },
|
||||||
|
{ params: { lang: "jp" } },
|
||||||
|
];
|
||||||
return STATIC_PATHS;
|
return STATIC_PATHS;
|
||||||
}
|
}
|
||||||
---
|
---
|
||||||
|
|
|
@ -1,8 +1,10 @@
|
||||||
---
|
---
|
||||||
import { STATIC_PATHS } from "../../i18n/utils";
|
|
||||||
import Layout from "../../layouts/Layout.astro";
|
import Layout from "../../layouts/Layout.astro";
|
||||||
|
|
||||||
export function getStaticPaths() {
|
export function getStaticPaths() {
|
||||||
|
const STATIC_PATHS = [
|
||||||
|
{ params: { lang: "en_US" } },
|
||||||
|
{ params: { lang: "jp" } },
|
||||||
|
];
|
||||||
return STATIC_PATHS;
|
return STATIC_PATHS;
|
||||||
}
|
}
|
||||||
---
|
---
|
||||||
|
|
|
@ -11,14 +11,14 @@ loading...
|
||||||
try {
|
try {
|
||||||
let parsed = JSON.parse(currentLang).value;
|
let parsed = JSON.parse(currentLang).value;
|
||||||
switch (parsed) {
|
switch (parsed) {
|
||||||
case "en_US":
|
case "en-US":
|
||||||
redirect("/en_US/");
|
redirect("/en-US/");
|
||||||
break;
|
break;
|
||||||
case "jp":
|
case "jp":
|
||||||
redirect("/jp/");
|
redirect("/jp/");
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
redirect("/en/");
|
redirect("/en-US/");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
} catch {
|
} catch {
|
||||||
|
@ -32,9 +32,9 @@ loading...
|
||||||
} else {
|
} else {
|
||||||
localStorage.setItem(
|
localStorage.setItem(
|
||||||
"selectedLanguage",
|
"selectedLanguage",
|
||||||
JSON.stringify({ value: "en_US" })
|
JSON.stringify({ value: "en-US" })
|
||||||
);
|
);
|
||||||
redirect("/en_US/");
|
redirect("/en-US/");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue