Files
artchat/app/composables/language.ts

12 lines
233 B
TypeScript

export function useLanguage() {
const { setLocale } = useI18n({ useScope: 'global' })
async function changeLocale(newLocale: string) {
await setLocale(newLocale as 'en' | 'fr' | 'es')
}
return {
changeLocale,
}
}