i18n icon indicating copy to clipboard operation
i18n copied to clipboard

global CustomBlock ignored when using $t

Open fanckush opened this issue 2 years ago • 2 comments

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

fanckush avatar Oct 03 '23 10:10 fanckush

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. 😞

kazupon avatar Oct 04 '23 03:10 kazupon

is there an issue already created upstream that you could link?

fanckush avatar Oct 04 '23 12:10 fanckush