Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

URLs without locales do not do correct locale fallback #11717

Open
3 tasks done
DonalMe opened this issue Aug 30, 2024 · 3 comments
Open
3 tasks done

URLs without locales do not do correct locale fallback #11717

DonalMe opened this issue Aug 30, 2024 · 3 comments
Labels
enhancement Improves an existing feature. localization i18n & l10n needs triage Triage needed by staff and/or partners. Automatically applied when an issue is opened. redirects all things related to redirecting

Comments

@DonalMe
Copy link

DonalMe commented Aug 30, 2024

Summary

We do not include a local in the MDN URLs in the Firefox release notes. The goal is for users in non-en locales following links in the release notes to be correctly redirected to their locale.
This is not working for MDN URLs and leads to a 404 in non-English locales.

URL

Example: https://developer.mozilla.org/docs/Web/API/WebCodecs_API

Reproduction steps

  1. Browse in a non-en locale
  2. Navigate to a MDN URL without a locale (example https://developer.mozilla.org/docs/Web/API/WebCodecs_API)

Expected behavior

There should be a redirect to your locale (example https://developer.mozilla.org/fr/docs/Web/API/WebCodecs_API)

Actual behavior

404 page

Device

Desktop

Browser

Firefox

Browser version

Stable

Operating system

Mac OS

Screenshot

No response

Anything else?

curl --header "Accept-Language: fr,fr-fr,en-us,en" -LIs https://developer.mozilla.org/docs/Web/API/WebCodecs_API | grep HTTP

Validations

@github-actions github-actions bot added the needs triage Triage needed by staff and/or partners. Automatically applied when an issue is opened. label Aug 30, 2024
@caugner
Copy link
Contributor

caugner commented Sep 3, 2024

@DonalMe Overall, this seems to work as intended: https://developer.mozilla.org/docs/Web/API/WebCodecs_API redirects to https://developer.mozilla.org/fr/docs/Web/API/WebCodecs_API, because this is the first locale in the Accept-Language header that MDN supports, but since the page isn't localized yet, a 404 page is displayed instead, with a link to the English version.

Do you expect to be redirected to en-US instead, because it's the first locale listed in the Accept-Language header for which the page exists?

@caugner caugner added localization i18n & l10n redirects all things related to redirecting labels Sep 3, 2024
@DonalMe
Copy link
Author

DonalMe commented Sep 3, 2024

@caugner sorry, I didn't realize this behavior was because the page wasn't localized.
If the redirect works when the page is localized, maybe it should fallback to en-us when it is not localized instead of a 404?

@pascalchevrel
Copy link

IMO, MDN should go through all the accept-lang fallback locales through content negociation (https://developer.mozilla.org/en-US/docs/Web/HTTP/Content_negotiation#the_accept-language_header)

@caugner caugner added the enhancement Improves an existing feature. label Sep 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Improves an existing feature. localization i18n & l10n needs triage Triage needed by staff and/or partners. Automatically applied when an issue is opened. redirects all things related to redirecting
Projects
None yet
Development

No branches or pull requests

3 participants