Interwiki maintenance.

* Make addInfoRow private and non-static, so local context can be used for messaging.
* Change <i> to <em>.
* Add .idea to .gitignore.

Change-Id: Icc2eb5bb9d5925683b94bdfc5b06306fb009caf4
This commit is contained in:
Siebrand Mazeland 2012-08-16 00:52:05 +02:00
parent 528475dc9a
commit 8931c47baf
3 changed files with 15 additions and 14 deletions

1
.gitignore vendored
View file

@ -2,3 +2,4 @@
*~
*.kate-swp
.*.swp
.idea

View file

@ -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 <code>[<nowiki />[prefix:<i>pagename</i>]]</code> wikitext syntax.',
'interwiki_prefix_intro' => 'Interwiki prefix to be used in <code>[<nowiki />[prefix:<em>pagename</em>]]</code> 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 <i>pagename</i> of the wikitext, when the abovementioned wikitext syntax is used.',
'interwiki_url_intro' => 'Template for URLs. The placeholder $1 will be replaced by the <em>pagename</em> 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 <code>{<nowiki />{prefix:<i>pagename</i>}}</code> is used, then:',
'interwiki_trans_intro' => 'If wikitext syntax <code>{<nowiki />{prefix:<em>pagename</em>}}</code> 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.

View file

@ -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() )
);
}