Use 'pagetitle' in content language
authorSiebrand Mazeland <s.mazeland@xs4all.nl>
Tue, 12 Nov 2013 08:36:00 +0000 (09:36 +0100)
committerSiebrand Mazeland <s.mazeland@xs4all.nl>
Tue, 12 Nov 2013 08:36:57 +0000 (09:36 +0100)
It often happens that wiki sysops want to change it site wide, especially
when they want to change the format (eg, have {{SITENAME}} removed, or
replace the hyphen with a middot).

Bug: 48701
Change-Id: Iaf00fca1e89ae022c348c4fa0de32b998d7921a1

includes/OutputPage.php
includes/specials/SpecialContributions.php
includes/specials/SpecialSearch.php

index b4fda13..6fd5111 100644 (file)
@@ -891,7 +891,10 @@ class OutputPage extends ContextSource {
                $this->mPagetitle = $nameWithTags;
 
                # change "<i>foo&amp;bar</i>" to "foo&bar"
-               $this->setHTMLTitle( $this->msg( 'pagetitle' )->rawParams( Sanitizer::stripAllTags( $nameWithTags ) ) );
+               $this->setHTMLTitle(
+                       $this->msg( 'pagetitle' )->rawParams( Sanitizer::stripAllTags( $nameWithTags ) )
+                               ->inContentLanguage()
+               );
        }
 
        /**
@@ -2491,7 +2494,7 @@ $templates
                $ret = Html::htmlHeader( array( 'lang' => $this->getLanguage()->getHtmlCode(), 'dir' => $userdir, 'class' => 'client-nojs' ) );
 
                if ( $this->getHTMLTitle() == '' ) {
-                       $this->setHTMLTitle( $this->msg( 'pagetitle', $this->getPageTitle() ) );
+                       $this->setHTMLTitle( $this->msg( 'pagetitle', $this->getPageTitle() )->inContentLanguage() );
                }
 
                $openHead = Html::openElement( 'head' );
index 1fe9819..5710dc4 100644 (file)
@@ -94,14 +94,14 @@ class SpecialContributions extends SpecialPage {
                        $out->setHTMLTitle( $this->msg(
                                'pagetitle',
                                $this->msg( 'contributions-title', $target )->plain()
-                       ) );
+                       )->inContentLanguage() );
                        $this->getSkin()->setRelevantUser( $userObj );
                } else {
                        $out->addSubtitle( $this->msg( 'sp-contributions-newbies-sub' ) );
-                       $out->setHTMLTitle( $this->msg(
-                               'pagetitle',
-                               $this->msg( 'sp-contributions-newbies-title' )->plain()
-                       ) );
+                       $out->setHTMLTitle(
+                               $this->msg( 'pagetitle', $this->msg( 'sp-contributions-newbies-title' ) )
+                                       ->inContentLanguage()->plain()
+                       );
                }
 
                if ( ( $ns = $request->getVal( 'namespace', null ) ) !== null && $ns !== '' ) {
index dd32656..08e438f 100644 (file)
@@ -476,9 +476,10 @@ class SpecialSearch extends SpecialPage {
                $out = $this->getOutput();
                if ( strval( $term ) !== '' ) {
                        $out->setPageTitle( $this->msg( 'searchresults' ) );
-                       $out->setHTMLTitle( $this->msg( 'pagetitle' )->rawParams(
-                               $this->msg( 'searchresults-title' )->rawParams( $term )->text()
-                       ) );
+                       $out->setHTMLTitle( $this->msg( 'pagetitle' )
+                               ->rawParams( $this->msg( 'searchresults-title' )->rawParams( $term ) )
+                               ->inContentLanguage()->text()
+                       );
                }
                // add javascript specific to special:search
                $out->addModules( 'mediawiki.special.search' );