Skip to content

Commit

Permalink
Merge pull request #709 from reactjs/tweak-external-link-urls
Browse files Browse the repository at this point in the history
Redirect some external links to Japanese versions
  • Loading branch information
smikitky authored Nov 10, 2023
2 parents 83bcd95 + ee44016 commit df8fcdc
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/components/MDX/Link.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,16 @@ function Link({
// eslint-disable-next-line jsx-a11y/anchor-has-content
return <a href={href} className={className} {...props} />;
}

// Tweak external links (added by ja.react.dev team)
href = href
.replace(
'https://developer.mozilla.org/en-US/',
'https://developer.mozilla.org/'
)
.replace('https://reactjs.org/', 'https://ja.reactjs.org/')
.replace('https://legacy.reactjs.org/', 'https://ja.legacy.reactjs.org/');

return (
<>
{href.startsWith('https://') ? (
Expand Down

0 comments on commit df8fcdc

Please sign in to comment.