Update: locales in spanish

This commit is contained in:
Daniel Gerardo Rondón García
2023-03-30 19:48:57 -05:00
parent 2f2e0b6762
commit df75b9973a
5 changed files with 162 additions and 2 deletions

View File

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