Extension talk:CopyWatchers
Add topicAppearance
Latest comment: 9 years ago by 192.164.80.36 in topic namespaces in non-english wikis
| This page used the Structured Discussions extension to give structured discussions. It has since been converted to wikitext, so the content and history here are only an approximation of what was actually displayed at the time these comments were made. |
namespaces in non-english wikis
[edit]Ahoj,
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
}