perf: 优化中英文翻译与切换

This commit is contained in:
xiaojunnuo
2025-06-28 23:57:01 +08:00
parent 082f47663d
commit acaa8b1731
43 changed files with 4121 additions and 4175 deletions
@@ -0,0 +1,18 @@
import { ref } from "vue";
import "dayjs/locale/zh-cn";
import "dayjs/locale/en";
import zhCN from "ant-design-vue/es/locale/zh_CN";
import enUS from "ant-design-vue/es/locale/en_US";
import dayjs from "dayjs";
export const antdvLocale = ref(zhCN);
export async function setAntdvLocale(value: string) {
console.log("locale changed:", value);
if (value.startsWith("zh")) {
dayjs.locale("zh-cn");
antdvLocale.value = zhCN;
} else {
dayjs.locale("en");
antdvLocale.value = enUS;
}
}