add new language, Japanese

This commit is contained in:
aooyoo
2023-04-10 14:01:54 +00:00
parent ec985f6a1d
commit 7670b8b738
8 changed files with 201 additions and 5 deletions

View File

@@ -4,10 +4,11 @@ import TW from "./tw";
import ES from "./es";
import IT from "./it";
import TR from "./tr";
import JP from "./jp";
export type { LocaleType } from "./cn";
export const AllLangs = ["en", "cn", "tw", "es", "it", "tr"] as const;
export const AllLangs = ["en", "cn", "tw", "es", "it", "tr", "jp"] as const;
type Lang = (typeof AllLangs)[number];
const LANG_KEY = "lang";
@@ -53,6 +54,8 @@ export function getLang(): Lang {
return "it";
} else if (lang.includes("tr")) {
return "tr";
} else if (lang.includes("jp")) {
return "jp";
} else {
return "en";
}
@@ -63,4 +66,6 @@ export function changeLang(lang: Lang) {
location.reload();
}
export default { en: EN, cn: CN, tw: TW, es: ES, it: IT, tr: TR }[getLang()];
export default { en: EN, cn: CN, tw: TW, es: ES, it: IT, tr: TR, jp: JP }[
getLang()
];