as lastTabIndex().
* (bug 29332) Warn if user requests mediawiki-announce subscription but does not
enter an e-mail address.
+* (bug 25375) Add canonical namespaces to JavaScript "wgNamespaceIds"
=== API changes in 1.19 ===
* BREAKING CHANGE: action=watch now requires POST and token.
);
$mainPage = Title::newMainPage();
+ // Build wgNamespaceIds
+ // A complete key-value pair object mapping localized, canonical and aliases for namespaces
+ // to their numerical ids (case insensitive and with underscores)
+ $namespaceIds = $wgContLang->getNamespaceIds();
+ foreach( MWNamespace::getCanonicalNamespaces() as $index => $name ) {
+ $nsIds[$wgContLang->lc( $name )] = $index;
+ }
+
// Build list of variables
$vars = array(
'wgLoadScript' => $wgLoadScript,
'wgDigitTransformTable' => $compactDigitTransTable,
'wgMainPageTitle' => $mainPage ? $mainPage->getPrefixedText() : null,
'wgFormattedNamespaces' => $wgContLang->getFormattedNamespaces(),
- 'wgNamespaceIds' => $wgContLang->getNamespaceIds(),
+ 'wgNamespaceIds' => $namespaceIds,
'wgSiteName' => $wgSitename,
'wgFileExtensions' => array_values( $wgFileExtensions ),
'wgDBname' => $wgDBname,