New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Rename i18n:extend-messages
to i18n:extendMessages
#1942
Comments
i18n:extend-messages
to i18n:extendMessage
i18n:extend-messages
to i18n:extendMessages
Brilliant issue to get contributing to this repo! 😄 |
We might be able to deplicate i18n:extend-message. Because I think we can do the same thing with the recently supported Layers. /cc @BobbieGoede https://v8.i18n.nuxtjs.org/guide/layers The reason for deprecated is that this hook pre-compiles the messages passed by vue-i18n at build-time, and generates code in i18n.options.mjs in the template. reference discord link: |
@kazupon that should be possible, I can look into adapting for modules. Are there any advantages over extending messages with objects instead of files with the current approach? Is there a preferred way of registering/discovering modules that want to provide messages/locales? Using a hook I figure it could work something like this for modules: export default defineNuxtModule({
async setup(options, nuxt) {
// could potentially be simplified inside a function to handle resolve and hook
const resolver = createResolver(import.meta.url)
nuxt.hook('i18n:registerModule', registerI18nModule => {
registerI18nModule({
// paths may be more unpredictable compared to layers?
langDir: resolver.resolve('./locales'),
locales: [
{
code: 'en',
iso: 'en-US',
file: 'en.json',
name: 'English'
},
{
code: 'nl',
iso: 'nl-NL',
file: 'nl.json',
name: 'Nederlands'
}
]
})
}
) I'm not sure if The discord link doesn't work for me so I am not sure what it references 😅 |
Originally posted by @ineshbose in #1919 (comment)
The text was updated successfully, but these errors were encountered: