Access global property of i18n instance
Open
- Dominant language
- TypeScript
- Stars
- 204
- Forks
- 18
- PR merge metrics
- No merged PRs in 30d
Description
Hi,
is it possible to access the global property of the i18n instance for usage outside of components?
I couldn't find a way, so my current workaround is to use vue-i18n without the nuxt module and create my own plugin which exports i18n instance:
```js
export const i18n = createI18n({
legacy: false,
globalInjection: true,
locale: 'en',
messages: {
en,
},
})
export default defineNuxtPlugin((nuxt) => {
const { vueApp } = nuxt
vueApp.use(i18n)
})
```
Best regards
David
Contributor guide
Assessment
This issue has not been assessed yet.