r95775 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r95774‎ | r95775 | r95776 >
Date:13:24, 30 August 2011
Author:nikerabbit
Status:ok (Comments)
Tags:
Comment:
New hook to replace live hack on translatewiki.net. Allows reordering namespaces
Modified paths:
  • /trunk/phase3/docs/hooks.txt (modified) (history)
  • /trunk/phase3/languages/Language.php (modified) (history)

Diff [purge]

Index: trunk/phase3/docs/hooks.txt
@@ -1089,6 +1089,10 @@
10901090 &$result: Set this and return false to override the internal checks
10911091 $user: User the password is being validated for
10921092
 1093+'LanguageGetNamespaces': Provide custom ordering for namespaces or
 1094+remove namespaces. Do not use this hook to add namespaces.
 1095+&$namespaces: Array of namespaces indexed by their numbers
 1096+
10931097 'LanguageGetMagic': DEPRECATED, use $magicWords in a file listed in
10941098 $wgExtensionMessagesFiles instead.
10951099 Use this to define synonyms of magic words depending of the language
Index: trunk/phase3/languages/Language.php
@@ -341,6 +341,8 @@
342342 # The above mixing may leave namespaces out of canonical order.
343343 # Re-order by namespace ID number...
344344 ksort( $this->namespaceNames );
 345+
 346+ wfRunHooks( 'LanguageGetNamespaces', array( &$this->namespaceNames ) );
345347 }
346348 return $this->namespaceNames;
347349 }
@@ -3312,7 +3314,7 @@
33133315 }
33143316
33153317 /**
3316 - * Get the first fallback for a given language
 3318+ * Get the first fallback for a given language.
33173319 *
33183320 * @param $code string
33193321 *

Follow-up revisions

RevisionCommit summaryAuthorDate
r95781Amend r95775 per Siebrand's suggestionnikerabbit13:59, 30 August 2011

Comments

#Comment by Siebrand (talk | contribs)   13:57, 30 August 2011

"Do not use this hook to add namespaces." You may want to suggest what one should use to save them the trouble of searching for it...

Status & tagging log