For instance I am writing an article in english about revision control that I would like to translate to several other languages. I would like to avoid manually translating the link to the Wikipedia article as the page name can be different in other languages.
Using the Wikipedia API (or other hacks), is it possible to build a language independent URL to the wikipedia article with the language as parameter ?
It doesn't seem so difficult given that:
- each Wikipedia article already includes the links to other languages in a standard format
- the Wikipedia API has the langlinks property to retrieve the links to other languages (http://en.wikipedia.org/w/api.php?action=query&titles=Revision_control&prop=langlinks&lllimit=500)
- wikidata also can offer the links to other languages (https://www.wikidata.org/wiki/Q189439#sitelinks-wikipedia)
However I don't find any way or hack to get the particular page in the specified language using simply an URL (with ?lang=fr for instance). Of course it would have been easy if I could rewrite the URL before displaying it, but I am looking for a solution which can be used everywhere (so a simple URL).
Note 1: I know that it may be a bad idea in general, as the same page in a language can be represented by several other pages in a different language. However I will only use that on some very precise subjects which won't have this drawback.
Note 2: If the article doesn't exist in the specified language, a fallback to the original english article would be nice.