r89732 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r89731‎ | r89732 | r89733 >
Date:17:44, 8 June 2011
Author:foxtrott
Status:deferred (Comments)
Tags:
Comment:
followup r89730: Use the setting
Modified paths:
  • /trunk/extensions/Lingo/Lingo.i18n.php (modified) (history)
  • /trunk/extensions/Lingo/Lingo.php (modified) (history)
  • /trunk/extensions/Lingo/LingoBasicBackend.php (modified) (history)

Diff [purge]

Index: trunk/extensions/Lingo/LingoBasicBackend.php
@@ -22,13 +22,16 @@
2323
2424 public function __construct( LingoMessageLog &$messages = null ) {
2525
 26+ global $wgexLingoPage;
 27+
 28+ $page = $wgexLingoPage ? $wgexLingoPage : wfMsg( 'lingo-terminologypagename' );
 29+
2630 parent::__construct( $messages );
2731
2832 // Get Terminology page
29 - $rev = Revision::newFromTitle( Title::makeTitle( null, 'Terminology' ) );
30 -
 33+ $rev = Revision::newFromTitle( Title::makeTitle( null, $page ) );
3134 if ( !$rev ) {
32 - $this->getMessageLog()->addWarning( '[[Terminology]] does not exist.' );
 35+ $this->getMessageLog()->addWarning( wfMsgReal( 'lingo-noterminologypage', array($page) ) );
3336 return false;
3437 }
3538
Index: trunk/extensions/Lingo/Lingo.i18n.php
@@ -10,11 +10,13 @@
1111
1212 $messages['en'] = array(
1313 'lingo-desc' => 'Provides hover-over tool tips on pages from words defined on the [[$1]] page',
14 - 'lingo-terminologypage' => 'Terminology'
 14+ 'lingo-terminologypagename' => 'Terminology',
 15+ 'lingo-noterminologypage' => '[[$1]] does not exist.',
 16+
1517 );
1618
1719 $messages['qqq'] = array(
1820 'lingo-desc' => '{{desc}}',
19 - 'lingo-terminologypage' => 'Name of the page where the terms and definitions of the glossary are stored'
 21+ 'lingo-terminologypagename' => 'Name of the page where the terms and definitions of the glossary are stored'
2022 );
2123
Index: trunk/extensions/Lingo/Lingo.php
@@ -87,7 +87,7 @@
8888 'name' => 'Lingo',
8989 'author' => array( 'Barry Coughlan', '[http://www.mediawiki.org/wiki/User:F.trott Stephan Gambke]' ),
9090 'url' => 'http://www.mediawiki.org/wiki/Extension:Lingo',
91 - 'descriptionmsg' => array('lingo-desc', $wgexLingoPage?$wgexLingoPage:wfMsg('lingo-terminologypage')),
 91+ 'descriptionmsg' => array('lingo-desc', $wgexLingoPage?$wgexLingoPage: wfMsg( 'lingo-terminologypagename' )),
9292 'version' => LINGO_VERSION,
9393 );
9494

Follow-up revisions

RevisionCommit summaryAuthorDate
r89740followup r89732: use wfMsgForContent, modify messagesfoxtrott20:18, 8 June 2011

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r89730introduce setting for page to use for glossaryfoxtrott17:03, 8 June 2011

Comments

#Comment by Nikerabbit (talk | contribs)   19:49, 8 June 2011

Perhaps say "Page ... does not exist"

+	'lingo-noterminologypage' => '$1 does not exist.',

This is not how you use Title::makeTitle

+		$rev = Revision::newFromTitle( Title::makeTitle( null, $page ) );

Is there supposed to be one page for every language? What if the name of the page is the same in two languages? Also doing the lingo-desc message that way looks very fragile and prone to break.

#Comment by F.trott (talk | contribs)   20:07, 8 June 2011

1) Can do. 2) Changed to Title::newFromText in r89734. 3) Oops, no. There should only be one terminology page. I will use wfMsgForContent. 4) Why would this be fragile?

#Comment by Nikerabbit (talk | contribs)   20:28, 8 June 2011

4) It probably works for now.

Status & tagging log