Extension talk:CopyWatchers

Jump to navigation Jump to search

About this board

namespaces in non-english wikis

1 (talkcontribs)


make it working with namespaces in non-english wikis. I'm not sure if it is correct, but working for me.

  static function getNamespaceNumber ( $ns ) {
    global $wgCanonicalNamespaceNames;
    global $wgContLang;

//    foreach ( $wgCanonicalNamespaceNames as $i => $text ) {
    foreach (  $wgContLang->getNamespaces() as $i => $text ) {
      if (preg_match("/$ns/i", $text)) {
        return $i;

    return false; // if $ns not found above, does not exist
Reply to "namespaces in non-english wikis"
There are no older topics