From 8931c47baf4676726b9d9d05fc89f0d4df4f6b68 Mon Sep 17 00:00:00 2001 From: Siebrand Mazeland Date: Thu, 16 Aug 2012 00:52:05 +0200 Subject: [PATCH] Interwiki maintenance. * Make addInfoRow private and non-static, so local context can be used for messaging. * Change to . * Add .idea to .gitignore. Change-Id: Icc2eb5bb9d5925683b94bdfc5b06306fb009caf4 --- .gitignore | 1 + Interwiki.i18n.php | 6 +++--- Interwiki_body.php | 22 +++++++++++----------- 3 files changed, 15 insertions(+), 14 deletions(-) diff --git a/.gitignore b/.gitignore index 98b092a9..c798be9c 100644 --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,4 @@ *~ *.kate-swp .*.swp +.idea diff --git a/Interwiki.i18n.php b/Interwiki.i18n.php index 769e2fa8..e331586c 100644 --- a/Interwiki.i18n.php +++ b/Interwiki.i18n.php @@ -34,10 +34,10 @@ $messages['en'] = array( 'interwiki-legend-hide' => 'Hide legend', 'interwiki_prefix' => 'Prefix', 'interwiki-prefix-label' => 'Prefix:', - 'interwiki_prefix_intro' => 'Interwiki prefix to be used in [[prefix:pagename]] wikitext syntax.', + 'interwiki_prefix_intro' => 'Interwiki prefix to be used in [[prefix:pagename]] wikitext syntax.', 'interwiki_url' => 'URL', # only translate this message if you have to change it 'interwiki-url-label' => 'URL:', - 'interwiki_url_intro' => 'Template for URLs. The placeholder $1 will be replaced by the pagename of the wikitext, when the abovementioned wikitext syntax is used.', + 'interwiki_url_intro' => 'Template for URLs. The placeholder $1 will be replaced by the pagename of the wikitext, when the abovementioned wikitext syntax is used.', 'interwiki_local' => 'Forward', 'interwiki-local-label' => 'Forward:', 'interwiki_local_intro' => 'An HTTP request to the local wiki with this interwiki prefix in the URL is:', @@ -45,7 +45,7 @@ $messages['en'] = array( 'interwiki_local_1_intro' => 'redirected to the target URL given in the interwiki link definitions (i.e. treated like references in local pages).', 'interwiki_trans' => 'Transclude', 'interwiki-trans-label' => 'Transclude:', - 'interwiki_trans_intro' => 'If wikitext syntax {{prefix:pagename}} is used, then:', + 'interwiki_trans_intro' => 'If wikitext syntax {{prefix:pagename}} is used, then:', 'interwiki_trans_1_intro' => 'allow transclusion from the foreign wiki, if interwiki transclusions are generally permitted in this wiki.', 'interwiki_trans_0_intro' => 'do not allow it, rather look for a page in the template namespace.', 'interwiki_intro_footer' => 'See [//www.mediawiki.org/wiki/Manual:Interwiki_table MediaWiki.org] for more information about the interwiki table. diff --git a/Interwiki_body.php b/Interwiki_body.php index 7f9c6e2b..ded7d269 100644 --- a/Interwiki_body.php +++ b/Interwiki_body.php @@ -271,14 +271,14 @@ class SpecialInterwiki extends SpecialPage { $this->getOutput()->addHTML( Html::rawElement( 'table', array( 'class' => 'mw-interwikitable wikitable intro' ), - self::addInfoRow( 'start', 'interwiki_prefix', 'interwiki_prefix_intro' ) . "\n" . - self::addInfoRow( 'start', 'interwiki_url', 'interwiki_url_intro' ) . "\n" . - self::addInfoRow( 'start', 'interwiki_local', 'interwiki_local_intro' ) . "\n" . - self::addInfoRow( 'end', 'interwiki_0', 'interwiki_local_0_intro' ) . "\n" . - self::addInfoRow( 'end', 'interwiki_1', 'interwiki_local_1_intro' ) . "\n" . - self::addInfoRow( 'start', 'interwiki_trans', 'interwiki_trans_intro' ) . "\n" . - self::addInfoRow( 'end', 'interwiki_0', 'interwiki_trans_0_intro' ) . "\n" . - self::addInfoRow( 'end', 'interwiki_1', 'interwiki_trans_1_intro' ) . "\n" + $this->addInfoRow( 'start', 'interwiki_prefix', 'interwiki_prefix_intro' ) . "\n" . + $this->addInfoRow( 'start', 'interwiki_url', 'interwiki_url_intro' ) . "\n" . + $this->addInfoRow( 'start', 'interwiki_local', 'interwiki_local_intro' ) . "\n" . + $this->addInfoRow( 'end', 'interwiki_0', 'interwiki_local_0_intro' ) . "\n" . + $this->addInfoRow( 'end', 'interwiki_1', 'interwiki_local_1_intro' ) . "\n" . + $this->addInfoRow( 'start', 'interwiki_trans', 'interwiki_trans_intro' ) . "\n" . + $this->addInfoRow( 'end', 'interwiki_0', 'interwiki_trans_0_intro' ) . "\n" . + $this->addInfoRow( 'end', 'interwiki_1', 'interwiki_trans_1_intro' ) . "\n" ) ); @@ -366,12 +366,12 @@ class SpecialInterwiki extends SpecialPage { * @param $text string * @return string */ - static function addInfoRow( $align = 'start', $title, $text ) { + private function addInfoRow( $align = 'start', $title, $text ) { return Html::rawElement( 'tr', null, // The classes mw-align-start and mw-align-end are used here. - Html::rawElement( 'th', array( 'class' => 'mw-align-' . $align ), wfMessage( $title )->escaped() ) . + Html::rawElement( 'th', array( 'class' => 'mw-align-' . $align ), $this->msg( $title )->escaped() ) . // This message is expected to have wiki syntax - Html::rawElement( 'td', null, wfMessage( $text )->parse() ) + Html::rawElement( 'td', null, $this->msg( $text )->parse() ) ); }