nuxt-modules / i18n

I18n module for Nuxt
https://i18n.nuxtjs.org
MIT License
1.68k stars 473 forks source link

Enable type checking from vue-i18n #2591

Open dreitzner opened 8 months ago

dreitzner commented 8 months ago

Describe the feature

vue-i18n supports type safe resource Schemas. (docs)

It would be nice to have a way to do the same in nuxt-i18n as well.

From what I can gleen from the source code it might only be needed to add a possible type type to defineNuxtPlugin that is passed to createI18n.

Additional information

Final checks

danwithabox commented 5 months ago

For people who want type-safety out-of-the-box without waiting for this, I have successfully used global resource schema type definitions as a workaround.

adamdehaven commented 2 months ago

I'm willing to contribute, but might need an assist: https://github.com/nuxt-modules/i18n/issues/1753#issuecomment-2146330404

thomaslecoeur commented 1 month ago

For people who want type-safety out-of-the-box without waiting for this, I have successfully used global resource schema type definitions as a workaround.

Any details on the implementation? Can we reproduce on a vanilla nuxt project?