global CustomBlock ignored when using $t
Environment
(from the repro)
- Operating System: Linux
- Node Version: v18.18.0
- Nuxt Version: 3.7.0
- CLI Version: 3.7.3
- Nitro Version: 2.6.2
- Package Manager: [email protected]
- Builder: -
- User Config: modules, i18n
- Runtime Modules: @nuxtjs/[email protected]
- Build Modules: -
Reproduction
https://stackblitz.com/edit/bobbiegoede-nuxt-i18n-starter-dgbghr?file=pages%2Findex.vue
Describe the bug
global <i18n> custom blocks seem to be ignored or excluded somehow when used with $t
Additional context
Maybe helps for debugging: by adding the following line to script setup the problem is gone
useI18n({ useScope: 'global' });
I suspect this that the custom block is only parsed when useI18n is called
Logs
No response
Thank you for your reporting! This is upstream issue.
Currently, if you want to use global custom block resources with $t, you need to do useI18n({ useScope: 'global' }) as a workaround.
This issue needs to be addressed on the vue-i18n-next & unplugin-vue-i18n side. 😞
is there an issue already created upstream that you could link?