From c142126fc7481a5d4b5f0d7b3b73f7f9ac43f598 Mon Sep 17 00:00:00 2001 From: Siebrand Mazeland Date: Tue, 12 Nov 2013 09:36:00 +0100 Subject: [PATCH] Use 'pagetitle' in content language 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 | 7 +++++-- includes/specials/SpecialContributions.php | 10 +++++----- includes/specials/SpecialSearch.php | 7 ++++--- 3 files changed, 14 insertions(+), 10 deletions(-) diff --git a/includes/OutputPage.php b/includes/OutputPage.php index b4fda1366d..6fd51114c3 100644 --- a/includes/OutputPage.php +++ b/includes/OutputPage.php @@ -891,7 +891,10 @@ class OutputPage extends ContextSource { $this->mPagetitle = $nameWithTags; # change "foo&bar" 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' ); diff --git a/includes/specials/SpecialContributions.php b/includes/specials/SpecialContributions.php index 1fe98190f0..5710dc4b48 100644 --- a/includes/specials/SpecialContributions.php +++ b/includes/specials/SpecialContributions.php @@ -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 !== '' ) { diff --git a/includes/specials/SpecialSearch.php b/includes/specials/SpecialSearch.php index dd326569ec..08e438f31b 100644 --- a/includes/specials/SpecialSearch.php +++ b/includes/specials/SpecialSearch.php @@ -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' ); -- 2.20.1