Hi,
On Wed, Jul 22, 2015 at 5:10 PM, Sylvain Arnouts <sylvain.arnouts@wanadoo.fr
wrote:
Actually, it's the same for other languages, but the API has a very specific way to manage languages in request.
To have the datas in different languages, we have to call the langlinks props in the url, and then do llprop=url to have the url of the page for each languages. This is the final request I send to the API : $wikivoyageRequest = " https://en.wikivoyage.org/w/api.php?action=query&format=json&" //Base ."prop=coordinates|info|langlinks&" //Props list ."inprop=url" //Properties dedicated to url ."&llprop=url"//Properties dedicated to langlinks ."&generator=geosearch&ggscoord=$user_latitude|$user_longitude&ggsradius=10000&ggslimit=50"; //Properties dedicated to geosearch
The answer contains every link for every language, so I guess it solves my problem.
Well, that depends on what exactly is your problem. The query you have shown here is "find all articles within the radius on the English Wikivoyage, and give me the versions of those English articles in other languages, if they exist". However, if you try e.g. < https://en.wikivoyage.org/w/api.php?action=query&prop=coordinates%7Cinfo..., you'll find nothing, even though there is an article about Île d'Aix (lying on those coordinates) on the French and German Wikivoyages, which you _will_ find using < https://de.wikivoyage.org/w/api.php?action=query&prop=coordinates%7Cinfo... (and you would find it also on French Wikivoyage, if it had the {{#coordinates}} I wrote about in the previous message).
In other words, you are searching _only_ within English Wikivoyage articles with the query you posted above. Whether that is enough for you, I cannot decide.
HTH, -- [[cs:User:Mormegil | Petr Kadlec]]