After a lot of research, I finally decided to use Angular Internationalization (i18n).
Current routes (as you can see they are independent of the language):
const routes: Routes = [
{
path: '',
canActivate: [AuthGuardService],
loadChildren: () => import('./commercial-layout/commercial-layout.module').then(m => m.CommercialLayoutModule)
},
{path: 'maintenance', component: MaintenanceComponent},
{
path: 'auth',
loadChildren: () => import('./auth/auth.module').then(m => m.AuthModule)
},
{path: '**', redirectTo: 'water', pathMatch: 'full'}
];
I have support for 2 languages right now, en and fr.
NOTE: My website was already in production and I am adding i18n now.
However, I am facing the following problem and could not find any resource to fix it:
If I manually enter "en" or "fr" after my url ends (www.myUrl.com/en OR www.myUrl.com/fr), it works fine.
However if I try to go to the default url without language (www.myUrl.com), the website crashes/does not load.
Also all the routes inside my LAZY LOADED application are not working properly as well.
Error on going to my main route: 403 Forbidden
Do I need to rewrite all my routes for the support for i18n or is there a better way?
Thanks!