Last modified: 2012-04-16 09:15:49 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 T28165, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 26165 - mediawiki api action=parse does not support language variants
mediawiki api action=parse does not support language variants
Status: CLOSED WORKSFORME
Product: MediaWiki
Classification: Unclassified
API (Other open bugs)
unspecified
All All
: High enhancement (vote)
: ---
Assigned To: Roan Kattouw
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2010-11-29 17:27 UTC by Robert Chin
Modified: 2012-04-16 09:15 UTC (History)
6 users (show)

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


Attachments

Description Robert Chin 2010-11-29 17:27:49 UTC
Currently the mediawiki api does not support language variants. That means that anything returned from the api from zh.wikipedia.org is not necessarily the right variant. I saw there were previous bugs written regarding the api and variants but those were related to getting the raw wikitext and not the parsed output. Since this is post transform presumably it should be ok to to do variant conversion here.
Comment 1 Bawolff (Brian Wolff) 2011-01-27 19:47:11 UTC
This works for me. (Assuming the language code of the wiki is one that has variants like zh or sr);

(I'm testing Serbian, because I can't make heads or tails out of Chinese characters, but I can tell the difference between Latin and Cyrillic.)

http://sr.wikipedia.org/w/api.php?action=parse&text=foo&prop=text&disablepp produces "foo" (plus some html). (aka no variant)

http://sr.wikipedia.org/w/api.php?action=parse&text=foo&prop=text&disablepp&uselang=sr-el produces "foo" (aka, the Latin variant is selected)

http://sr.wikipedia.org/w/api.php?action=parse&text=foo&prop=text&disablepp&uselang=sr-ec produces "фоо" (aka Cyrillic variant)

This also works using the page parameter as well. Thus, this is supported via the uselang parameter, so closing works for me.
Comment 2 Robert Chin 2011-01-28 04:15:29 UTC
Thanks for that, I guess this is new in 1.17 which is why it is not in the documentation returned by api.php.
Comment 3 Derk-Jan Hartman 2011-01-28 09:30:09 UTC
Does it also support &variant=, like index.php uses ?

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


Navigation
Links