Replies: 1 comment
-
Facing the same issue in an Nx Monorepo. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello,
I'm building the frontend application that supposes to have a micro frontend architecture. I'm using NX Monorepo, and I currently have 5 remote apps that are together building my frontend.
The problem that I'm facing now is that I don't want to copy-paste my locales folder into every one of the remote applications.
So, each remote app should be able to run on the locale and production environment on its own address - the "port" number is different for every app. This means that every app should have a "locales" folder in its public folder, so I can use getServerSideProps and getStaticProps on the production. Following this logic, I need to update "locales" folder in 5 places, which is really hard to maintain.
When I connect all of the apps with the "host" via module-federation, and target any component from the remotes, everything is working fine because all apps are looking into public/locales of the "host" app. But, I would like to access the same "locales" folder with translations when I'm visiting just one remote app on it's own address. Is this possible?
I'm really sorry if this sound confusing. I will explain this deeper if there is a need.
This is my next-i18next.config.json in every one of 5 apps:
module.exports = {
i18n: {
defaultLocale: 'en',
locales: ['en', 'fr'],
},
localePath:
typeof window === 'undefined'
? require('path').resolve('./public/locales')
: require('path').resolve(__dirname + '../../../locales'),
};
Thank you in advance.
Beta Was this translation helpful? Give feedback.
All reactions