Tpt has submitted this change and it was merged.

Change subject: Set "Index" and "Page" as canonical names for Index and Page 
namespaces.
......................................................................


Set "Index" and "Page" as canonical names for Index and Page namespaces.

Change-Id: Ie0800246e7b995ec4f3e9d19b0f6705fb72afa1c
---
M ProofreadPage.body.php
M ProofreadPage.php
M includes/ProofreadPageInit.php
3 files changed, 13 insertions(+), 2 deletions(-)

Approvals:
  Tpt: Verified; Looks good to me, approved
  jenkins-bot: Checked



diff --git a/ProofreadPage.body.php b/ProofreadPage.body.php
index 4d37b7f..b2f3e85 100644
--- a/ProofreadPage.body.php
+++ b/ProofreadPage.body.php
@@ -1823,4 +1823,16 @@
                }
                return true;
        }
+
+
+       /**
+        * Adds canonical namespaces.
+        */
+       public static function addCanonicalNamespaces( &$list ) {
+               $list[self::getPageNamespaceId()] = 'Page';
+               $list[self::getPageNamespaceId() + 1] = 'Page_talk';
+               $list[self::getIndexNamespaceId()] = 'Index';
+               $list[self::getIndexNamespaceId() + 1] = 'Index_talk';
+               return true;
+       }
 }
diff --git a/ProofreadPage.php b/ProofreadPage.php
index e066366..e2790a2 100644
--- a/ProofreadPage.php
+++ b/ProofreadPage.php
@@ -150,6 +150,7 @@
 $wgHooks['GetPreferences'][] = 'ProofreadPage::onGetPreferences';
 $wgHooks['LinksUpdateConstructed'][] = 
'ProofreadPage::onLinksUpdateConstructed';
 $wgHooks['CustomEditor'][] = 'ProofreadPage::onCustomEditor';
+$wgHooks['CanonicalNamespaces'][] = 'ProofreadPage::addCanonicalNamespaces';
 
 
 //inclusion of i18n file. $wgExtensionMessagesFiles[] doesn't works
diff --git a/includes/ProofreadPageInit.php b/includes/ProofreadPageInit.php
index 40beed8..7ea37fa 100644
--- a/includes/ProofreadPageInit.php
+++ b/includes/ProofreadPageInit.php
@@ -105,8 +105,6 @@
                $wgExtraNamespaces[$id + 1] = self::getNamespaceName( $key . 
'_talk' );
                $wgCanonicalNamespaceNames[$id] = $wgExtraNamespaces[$id]; 
//Very hugly but needed because initNamespaces() is called after the add of 
$wgExtraNamespaces into $wgCanonicalNamespaceNames
                $wgCanonicalNamespaceNames[$id + 1] = $wgExtraNamespaces[$id + 
1];
-               $wgNamespaceAliases[$id] = self::getNamespaceName( $key, 'en' );
-               $wgNamespaceAliases[$id + 1] = self::getNamespaceName( $key . 
'_talk', 'en' );
                return true;
        }
 

-- 
To view, visit https://gerrit.wikimedia.org/r/66106
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: Ie0800246e7b995ec4f3e9d19b0f6705fb72afa1c
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/ProofreadPage
Gerrit-Branch: master
Gerrit-Owner: Tpt <[email protected]>
Gerrit-Reviewer: Nemo bis <[email protected]>
Gerrit-Reviewer: Reedy <[email protected]>
Gerrit-Reviewer: Tpt <[email protected]>
Gerrit-Reviewer: jenkins-bot

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to