From 11a50da270198fdd17ae521863e5bd289ea8606d Mon Sep 17 00:00:00 2001 From: =?utf8?q?Niklas=20Laxstr=C3=B6m?= Date: Tue, 30 Aug 2011 13:24:27 +0000 Subject: [PATCH] New hook to replace live hack on translatewiki.net. Allows reordering namespaces --- docs/hooks.txt | 4 ++++ languages/Language.php | 4 +++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/docs/hooks.txt b/docs/hooks.txt index 349a87f319..745ae73098 100644 --- a/docs/hooks.txt +++ b/docs/hooks.txt @@ -1089,6 +1089,10 @@ $password: The password entered by the user &$result: Set this and return false to override the internal checks $user: User the password is being validated for +'LanguageGetNamespaces': Provide custom ordering for namespaces or +remove namespaces. Do not use this hook to add namespaces. +&$namespaces: Array of namespaces indexed by their numbers + 'LanguageGetMagic': DEPRECATED, use $magicWords in a file listed in $wgExtensionMessagesFiles instead. Use this to define synonyms of magic words depending of the language diff --git a/languages/Language.php b/languages/Language.php index 49067be2cd..308e6602d2 100644 --- a/languages/Language.php +++ b/languages/Language.php @@ -341,6 +341,8 @@ class Language { # The above mixing may leave namespaces out of canonical order. # Re-order by namespace ID number... ksort( $this->namespaceNames ); + + wfRunHooks( 'LanguageGetNamespaces', array( &$this->namespaceNames ) ); } return $this->namespaceNames; } @@ -3312,7 +3314,7 @@ class Language { } /** - * Get the first fallback for a given language + * Get the first fallback for a given language. * * @param $code string * -- 2.20.1