Index: trunk/phase3/includes/specials/SpecialUpload.php |
— | — | @@ -486,21 +486,35 @@ |
487 | 487 | * Get the initial image page text based on a comment and optional file status information |
488 | 488 | */ |
489 | 489 | public static function getInitialPageText( $comment = '', $license = '', $copyStatus = '', $source = '' ) { |
490 | | - global $wgUseCopyrightUpload; |
| 490 | + global $wgUseCopyrightUpload, $wgForceUIMsgAsContentMsg; |
| 491 | + $wgForceUIMsgAsContentMsg = (array) $wgForceUIMsgAsContentMsg; |
| 492 | + |
| 493 | + /* These messages are transcluded into the actual text of the description page. |
| 494 | + * Thus, forcing them as content messages makes the upload to produce an int: template |
| 495 | + * instead of hardcoding it there in the uploader language. |
| 496 | + */ |
| 497 | + foreach( array( 'license-header', 'filedesc', 'filestatus', 'filesource' ) as $msgName ) { |
| 498 | + if ( in_array( $msgName, $wgForceUIMsgAsContentMsg ) ) { |
| 499 | + $msg[$msgName] = "{{int:$msgName}}"; |
| 500 | + } else { |
| 501 | + $msg[$msgName] = wfMsgForContent( $msgName ); |
| 502 | + } |
| 503 | + } |
| 504 | + |
491 | 505 | if ( $wgUseCopyrightUpload ) { |
492 | 506 | $licensetxt = ''; |
493 | 507 | if ( $license != '' ) { |
494 | | - $licensetxt = '== ' . wfMsgForContent( 'license-header' ) . " ==\n" . '{{' . $license . '}}' . "\n"; |
| 508 | + $licensetxt = '== ' . $msg[ 'license-header' ] . " ==\n" . '{{' . $license . '}}' . "\n"; |
495 | 509 | } |
496 | | - $pageText = '== ' . wfMsgForContent( 'filedesc' ) . " ==\n" . $comment . "\n" . |
497 | | - '== ' . wfMsgForContent( 'filestatus' ) . " ==\n" . $copyStatus . "\n" . |
| 510 | + $pageText = '== ' . $msg[ 'filedesc' ] . " ==\n" . $comment . "\n" . |
| 511 | + '== ' . $msg[ 'filestatus' ] . " ==\n" . $copyStatus . "\n" . |
498 | 512 | "$licensetxt" . |
499 | | - '== ' . wfMsgForContent( 'filesource' ) . " ==\n" . $source; |
| 513 | + '== ' . $msg[ 'filesource' ] . " ==\n" . $source; |
500 | 514 | } else { |
501 | 515 | if ( $license != '' ) { |
502 | | - $filedesc = $comment == '' ? '' : '== ' . wfMsgForContent( 'filedesc' ) . " ==\n" . $comment . "\n"; |
| 516 | + $filedesc = $comment == '' ? '' : '== ' . $msg[ 'filedesc' ] . " ==\n" . $comment . "\n"; |
503 | 517 | $pageText = $filedesc . |
504 | | - '== ' . wfMsgForContent( 'license-header' ) . " ==\n" . '{{' . $license . '}}' . "\n"; |
| 518 | + '== ' . $msg[ 'license-header' ] . " ==\n" . '{{' . $license . '}}' . "\n"; |
505 | 519 | } else { |
506 | 520 | $pageText = $comment; |
507 | 521 | } |