https://bugzilla.wikimedia.org/show_bug.cgi?id=25375

           Summary: wgNamespaceIds should also contain canonical
                    namespaces
           Product: MediaWiki
           Version: unspecified
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: enhancement
          Priority: Normal
         Component: Javascript
        AssignedTo: d...@ucsc.edu
        ReportedBy: llam...@gmail.com
                CC: tpars...@wikimedia.org


>From http://www.mediawiki.org/wiki/Manual:Interface/JavaScript:
wgNamespaceIds - Gives a mapping from namespace names to namespace IDs. For
each namespace name, ***including aliases***, the object has one entry that has
namespace name as the key and the namespace ID as its integer value.
***Canonical names are not included***.

So it is supposed to contain all aliases but not contain canonical namespaces.
It's illogical to me. Canonical namespaces also work as aliases!

I'm writing a script for Polish wikipedia which extracts a link from an article
and works out the id of the namespace it leads to. The most straight-forward
way would be to extract the namespace from the link and search for it in
wgNamespaceIds. But it's not that simple, because the link may contain a
namespace in its canonical form. So now I'm going to define my own table, put
canonical namespaces to it by hand, merge it with wgNamespaceIds... Quite easy,
but not nice.

An alternative solution would be to define a new table with ids of canonical
namespace names.

-- 
Configure bugmail: https://bugzilla.wikimedia.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.

_______________________________________________
Wikibugs-l mailing list
Wikibugs-l@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikibugs-l

Reply via email to