On 12/13/2007 11:28 PM, Paolo Liberatore wrote:
On Thu, 13 Dec 2007, Jan Hecking wrote:
On 12/13/2007 1:04 AM, Roan Kattouw wrote:
Jan Hecking schreef:
Hi,
Is it possible to retrieve content in different Chinese language variants using the /w/api.php API? There doesn't seem to be a variant or language parameter that would allow selecting a variant like "zh-tw" or "zh-hk". Is there some other way to do this?
How is this done in the regular user interface, then?
I would like to know that as well. :)
My suspicion is that the user interface, i.e. the frontend servers, do the conversion. Which would mean that all users of the MediaWiki API would have to replicate that work. That would severely limit the use of the API for Chinese language content IMHO. But then I don't know much about MediaWiki yet and maybe I have just missed something obvious.
Thanks, Jan
There is a "variant" parameter in http://www.mediawiki.org/wiki/Manual:Parameters_to_index.php I believe it's only used for Chinese.
Thanks for the reminder, Paolo! I hadn't considered index.php before because I assumed it only returns the rendered HTML markup. But now I saw that there is an action=raw parameter which returns the raw wiki markup that I'm looking for. However this API has one other drawback: In contrast to api.php it doesn't have an option to resolve redirects automatically. When calling api.php I was using the redirects parameter to do so but this doesn't seem to be supported by index.php when using action=raw (only for action=view). That means I would potentially have to make multiple calls to resolve redirects manually. Or is there a way to avoid this?
Thanks, Jan