Last modified: 2013-07-03 20:23:32 UTC
I would like to get language variants of the title using the api. e.g. Article: http://sr.wikipedia.org/wiki/%D0%92%D0%B8%D0%BA%D0%B8%D0%BF%D0%B5%D0%B4%D0%B8%D1%98%D0%B0 I need to know that sr-el is "Vikipedija" and sr-ec "Википедија" I think this could be implemented by either extending prop=info or adding a new querymodules.
There can be http://sr.wikipedia.org/w/api.php?action=parse&page=%D0%92%D0%B8%D0%BA%D0%B8%D0%BF%D0%B5%D0%B4%D0%B8%D1%98%D0%B0&prop=displaytitle&variant=sr-el http://sr.wikipedia.org/w/api.php?action=parse&page=%D0%92%D0%B8%D0%BA%D0%B8%D0%BF%D0%B5%D0%B4%D0%B8%D1%98%D0%B0&prop=displaytitle&variant=sr-ec BUT WARNING this "variant" parameter is a hack (bug 32906 comment 23) and we don't like it.
You can use action=query&converttitles= to let the api choose the right page, but you will not get the mapping between the pages, when starting with Википедија. http://sr.wikipedia.org/w/api.php?action=query&titles=Vikipedija&converttitles= http://sr.wikipedia.org/w/api.php?action=query&titles=%D0%92%D0%B8%D0%BA%D0%B8%D0%BF%D0%B5%D0%B4%D0%B8%D1%98%D0%B0&converttitles=
I have just started looking at converttitles. What should be the "default" behavior? https://meta.wikimedia.org/wiki/Wikipedias_in_Multi-writing_System has a long list of all auto-converted languages, but I could certainly use help with defining how the API should function with regards to that. Please comment at https://www.mediawiki.org/wiki/Requests_for_comment/API_Future
Rising priority because the hack used by my bot using action=parse&prop=displaytitle&variants isn't working anymomre (since june 2013). e.g.http://sr.wikipedia.org/w/api.php?action=parse&pageid=2072&prop=displaytitle&variant=sr-el|sr-ec fails since about a month. My bot needs this info for automatically creating labels at wikidata items.
(In reply to comment #4) > Rising priority because the hack used by my bot using > action=parse&prop=displaytitle&variants isn't working anymomre (since june > 2013). > e.g.http://sr.wikipedia.org/w/api. > php?action=parse&pageid=2072&prop=displaytitle&variant=sr-el|sr-ec > fails since about a month. > > My bot needs this info for automatically creating labels at wikidata items. Just place the real title (no matter whether it's sr-ec or sr-el) to language sr on Wikidata.
(In reply to comment #4) > Rising priority because the hack used by my bot using > action=parse&prop=displaytitle&variants isn't working anymomre (since june > 2013). > e.g.http://sr.wikipedia.org/w/api. > php?action=parse&pageid=2072&prop=displaytitle&variant=sr-el|sr-ec > fails since about a month. You can't pipe two variants together here. Use two separate requests: http://sr.wikipedia.org/w/api.php?action=parse&pageid=2072&prop=displaytitle&variant=sr-ec http://sr.wikipedia.org/w/api.php?action=parse&pageid=2072&prop=displaytitle&variant=sr-el
If code change was only that requesting multiple variants in one request isn't supported anymore than i can simply chance my code to send multiple api requests. Thanks. (btw.: I havn't found the git patch that is responsible for this change in the undocumented variable parameter) p.s: wikidata does not support automatic variant conversion, so i need to add all variants as label.
(In reply to comment #7) > p.s: wikidata does not support automatic variant conversion, so i need to add > all variants as label. I'm doing it.