Closed nford88 closed 1 month ago
hey @BobbieGoede do you know if there is any room on the roadmap to examine this? I can try and find some time to help debug if that's any use.
It's a blocker for myself to move an application from Nuct 2 to Nuxt 3 as we are mid migration. If its going to be a while I might try and find an alternative temporary solution (manually building one json per country) so I can keep on working through. Many thanks!
@nford88
Sorry I didn't get around to fixing this yet, it seems something is going wrong with caching and I think the imported de.json
file is being mutated.
I do have a workaround using dynamic locale files which is less performant but should unblock your migration while this issue exists. I have updated your reproduction to demonstrate the workaround here.
I implemented your workaround now. I have about 150 translations in the main language files and approximately 20-30 in the locale country files. Not seeing too much of a performant dip. Will see how it goes. Thanks!
This will be resolved with #3137 since I've fixed the issue upstream! Here's an updated reproduction with using a preview release https://stackblitz.com/edit/nuxt-starter-mwtgfw?file=package.json.
Environment
Build Modules: -
Reproduction
https://stackblitz.com/edit/nuxt-starter-ymkpzl?file=nuxt.config.ts
Describe the bug
My site have multiple locales which are language and country specific. For this example, I create one main language file (de.json) which majority of translations, I then create one specific country file (de-CH.json). Both are inserted as locale objects below.
However, the 'de-DE' locale is accessing the translations from 'de-CH.json' file when that locale should only being 'de.json' file.
There seems to be an issue with the spreading of the locale objects json files and both locales are receiving the same translations object when they should have their own be separate objects.
Additional context
No response
Logs
No response