Using next-18next with Nx #2088
Unanswered
LorenzoGalassi
asked this question in
Q&A
Replies: 1 comment
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I'm currently creating an application bootstrapped with Nx and deployed to Vercel.
My main app uses Next.js 13 and I'm trying to configure next-18next for internationalisation, the issue is related to the
next-18next.config.js
file, because I have to add this line forlocalePath
(following the advices on nrwl/nx#4983 this discussion):localePath: path.resolve(process.env.NEXT_PUBLIC_IS_DEVELOPMENT === 'true' ? './apps/host/public/locales' : './public/locales'),
This does not fix the issue tho, because it seems that some namespaces are loaded and some of them are not. Nx build creates a dist folder with apps/{app-name}/public/locales/{lang}/{namespace}.json (so in theory the definition of localepath proposed above is not correct).
When deployed some namespaces are loaded if I use the localePath definition proposed above, some of them are loaded only if i change it to
localePath: path.resolve('./apps/host/public/locales')
. Any suggestion?Beta Was this translation helpful? Give feedback.
All reactions