Closed dreitzner closed 1 week 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.
I'm willing to contribute, but might need an assist: https://github.com/nuxt-modules/i18n/issues/1753#issuecomment-2146330404
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?
The latest v9 release candidate (https://github.com/nuxt-modules/i18n/releases/tag/v9.0.0-rc.2) includes experimental vue-i18n
options and messages generation, this provides autocompletion for configuring options and translation functions, please try it out and let me know if this works as expected 🙏
More on the option that enables this functionality: https://i18n.nuxtjs.org/docs/v9/options/misc#experimentaltypedoptionsandmessages, the PR implementing this has a demo video of it in action https://github.com/nuxt-modules/i18n/pull/3151
Closing this as we have experimental support for this in the stable release of v9, please try it out and let me know your thoughts!
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 tocreateI18n
.Additional information
Final checks