Conversation
## Because - `supported-languages.json` lists `en-US`, but the l10n repo only ships `en`, `en-CA` and `en-GB`. Every page load asked for `.../en-US/main.ftl` and got a 404, so the request could never be a cache hit. - Negotiation made that unavoidable. `en-US` matched itself, and a plain `en` header expanded to every `en-*` entry in the list, which pulled `en-US` in too. ## This pull request - Drops `en-US` from `supported-languages.json`. Fluent strips the region and resolves `en-US` to `en`, so we serve the English bundle we actually deploy. - Adds a case to `supported-languages.spec.ts` that keeps `en-US` out of the list. JSON holds no comments, so the test carries the reason. - Adds `parseAcceptLanguage` and `determineLocale` cases for `en-US`, and updates the existing expectations in `l10n.utils.spec.ts`. - Moves the `en-US` fixtures in `AppLocalizationProvider.test.tsx` and `NimbusContext.test.tsx` to `en-CA`, a locale we do deploy. - Adds a `NimbusContext` case for the region change described below. I picked removal over an `EN_GB_LOCALES`-style alias. An alias fixes the `en-US` header but not the `en` header, which still expands to `en-US` through the available-range match, so the 404 would stay. ## Issue that this pull request solves Closes: https://mozilla-hub.atlassian.net/browse/FXA-10363
Contributor
There was a problem hiding this comment.
Pull request overview
Removes undeployed en-US localization resources from locale negotiation, preventing repeated FTL 404s.
Changes:
- Removes
en-USfrom supported locales. - Updates negotiation and formatting expectations to resolve
en-UStoen. - Replaces test fixtures with deployed
en-CAresources and verifies Nimbus region behavior.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
libs/shared/l10n/src/lib/supported-languages.json |
Removes unsupported en-US. |
libs/shared/l10n/src/lib/supported-languages.spec.ts |
Guards against reintroducing en-US. |
libs/shared/l10n/src/lib/l10n.utils.spec.ts |
Updates locale negotiation expectations. |
libs/accounts/email-renderer/src/renderer/email-helpers.spec.ts |
Verifies email locale fallback. |
packages/fxa-react/lib/AppLocalizationProvider.test.tsx |
Uses deployed en-CA fixtures. |
packages/fxa-settings/src/models/contexts/NimbusContext.test.tsx |
Tests updated Nimbus region targeting. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Contributor
Author
|
This PR lgtm, it is small change. |
toufali
approved these changes
Sep 1, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Because
supported-languages.jsonlistsen-US, but the l10n repo only shipsen,en-CAanden-GB. Every page load asked for.../en-US/main.ftland got a 404, so the request could never be a cache hit.en-USmatched itself, and a plainenheader expanded to everyen-*entry in the list, which pulleden-USin too.This pull request
en-USfromsupported-languages.json. Fluent strips the region and resolvesen-UStoen, so we serve the English bundle we actually deploy.supported-languages.spec.tsthat keepsen-USout of the list. JSON holds no comments, so the test carries the reason.parseAcceptLanguageanddetermineLocalecases foren-US, and updates the existing expectations inl10n.utils.spec.ts.en-USfixtures inAppLocalizationProvider.test.tsxandNimbusContext.test.tsxtoen-CA, a locale we do deploy.NimbusContextcase for the region change described below.I picked removal over an
EN_GB_LOCALES-style alias. An alias fixes theen-USheader but not theenheader, which still expands toen-USthrough the available-range match, so the 404 would stay.Issue that this pull request solves
Closes: https://mozilla-hub.atlassian.net/browse/FXA-10363
Checklist
Put an
xin the boxes that applyHow to review (Optional)
libs/shared/l10n/src/lib/supported-languages.jsonis the whole fix. The rest follows from it.l10n.utils.spec.ts, then the two consumer tests.NimbusContextderives its Nimbus targeting region from the negotiated locale. Anen-USuser used to sendregion: "us"and now sends no region. If any experiment targets US, that needs a follow-up ticket. There is a test for the new behaviour, but I did not widen this PR to change it.fxa-settingslanguage switcher builds its option list from the same JSON, so "English (US)" drops off it. Those users get theenstrings they were already served after the 404.Screenshots (Optional)
Other information (Optional)
Local runs:
shared-l10n89 passed,fxa-react106 passed,accounts-email-renderer122 passed,fxa-settingslocale tests 38 passed, all with 0 failures.nx lintis clean for the four projects.LOCALE_MAPPINGSinpackages/fxa-settings/src/lib/locales.tsstill holds anen-USentry. The switcher filters that map by the supported list, so the entry is now unreachable. I left it alone rather than touch a file this ticket does not need.