|
@@ -11,6 +11,7 @@ import VI from "./vi";
|
|
|
import RU from "./ru";
|
|
|
import CS from "./cs";
|
|
|
import KO from "./ko";
|
|
|
+import { merge } from "../utils/merge";
|
|
|
|
|
|
export type { LocaleType } from "./cn";
|
|
|
|
|
@@ -80,7 +81,8 @@ export function changeLang(lang: Lang) {
|
|
|
location.reload();
|
|
|
}
|
|
|
|
|
|
-export default {
|
|
|
+const fallbackLang = EN;
|
|
|
+const targetLang = {
|
|
|
en: EN,
|
|
|
cn: CN,
|
|
|
tw: TW,
|
|
@@ -95,3 +97,8 @@ export default {
|
|
|
cs: CS,
|
|
|
ko: KO,
|
|
|
}[getLang()] as typeof CN;
|
|
|
+
|
|
|
+// if target lang missing some fields, it will use fallback lang string
|
|
|
+merge(fallbackLang, targetLang);
|
|
|
+
|
|
|
+export default fallbackLang as typeof CN;
|