Page not found with fallback notecard doesn't present language switcher
Summary
If you visit a page with no locale in the URL and have a language preference set (through browser or OS settings), we will 404 the page even though there may be an EN equivalent.
The 404 notecard with a fallback doesn't offer to change languages and persist this preference for future visits.
URL
https://developer.mozilla.org/docs/Mozilla/Firefox/Releases/124
Reproduction steps
- Set FR as preferred language in browser preferences
- Navigate to https://www.mozilla.org/firefox/124.0/releasenotes/
- Scroll to Developer and click Developer Information (links to https://developer.mozilla.org/docs/Mozilla/Firefox/Releases/124 with no locale)
Expected behavior
The notecard with a fallback URL also includes a language switcher to set preferredlocale for site-wide preferences.
Actual behavior
Visiting the https://developer.mozilla.org/docs/Mozilla/Firefox/Releases/124 page will make us land on the FR version with no option to persist language preference.
Additionally, the destination URL (an en-US fallback) exists, but there is no translated version, so we do not offer the language switcher to set future preferences when the visitor lands there.
Device
Desktop
Browser
Firefox
Browser version
Stable
Operating system
Mac OS
Screenshot
No response
Anything else?
Request headers to send back fr equivalent looks like Accept-Language: fr,fr-FR;q=0.8,en-US;q=0.5,en;q=0.3
https://github.com/mdn/yari/blob/6e6ed7873373e35d720922b5924a0537566b4851/client/src/page-not-found/fallback-link.tsx#L95-L112
Validations
- [X] I have read the Community Participation Guidelines.
- [X] I have verified that there isn't already an issue that reports the same bug to avoid creating a duplicate.
- [X] I have checked that this is a concrete bug. For Q&A open a GitHub Discussion.