Capital/utils/locale.ts

8 lines
219 B
TypeScript
Raw Normal View History

2024-08-13 14:44:36 +00:00
export function getLocale() {
const fallbackLocale = "en"
const supportedLocales = ["en", "zh-CN"]
const { locale } = useI18n()
return supportedLocales.includes(locale.value) ? locale.value : fallbackLocale;
}