http://www.mediawiki.org/wiki/Special:Code/MediaWiki/95973

Revision: 95973
Author:   catrope
Date:     2011-09-01 12:48:18 +0000 (Thu, 01 Sep 2011)
Log Message:
-----------
Followup r95970, r95972: fix translations for real this time. Calling 
Message::inLanguage() after exists() doesn't work, apparently

Modified Paths:
--------------
    branches/RL2/extensions/Gadgets/backend/Gadget.php

Modified: branches/RL2/extensions/Gadgets/backend/Gadget.php
===================================================================
--- branches/RL2/extensions/Gadgets/backend/Gadget.php  2011-09-01 12:41:20 UTC 
(rev 95972)
+++ branches/RL2/extensions/Gadgets/backend/Gadget.php  2011-09-01 12:48:18 UTC 
(rev 95973)
@@ -126,14 +126,14 @@
         */
        public function getTitleMessage( $langcode = null ) {
                $msg = wfMessage( $this->getTitleMessageKey() );
+               if ( $langcode !== null ) {
+                       $msg = $msg->inLanguage( $langcode );
+               }
                if ( !$msg->exists() ) {
                        // Fallback: return the name of the gadget
                        $lang = Language::factory( $langcode );
                        return $lang->ucfirst( $this->name );
                }
-               if ( $langcode !== null ) {
-                       $msg = $msg->inLanguage( $langcode );
-               }
                return $msg->plain();
                
        }
@@ -153,13 +153,13 @@
         */
        public function getDescriptionMessage( $langcode = null ) {
                $msg = wfMessage( $this->getDescriptionMessageKey() );
+               if ( $langcode !== null ) {
+                       $msg = $msg->inLanguage( $langcode );
+               }
                if ( !$msg->exists() ) {
                        // Fallback: return empty string
                        return '';
                }
-               if ( $langcode !== null ) {
-                       $msg = $msg->inLanguage( $langcode );
-               }
                return $msg->parse();
        }
        


_______________________________________________
MediaWiki-CVS mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs

Reply via email to