i18n-ally icon indicating copy to clipboard operation
i18n-ally copied to clipboard

Support for nuxt - @nuxtjs/i18n - and inside component translations

Open davidparys opened this issue 1 year ago • 2 comments

Is your feature related to a specific framework or general for this extension Nuxt + nuxt-i18n - SFC

Is your feature request related to a problem? Please describe. It's probably a lack of knowledge from my end but I could not find anything useful in the documentation.

Describe the solution you'd like

  • I am currently using nuxt + the @nuxtjs/i18n module,
  • my translations are in my locales folder for translations that repeat
  • the ones that don't repeat, are inside my components directly under
<i18n lang="yaml">
en:
 x: x
 ....
</i18n>

I'd love to keep this format as it is pretty handy to translate things, I usually just have to enter my components and everything is there.

I use

const { t: tl } = useI18n({
  useScope: 'local',
  // my local translations
})
const { t } = useI18n({
  // my global translations
})

Is this doable currently? It seems that out of the box that does not work and the Vscode plugin just crashes does not detect anything. Maybe I am missing something?

davidparys avatar Jan 07 '24 00:01 davidparys

Very wanted feature

Dodje avatar Jan 11 '24 13:01 Dodje

The following setting does make the extension work when using sfc with the local scope:

// ".vscode/settings.json

"i18n-ally.localesPaths": "locales",
"i18n-ally.enabledFrameworks": ["vue", "vue-sfc"],

Setting 18n-ally.localesPath to a random path and enabling vue-sfc explicitly does the trick.

lucacicada avatar Feb 19 '24 08:02 lucacicada