Add API
This commit is contained in:
parent
e4faaab288
commit
a8cb29e6bb
12
src/pages/api/language/en.astro
Normal file
12
src/pages/api/language/en.astro
Normal file
|
@ -0,0 +1,12 @@
|
|||
---
|
||||
import { changeLanguage } from "i18next";
|
||||
|
||||
changeLanguage("en");
|
||||
|
||||
Astro.cookies.set("Language", "EN", {
|
||||
path: "/",
|
||||
sameSite: 'strict'
|
||||
});
|
||||
return Astro.redirect("/");
|
||||
---
|
||||
<style is:global>body {background: black}</style>
|
12
src/pages/api/language/jp.astro
Normal file
12
src/pages/api/language/jp.astro
Normal file
|
@ -0,0 +1,12 @@
|
|||
---
|
||||
import { changeLanguage } from "i18next";
|
||||
|
||||
changeLanguage("jp");
|
||||
|
||||
Astro.cookies.set("Language", "JP", {
|
||||
path: "/",
|
||||
sameSite: 'strict'
|
||||
});
|
||||
return Astro.redirect("/");
|
||||
---
|
||||
<style is:global>body {background: black}</style>
|
Reference in a new issue