From e240b0a3763363631a905379301744bca3fbc37d Mon Sep 17 00:00:00 2001 From: Clarence Dan <48417261+ClarenceDan@users.noreply.github.com> Date: Tue, 4 Apr 2023 17:27:38 +0800 Subject: [PATCH] Update index.ts --- app/locales/index.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/app/locales/index.ts b/app/locales/index.ts index 5c41eeb77..a8806d48a 100644 --- a/app/locales/index.ts +++ b/app/locales/index.ts @@ -3,10 +3,11 @@ import EN from "./en"; import TW from "./tw"; import ES from "./es"; import IT from "./it"; +import JP from "./jp"; export type { LocaleType } from "./cn"; -export const AllLangs = ["en", "cn", "tw", "es", "it"] as const; +export const AllLangs = ["en", "cn", "tw", "es", "it", "jp"] as const; type Lang = (typeof AllLangs)[number]; const LANG_KEY = "lang"; @@ -50,6 +51,8 @@ export function getLang(): Lang { return "es"; } else if (lang.includes("it")) { return "it"; + } else if (lang.includes("jp")) { + return "jp"; } else { return "en"; } @@ -60,4 +63,4 @@ export function changeLang(lang: Lang) { location.reload(); } -export default { en: EN, cn: CN, tw: TW, es: ES, it: IT }[getLang()]; +export default { en: EN, cn: CN, tw: TW, es: ES, jp: JP, it: IT }[getLang()];