Firebase has recently(Aug 20, 2020) announced support for i18n rewrites.
My web app has two locales: English and French, so I've put the French content under public/localized/fr/ and the English content under public. Then, I added the following to firebase.json:
{
"hosting": {
...
},
"i18n": {
"root": "/localized"
}
}
However, if I set French as my primary language in the browser settings(and the value of the Accept-Language header is fr), the website still serves the English content.
I have created an MCVE: https://github.com/Jaimies/firebase-hosting-i18n-rewrites-demo.
I'm using Firebase CLI version 8.9.0.
Update: I filed a bug report to Firebase support.
Update 2: I got a response from Firebase support, see this answer.
Accept-Languageheader being sent in the request when it's not working?8.9.0, and theAccept-Languagevalue isfr. I've also edited the question to include that information. I'll create a bug report in the near-time.