Open Gerbuuun opened 1 week ago
Just realized I can use a relative path in the config.
i18n: {
langDir: '../lang',
}
A point on consistency could still be made though.
Thank you for your reporting! We are now going to work on nuxt-i18n v9. At that time we will also test it with nuxt4. Please wait!
In Nuxt 4 the
srcDir
will beapp
by default instead of being the same as therootDir
. I want to put mylang
directory outside of theapp
directory because I also use translations server side.In the module setup it will scan the
srcDir
for the translation files but they are located outside of it. https://github.com/nuxt-modules/i18n/blob/cddb8b31825405f08f569f882b6d80284c263ca7/src/module.ts#L184-L188(The
experimental.localeDetector
, in contrast, does scan therootDir
) https://github.com/nuxt-modules/i18n/blob/cddb8b31825405f08f569f882b6d80284c263ca7/src/nitro.ts#L138I tested the module with only changing the
nuxt.options.srcDir
tonuxt.options.rootDir
and it works fine. I hope this is the easy fix I think it is.cc @danielroe