✨ Nuxt content tool chain
This commit is contained in:
7
utils/locale.ts
Normal file
7
utils/locale.ts
Normal file
@ -0,0 +1,7 @@
|
||||
export function getLocale() {
|
||||
const fallbackLocale = "en"
|
||||
const supportedLocales = ["en", "zh-CN"]
|
||||
const { locale } = useI18n()
|
||||
|
||||
return supportedLocales.includes(locale.value) ? locale.value : fallbackLocale;
|
||||
}
|
Reference in New Issue
Block a user