Closed yapengsoft closed 11 months ago
Would you be able to provide a reproduction? š
I apologize. I figured out the issue myself. I made a mistake in my previous message But, I've encountered another issue. I'm not sure how to specify the 'langDir' options when using 'installModule' to install this module. Can you provide guidance on that?
I wasn't aware of installModule
, I will have to look into that sometime.
The reason why it isn't working is because in our logic for layer support we go through all layer configs and resolve the locales relative to each langDir
, I'm not sure exactly where the options provided by installModule
end up.
Specifically for locales
and langdir
I recommend using the i18n:registerModule
hook, that is made specifically for modules providing translations and/or locales, here is your reproduction but modified to use this hook.
Closing this issue as it has been resolved, if you have any more questions feel free to open a discussion here https://github.com/nuxt-modules/i18n/discussions!
Thank you, it worked But I'm still encountering the error: 'Locale ISO code is required to generate alternate link. because I used 'useLocaleHead'. https://stackblitz.com/edit/nuxt-i18n-queistion
Why did this issue arise in 'rc-6' when it wasn't a problem in 'rc-5'?
Why did this issue arise in 'rc-6' when it wasn't a problem in 'rc-5'?
Hmm, did this work without issues in rc.5
specifically using installModule
? When installing the module inside Nuxt configuration it works as expected, I changed the reproduction again to demonstrate.
I'm trying to manage the language options through the admin panel as it aligns with my business requirements. So, I attempted to use it within the modules
I confirmed it is working in rc-5
Could you provide a reproduction of it working using rc.5
? I think I may be misunderstanding your issue.
https://stackblitz.com/edit/nuxt-i18n-queistion-ckrqt7?file=nuxt.config.ts,package.json,modules%2Fi18n-resource%2Findex.ts The current usage of 'registerModule' and 'installModule' only works in rc-5; it doesn't work in rc-6 and rc-7 You can try updating '@nuxtjs/i18n' to either rc-6 or rc-7 versions (without modifying any code)
I need this usage because it's crucial for my business. I hope the issue can be resolved in the official v8 release. I would greatly appreciate it. Thank you so much!
Thank you for providing the reproduction! I think I know what might be the cause of this regression, hopefully I can fix it later today.
Thank you for your hard work
@yapengsoft
The fix has been merged and is now included in the edge channel, I have changed the reproduction to demonstrate here. You may need to remove node_modules
and lockfiles before installing!
Environment
Reproduction
Describe the bug
Iām sorry, I can only use pictures I am facing this problem in "rc-6" but it is normal in "rc-5" I want to know what is the reason can you tell me?
Additional context
No response
Logs
No response