Angular Universal with i18n (Server Side Rendering)

A solution is to pre-build packages for each language, and have a proxy detect which bundle to serve as default.

From the Angular docs on i8n:

Merge with the AOT compiler The AOT (Ahead-of-Time) compiler is part
of a build process that produces a small, fast, ready-to-run
application package.

When you internationalize with the AOT compiler, you must pre-build a
separate application package for each language and serve the
appropriate package based on either server-side language detection or
url parameters.

You also need to instruct the AOT compiler to use your translation
file. To do so, you use three options with the ng serve or ng build
commands:

–i18nFile: the path to the translation file.
–i18nFormat: the format of the translation file.
–locale: the locale id. The example below shows how to serve the French language file created in previous sections of this guide:

ng build --aot --i18nFile=src/locale/messages.fr.xlf --i18nFormat=xlf --locale=fr

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)