I have a Nuxt 3 project that's using @nuxtjs/i18n v8.2.0) and I'm trying to create an override system that allows tenants to override the existing locale strings in the application by merging the existing locale file with a tenant specific override file.
I have a system that works currently that uses an i18n.config.ts file that manually imports each file I need. The imports use an import alias that I've defined in my nuxt.config.ts (@tenant).
How do I do this more efficiently so that I dynamically import all the locale files and associated override files automatically rather than manually importing and merging each locale file and creating the final messages object in the i18n.config.ts?
I have a Nuxt 3 project that's using @nuxtjs/i18n v8.2.0) and I'm trying to create an override system that allows tenants to override the existing locale strings in the application by merging the existing locale file with a tenant specific override file.
I have a system that works currently that uses an
i18n.config.ts
file that manually imports each file I need. The imports use an import alias that I've defined in mynuxt.config.ts
(@tenant).How do I do this more efficiently so that I dynamically import all the locale files and associated override files automatically rather than manually importing and merging each locale file and creating the final
messages
object in thei18n.config.ts
?Folder structure: