Capital/utils/locale.ts
2024-08-13 22:44:36 +08:00

8 lines
219 B
TypeScript

export function getLocale() {
const fallbackLocale = "en"
const supportedLocales = ["en", "zh-CN"]
const { locale } = useI18n()
return supportedLocales.includes(locale.value) ? locale.value : fallbackLocale;
}