I have a project which has 3 Shell apps and a Main app.
- The 3 shell apps are agent-mfe, master-mfe, and notification-mfe.
- The main app is called main-frontend.
When a user loads the shell apps separately, they are displayed in the language English
. However, when the user tries to load the shell apps inside the main app, they are displayed in Chinese. I found the reason for this issue: when we are running the shell apps separately we are setting the language to English
by app.module.ts using the
providers: [{
provid: NZ_I18N,
useValue: en_US,
}]
But when we are opening the shell app inside the main app we are using webbpack to do that and inside the shell app in webpack we are exposing the modules separately not the app.module.ts in shell app it is like
exposes: {
'./AgentModule': './/src/app/agent/agent.module.ts',
'./AgentDirectoryModule': './/src/app/agent-directory/agent-directory.module.ts',
'./AgentManagementModule': './/src/app/agent-management/agent-management.module.ts',
'./AgentProfileChangesModule': './/src/app/agent-profile-changes/agent-profile-changes.module.ts',
'./DistributionChannelModule': './/src/app/distribution-channel/distribution-channel.module.ts',
'./TemporaryAssignmentModule': './/src/app/temporary-assignment/temporary-assignment.module.ts',
},
becouse of that app.module.ts is not running and not setting the language to English
As a Solution for this I set the language to english
in every separate module in here
'./AgentModule': './/src/app/agent/agent.module.ts',
'./AgentDirectoryModule': './/src/app/agent-directory/agent-directory.module.ts',
'./AgentManagementModule': './/src/app/agent-management/agent-management.module.ts',
'./AgentProfileChangesModule': './/src/app/agent-profile-changes/agent-profile-changes.module.ts',
'./DistributionChannelModule': './/src/app/distribution-channel/distribution-channel.module.ts',
'./TemporaryAssignmentModule': './/src/app/temporary-assignment/temporary-assignment.module.ts'
But it is not appling when I do it like this.
I need to apply the same language in main app to the shell apps.