Merge "Cache some more repeated messages in changes lists"
This commit is contained in:
commit
dc412f3bb5
4 changed files with 11 additions and 7 deletions
|
|
@ -96,7 +96,10 @@ class HistoryAction extends FormlessAction {
|
|||
// Precache various messages
|
||||
if ( !isset( $this->message ) ) {
|
||||
$this->message = [];
|
||||
$msgs = [ 'cur', 'tooltip-cur', 'last', 'tooltip-last', 'pipe-separator' ];
|
||||
$msgs = [
|
||||
'cur', 'tooltip-cur', 'last', 'tooltip-last', 'pipe-separator',
|
||||
'changeslist-nocomment', 'updatedmarker',
|
||||
];
|
||||
foreach ( $msgs as $msg ) {
|
||||
$this->message[$msg] = $this->msg( $msg )->escaped();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -455,12 +455,12 @@ class HistoryPager extends ReverseChronologicalPager {
|
|||
$s2 = $this->formattedComments[$resultOffset];
|
||||
|
||||
if ( $s2 === '' ) {
|
||||
$defaultComment = $this->msg( 'changeslist-nocomment' )->escaped();
|
||||
$defaultComment = $this->historyPage->message['changeslist-nocomment'];
|
||||
$s2 = "<span class=\"comment mw-comment-none\">$defaultComment</span>";
|
||||
}
|
||||
|
||||
if ( $this->notificationTimestamp && $row->rev_timestamp >= $this->notificationTimestamp ) {
|
||||
$s2 .= ' <span class="updatedmarker">' . $this->msg( 'updatedmarker' )->escaped() . '</span>';
|
||||
$s2 .= ' <span class="updatedmarker">' . $this->historyPage->message['updatedmarker'] . '</span>';
|
||||
$classes[] = 'mw-history-line-updated';
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -191,7 +191,7 @@ class ChangesList extends ContextSource {
|
|||
$this->message = [];
|
||||
foreach ( [
|
||||
'cur', 'diff', 'hist', 'enhancedrc-history', 'last', 'blocklink', 'history',
|
||||
'semicolon-separator', 'pipe-separator' ] as $msg
|
||||
'semicolon-separator', 'pipe-separator', 'word-separator' ] as $msg
|
||||
) {
|
||||
$this->message[$msg] = $this->msg( $msg )->escaped();
|
||||
}
|
||||
|
|
@ -736,7 +736,7 @@ class ChangesList extends ContextSource {
|
|||
. $formatter->getActionText()
|
||||
. " $mark"
|
||||
. $formatter->getComment()
|
||||
. $this->msg( 'word-separator' )->escaped()
|
||||
. $this->message['word-separator']
|
||||
. $formatter->getActionLinks()
|
||||
. Html::closeElement( 'span' );
|
||||
}
|
||||
|
|
|
|||
|
|
@ -229,7 +229,8 @@ class ContribsPager extends RangeChronologicalPager {
|
|||
'diff',
|
||||
'hist',
|
||||
'pipe-separator',
|
||||
'uctop'
|
||||
'uctop',
|
||||
'changeslist-nocomment',
|
||||
];
|
||||
|
||||
foreach ( $msgs as $msg ) {
|
||||
|
|
@ -764,7 +765,7 @@ class ContribsPager extends RangeChronologicalPager {
|
|||
$comment = $this->formattedComments[$row->rev_id];
|
||||
|
||||
if ( $comment === '' ) {
|
||||
$defaultComment = $this->msg( 'changeslist-nocomment' )->escaped();
|
||||
$defaultComment = $this->messages['changeslist-nocomment'];
|
||||
$comment = "<span class=\"comment mw-comment-none\">$defaultComment</span>";
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue