10 lines
257 B
TypeScript
10 lines
257 B
TypeScript
export function getLocale(locale?: any) {
|
|
const fallbackLocale = "en"
|
|
const supportedLocales = ["en", "zh-CN"]
|
|
if (locale == null) {
|
|
locale = useI18n().locale
|
|
}
|
|
|
|
return supportedLocales.includes(locale.value) ? locale.value : fallbackLocale
|
|
}
|