mirror of
https://github.com/Yidadaa/ChatGPT-Next-Web.git
synced 2025-08-09 22:47:22 +08:00
feat: partial locale type
This commit is contained in:
@@ -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;
|
||||
|
Reference in New Issue
Block a user