-
-
Notifications
You must be signed in to change notification settings - Fork 18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
addRouterMiddleware
is not working with @intlify/nuxt3
#51
Comments
You can access the global instance: const { vueApp } = useNuxtApp();
const { t } = vueApp.__VUE_I18N__.global; |
@vis97c Any idea how to change the global locale from here ? I tried to change the i18n.locale but it doesn't reflect on the translations ... (Trying to do localized routes ..) |
@copostic this Is what I'm doing on my own project, basically you change locale which is a ref. I didn't have my PC at hand so I took a screenshot on my phone, sorry. Hope it helps |
Cleaner solution : const { vueApp } = useNuxtApp()
vueApp.config.globalProperties.$i18n.locale = yourLocale |
Hello,
When using a global
addRouterMiddleware
from a nuxt plugin with@intlify/nuxt3
the first load misses the global router middleware.Here a reproduction example :
https://stackblitz.com/edit/github-9wkf8t-t2us5t?file=plugins/middleware.ts
nuxt/nuxt#13794
The text was updated successfully, but these errors were encountered: