Thank you all. This is perfect solution.
On Thu, Nov 21, 2013 at 1:31 PM, Kevin Israel <pleasestand(a)live.com> wrote:
On 11/21/2013 06:57 AM, Petr Bena wrote:
Hi,
Is there some effective way to retrieve a list of namespaces for a
wiki? In huggle we have that hardcoded now, but that kind of suck,
because every wiki can have some custom NS.
Of course:
https://en.wikipedia.org/w/api.php?action=query&meta=siteinfo&sipro…
* Namespace original name (the english one which
can be used on any
language wiki, like User or Talk) and its talk id
This is called the "canonical" namespace name.
* Namespace localized name
This is the text inside each XML element (the '*' key if using JSON).
and its talk id (User talk for User)
Subject namespace IDs are even; talk namespace IDs are odd. You can
assume that the ID of the talk namespace is that of the subject
namespace plus one. The name for the talk namespace can then be found
exactly as for the subject namespace.
However, this applies only to namespaces usable by actual wiki pages.
The "Special" and "Media" namespaces, which have IDs less than
NS_MAIN
(0), have no "Special talk" and "Media talk" counterparts.
* Namespace ID
This is the "id" attribute.
--
Kevin Israel - MediaWiki developer, Wikipedia editor
http://en.wikipedia.org/wiki/User:PleaseStand
_______________________________________________
Wikitech-l mailing list
Wikitech-l(a)lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikitech-l