| Index: branches/RL2/extensions/Gadgets/backend/Gadget.php |
| — | — | @@ -126,14 +126,14 @@ |
| 127 | 127 | */ |
| 128 | 128 | public function getTitleMessage( $langcode = null ) { |
| 129 | 129 | $msg = wfMessage( $this->getTitleMessageKey() ); |
| | 130 | + if ( $langcode !== null ) { |
| | 131 | + $msg = $msg->inLanguage( $langcode ); |
| | 132 | + } |
| 130 | 133 | if ( !$msg->exists() ) { |
| 131 | 134 | // Fallback: return the name of the gadget |
| 132 | 135 | $lang = Language::factory( $langcode ); |
| 133 | 136 | return $lang->ucfirst( $this->name ); |
| 134 | 137 | } |
| 135 | | - if ( $langcode !== null ) { |
| 136 | | - $msg = $msg->inLanguage( $langcode ); |
| 137 | | - } |
| 138 | 138 | return $msg->plain(); |
| 139 | 139 | |
| 140 | 140 | } |
| — | — | @@ -153,13 +153,13 @@ |
| 154 | 154 | */ |
| 155 | 155 | public function getDescriptionMessage( $langcode = null ) { |
| 156 | 156 | $msg = wfMessage( $this->getDescriptionMessageKey() ); |
| | 157 | + if ( $langcode !== null ) { |
| | 158 | + $msg = $msg->inLanguage( $langcode ); |
| | 159 | + } |
| 157 | 160 | if ( !$msg->exists() ) { |
| 158 | 161 | // Fallback: return empty string |
| 159 | 162 | return ''; |
| 160 | 163 | } |
| 161 | | - if ( $langcode !== null ) { |
| 162 | | - $msg = $msg->inLanguage( $langcode ); |
| 163 | | - } |
| 164 | 164 | return $msg->parse(); |
| 165 | 165 | } |
| 166 | 166 | |