💄 Better docs page

This commit is contained in:
2024-09-28 13:29:05 +08:00
parent dc740f8538
commit 9bcd809493
4 changed files with 164 additions and 39 deletions

View File

@ -1,7 +1,9 @@
export function getLocale() {
export function getLocale(locale?: any) {
const fallbackLocale = "en"
const supportedLocales = ["en", "zh-CN"]
const { locale } = useI18n()
if (locale == null) {
locale = useI18n().locale
}
return supportedLocales.includes(locale.value) ? locale.value : fallbackLocale;
return supportedLocales.includes(locale.value) ? locale.value : fallbackLocale
}