Feature Request : Support i18n + ssr
Hi I have tried some solutions to provide both i18n and server-side rendering but it seem firebase have limitation that baseHref of each locale must be "" so I can't figure way around this.
It will be nice if we can have solution for this kind of usecase.
Please submit feature requests through our support page.
Firebase uses rewrites rather than redirects for i18n, we should document this but for SSR the locale is passed as an argument to the express app factory in your server.ts.
Our test suite uses i18n FYI, see our angular.json and server.ts
thank you @jamesdaniels
It worked 100% for me, with angular projects, ssr, i18n and firebase hosting.
@jamesdaniels How do you change the locale?
registerLocaleData doesn’t seem to work for me. I assume the server should handle the language change. I tried following this setup: https://github.com/lostium/ssr-i18n-angular17, but I'm encountering an issue where dist/<project>/browser/<locale>/index.html cannot load JS and CSS files because baseHref is set to "". I tried adjusting the path with an additional postbuild script, but that caused more problems.
After a few days of trying, I almost gave up, but then I found this issue. Honestly, it gave me some hope.
Hi,
As @jamesdaniels mentioned, Firebase uses rewrites to support i18n.
I've created repository with simple example how to configure Angular (version 20) app which supports i18n, ssr and it's deployable to Firebase (using firebase-tools - 14.6.0)
https://github.com/monogramdesign/firebase-tools-test-apps/tree/main/angular/example-i18n-ssr-app
Please take a look at the configuration of angular.json and firebase.json, these files contain the most crucial settings for applications of this type.