Hi James! Thanks for contributing to MDN!
Good question! The best practice would be to remove the locale string from the URL (that is, start the relative URL with “/docs”). When a user follows such a link, MDN resolves the locale to the user’s browser preference. For example, if their browser locale is Spanish, they get “/es/docs/…”. If that page doesn’t exist in their preferred language, then they see the English page with a banner at the top (that hopefully has been translated), telling them that the page has not been translated in their language, and inviting them to contribute a translation.
As I said, that would be a best practice, but we haven’t actually been doing it consistently. For example, the link picker UI in the editor includes the locale in the URL. One consequence of this is that there are a lot of “/en-US” links hardcoded in translated pages, because localizers translate the text, but don’t always change the links. I’m not sure how we would end up with “/de” links in English pages, but it might happen by someone selecting a URL with the wrong locale by mistake.
In short, to answer your question, yes, removing locale strings from internal links would be the ideal way to clean up URLs. But it would also be a very big job to fix all the links that include locale strings, because there are so many of them. Definitely remove them from links where the locale string is incorrect for the language of the page where they appear.
–Janet