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

Broken link checkers should fallback to en-US if possible #3254

Conversation

peterbe
Copy link
Contributor

@peterbe peterbe commented Mar 16, 2021

Fixes #3104

Take http://localhost:3000/bg/docs/Web for example.
Compare it with https://developer.mozilla.org/bg/docs/Web
There are lots of broken links on that page (in Prod). And a lot of them are really broken because when you click on one of them (e.g. https://developer.mozilla.org/bg/docs/Web/Apps) you get a 404 Page not found, but without that helpful "Good news!" (green) message that it's available in English. That's because that Belarusian link is so broken and old that it doesn't check for redirects.

Now it becomes this:

<a href="/en-US/docs/Web/Progressive_web_apps" class="only-in-en-us" 
title="Currently only available in English" data-flaw="link14">Разработка на уеб приложения (en-US)</a>
  • Add tests
  • Check how often this happens for realz: UPDATE 5,167 links in all of the translated-content got switched to the en-US fallback URL on a complete build.

@peterbe
Copy link
Contributor Author

peterbe commented Mar 16, 2021

Here's another good example on http://localhost:3000/ru/docs/Tools/Responsive_Design_Mode
Screen Shot 2021-03-16 at 10 17 57 AM

@peterbe peterbe marked this pull request as ready for review March 16, 2021 15:34
@peterbe peterbe requested a review from fiji-flo March 16, 2021 15:35
Copy link
Contributor

@fiji-flo fiji-flo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Took me a bit to find the dumber -> number redirect :)

Looks great.

@fiji-flo fiji-flo merged commit f72618b into mdn:main Mar 16, 2021
@peterbe peterbe deleted the 3104-broken-link-checkers-should-fallback-nicely-to-english-if-need-be branch March 16, 2021 19:53
peterbe added a commit to peterbe/yari that referenced this pull request Jun 1, 2021
* Broken link checkers should fallback nicely to English if need be

Fixes mdn#3104

* remove debugging

* adding tests
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Broken link checkers should fallback nicely to English if need be
2 participants