Last modified: 2013-07-03 20:23:32 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T44356, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 42356 - Return language variants
Return language variants
Status: NEW
Product: MediaWiki
Classification: Unclassified
API (Other open bugs)
1.22.0
All All
: Normal enhancement (vote)
: ---
Assigned To: Nobody - You can work on this!
: easy, i18n
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2012-11-22 11:30 UTC by merl
Modified: 2013-07-03 20:23 UTC (History)
7 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description merl 2012-11-22 11:30:43 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.
Comment 2 Umherirrender 2012-11-22 19:31:50 UTC
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=
Comment 3 Yuri Astrakhan 2013-01-11 07:54:21 UTC
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
Comment 4 merl 2013-07-03 17:32:19 UTC
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.
Comment 5 Liangent 2013-07-03 17:34:53 UTC
(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.
Comment 6 Liangent 2013-07-03 17:36:11 UTC
(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
Comment 7 merl 2013-07-03 17:46:21 UTC
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.
Comment 8 Liangent 2013-07-03 17:48:12 UTC
(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.

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links