Index: branches/CentralNotice-SpecialPage-Integration/SpecialNoticeTemplate.php |
— | — | @@ -280,20 +280,34 @@ |
281 | 281 | |
282 | 282 | $htmlOut .= Xml::element( 'td', null, $count); |
283 | 283 | |
284 | | - $htmlOut .= Xml::element( 'td', null, |
285 | | - wfMsgExt( "Centralnotice-{$currentTemplate}-{$field}", array( 'language' => 'en') ) |
| 284 | + // English text |
| 285 | + $englishText = wfMsg( 'centralnotice-message-not-set' ); |
| 286 | + $englishTextExists = false; |
| 287 | + if( Title::newFromText( $message, NS_MEDIAWIKI )->exists() ) { |
| 288 | + $englishText = wfMsgExt( "Centralnotice-{$currentTemplate}-{$field}", |
| 289 | + array( 'language' => 'en' ) |
| 290 | + ); |
| 291 | + $englishTextExists = true; |
| 292 | + } |
| 293 | + $htmlOut .= Xml::tags( 'td', null, |
| 294 | + Xml::element( 'span', |
| 295 | + array( 'style' => 'font-style:italic;' . ( !$englishTextExists ? 'color:silver' : '' ) ), |
| 296 | + $englishText |
| 297 | + ) |
286 | 298 | ); |
287 | 299 | |
288 | | - // Input |
289 | | - $text = ''; |
| 300 | + // Foreign text input |
| 301 | + $foreignText = ''; |
| 302 | + $foreignTextExists = false; |
290 | 303 | if( Title::newFromText( $message, NS_MEDIAWIKI )->exists() ) { |
291 | | - $text = wfMsgExt( "Centralnotice-{$currentTemplate}-{$field}", |
| 304 | + $foreignText = wfMsgExt( "Centralnotice-{$currentTemplate}-{$field}", |
292 | 305 | array( 'language' => $wpUserLang ) |
293 | 306 | ); |
| 307 | + $foreignTextExists = true; |
294 | 308 | } |
295 | 309 | $htmlOut .= Xml::tags( 'td', null, |
296 | | - Xml::input( "updateText[{$wpUserLang}][{$currentTemplate}-{$field}]", '', $text, |
297 | | - array( 'style' => 'width:100%;' . ( $text == '' ? 'color:red' : '' ) ) |
| 310 | + Xml::input( "updateText[{$wpUserLang}][{$currentTemplate}-{$field}]", '', $foreignText, |
| 311 | + array( 'style' => 'width:100%;' . ( !$foreignTextExists ? 'color:red' : '' ) ) |
298 | 312 | ) |
299 | 313 | ); |
300 | 314 | |
Index: branches/CentralNotice-SpecialPage-Integration/CentralNotice.i18n.php |
— | — | @@ -86,6 +86,7 @@ |
87 | 87 | 'centralnotice-number-uses' => 'Uses', |
88 | 88 | 'centralnotice-edit-template' => 'Edit template', |
89 | 89 | 'centralnotice-message' => 'Message', |
| 90 | + 'centralnotice-message-not-set' => 'Message not set', |
90 | 91 | ); |
91 | 92 | |
92 | 93 | /** Afrikaans (Afrikaans) |