-
Notifications
You must be signed in to change notification settings - Fork 483
How to build SSR with multi-lang (i18n) with Angular 9 #1497
Comments
I am not able to configure SSR with i18n. |
Hi, let continue tracking this here #1497 |
Wrong link angular/angular-cli#25726 |
I was able to let it work by creating 2 server.ts files (server.ar.ts) and (server.en.ts)
with this implementation my dist folder will be like the following:
If you are deploying to apache 2.4 you can configure the virtual host as follows
|
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
How to build SSR with i18n with Angular 9?
With the new angular version, documentation is not clear to me how to build angular 9 SSR with i18n.
Previously in version 8, I was doing the following commands:
ng build --configuration=production-ar && ng build --configuration=production-en && ng run website:server:production-en && ng run website:server:production-ar
webpack --config apps/website/webpack.server.config.js --progress --colors
you can check my implementation in this demo repo: https://github.com/keserwan/testAngularPrerender
The output in the "dist" folder was the following:
dist>Website>
Currently, I am lost how to build multi-lang without webpack.server.config.js .
Is there any template project for such requirements? I didn't find it in the documentation.
here is my current angular.json
here is my server.ts (I modified line 14 to read from /website/ar/browser)
How to make server.ts file work for both languages?
Should I have 2 instances of the server (line 44 in the image above)? one for 'en' and one for 'ar'?
What changes should I do to server.ts to do these 2 calls? Should I create 2 server.ts?
ng run website:server:production-en && ng run website:server:production-ar
🌍 Your Environment
The text was updated successfully, but these errors were encountered: