intlify / nuxt3

Nuxt 3 Module for vue-i18n-next

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

How do I access current language outside setup? (Especially from a plugin!)

SH1R3F opened this issue · comments

Right now, I'm trying to build a plugin to do something depending on current language, so I need to get access to what current language is.
so, the idea that comes up on my mind now is to get useI18n().locale;
but it doesn't work leading to this error "Must be called at the top of a setup function"
Any help would be very appreciated !