Return language variants
Open, NormalPublic

Description

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.


Version: 1.22.0
Severity: enhancement

Details

Reference
bz42356
bzimport raised the priority of this task from to Normal.
bzimport set Reference to bz42356.
bzimport added a subscriber: Unknown Object (MLST).
Merl created this task.Nov 22 2012, 11:30 AM

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=

Yurik added a comment.Jan 11 2013, 7:54 AM

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

Merl added a comment.Jul 3 2013, 5:32 PM

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

Merl added a comment.Jul 3 2013, 5:46 PM

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.

Restricted Application added a subscriber: TerraCodes. · View Herald TranscriptJan 11 2017, 1:53 PM
Amire80 moved this task from Untriaged to Script conversion on the I18n board.Feb 4 2018, 10:47 AM
cscott added a subscriber: cscott.Feb 24 2018, 6:15 AM