r94992 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r94991‎ | r94992 | r94993 >
Date:09:43, 19 August 2011
Author:macbre
Status:ok
Tags:
Comment:
LinkSuggest: localise namespaces in suggested pages (use wiki content language)
Modified paths:
  • /trunk/extensions/LinkSuggest/LinkSuggest.php (modified) (history)

Diff [purge]

Index: trunk/extensions/LinkSuggest/LinkSuggest.php
@@ -240,11 +240,13 @@
241241 *
242242 * @param $namespace integer page namespace ID
243243 * @param $title string page title
244 - * @return string formatted title (prefixed with namespace)
 244+ * @return string formatted title (prefixed with localised namespace)
245245 */
246246 function wfLinkSuggestFormatTitle( $namespace, $title ) {
 247+ global $wgContLang;
 248+
247249 if ( $namespace != NS_MAIN ) {
248 - $title = MWNamespace::getCanonicalName( $namespace ) . ':' . $title;
 250+ $title = $wgContLang->getNsText( $namespace ) . ':' . $title;
249251 }
250252
251253 return str_replace( '_', ' ', $title );

Status & tagging log