r88815 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r88814‎ | r88815 | r88816 >
Date:18:56, 25 May 2011
Author:ialex
Status:ok
Tags:
Comment:
* Check existence in correct language
* Simplify a bit existence check
Modified paths:
  • /trunk/phase3/includes/specials/SpecialContributions.php (modified) (history)
  • /trunk/phase3/languages/LanguageConverter.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/specials/SpecialContributions.php
@@ -403,8 +403,8 @@
404404 Xml::dateMenu( $this->opts['year'], $this->opts['month'] ) . ' ' .
405405 Xml::submitButton( wfMsg( 'sp-contributions-submit' ) )
406406 ) . ' ';
407 - $explain = wfMsgExt( 'sp-contributions-explain', 'parseinline' );
408 - if( !wfEmptyMsg( 'sp-contributions-explain' ) ) {
 407+ $explain = wfMessage( 'sp-contributions-explain' );
 408+ if ( $explain->exists() ) {
409409 $f .= "<p id='mw-sp-contributions-explain'>{$explain}</p>";
410410 }
411411 $f .= Xml::closeElement('fieldset' ) .
Index: trunk/phase3/languages/LanguageConverter.php
@@ -531,9 +531,9 @@
532532 $text = '';
533533 } else {
534534 // first let's check if a message has given us a converted name
535 - $nsConvKey = 'conversion-ns' . $index;
536 - if ( !wfEmptyMsg( $nsConvKey ) ) {
537 - $text = wfMsgForContentNoTrans( $nsConvKey );
 535+ $nsConvMsg = wfMessage( 'conversion-ns' . $index )->inContentLanguage();
 536+ if ( $nsConvMsg->exists() ) {
 537+ $text = $nsConvMsg->plain();
538538 } else {
539539 // the message does not exist, try retrieve it from the current
540540 // variant's namespace names.

Status & tagging log