* Check existence in correct language
authorAlexandre Emsenhuber <ialex@users.mediawiki.org>
Wed, 25 May 2011 18:56:05 +0000 (18:56 +0000)
committerAlexandre Emsenhuber <ialex@users.mediawiki.org>
Wed, 25 May 2011 18:56:05 +0000 (18:56 +0000)
* Simplify a bit existence check

includes/specials/SpecialContributions.php
languages/LanguageConverter.php

index afebd4d..6da6f87 100644 (file)
@@ -403,8 +403,8 @@ class SpecialContributions extends SpecialPage {
                                Xml::dateMenu( $this->opts['year'], $this->opts['month'] ) . ' ' .
                                Xml::submitButton( wfMsg( 'sp-contributions-submit' ) )
                        ) . ' ';
-               $explain = wfMsgExt( 'sp-contributions-explain', 'parseinline' );
-               if( !wfEmptyMsg( 'sp-contributions-explain' ) ) {
+               $explain = wfMessage( 'sp-contributions-explain' );
+               if ( $explain->exists() ) {
                        $f .= "<p id='mw-sp-contributions-explain'>{$explain}</p>";
                }
                $f .= Xml::closeElement('fieldset' ) .
index 1332ae7..223336a 100644 (file)
@@ -531,9 +531,9 @@ class LanguageConverter {
                        $text = '';
                } else {
                        // first let's check if a message has given us a converted name
-                       $nsConvKey = 'conversion-ns' . $index;
-                       if ( !wfEmptyMsg( $nsConvKey ) ) {
-                               $text = wfMsgForContentNoTrans( $nsConvKey );
+                       $nsConvMsg = wfMessage( 'conversion-ns' . $index )->inContentLanguage();
+                       if ( $nsConvMsg->exists() ) {
+                               $text = $nsConvMsg->plain();
                        } else {
                                // the message does not exist, try retrieve it from the current
                                // variant's namespace names.