aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatěj Suchánek <matejsuchanek97@gmail.com>2023-08-19 14:03:43 +0200
committerMatěj Suchánek <matejsuchanek97@gmail.com>2023-08-19 14:32:58 +0200
commitcfad5d8d711a4767addaba0641cb29d732c83b0d (patch)
tree45bb3abb5528d2cb7ea5342be3e7204862b239f3
parentfb7595209c05a9bfc7deb262fbb7bc78aa367ea5 (diff)
downloadmediawikicore-cfad5d8d711a4767addaba0641cb29d732c83b0d.tar.gz
mediawikicore-cfad5d8d711a4767addaba0641cb29d732c83b0d.zip
Cache some more repeated messages in changes lists
Change-Id: I635eaf947280fd1071e308b19715d581e1c1cb15
-rw-r--r--includes/actions/HistoryAction.php5
-rw-r--r--includes/actions/pagers/HistoryPager.php4
-rw-r--r--includes/changes/ChangesList.php4
-rw-r--r--includes/specials/pagers/ContribsPager.php5
4 files changed, 11 insertions, 7 deletions
diff --git a/includes/actions/HistoryAction.php b/includes/actions/HistoryAction.php
index 5996052c1d00..85903b245289 100644
--- a/includes/actions/HistoryAction.php
+++ b/includes/actions/HistoryAction.php
@@ -95,7 +95,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();
}
diff --git a/includes/actions/pagers/HistoryPager.php b/includes/actions/pagers/HistoryPager.php
index 9a73d6b0219d..b065ae38ba18 100644
--- a/includes/actions/pagers/HistoryPager.php
+++ b/includes/actions/pagers/HistoryPager.php
@@ -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';
}
diff --git a/includes/changes/ChangesList.php b/includes/changes/ChangesList.php
index 15ce1e7b3d05..f8a33ddedfda 100644
--- a/includes/changes/ChangesList.php
+++ b/includes/changes/ChangesList.php
@@ -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' );
}
diff --git a/includes/specials/pagers/ContribsPager.php b/includes/specials/pagers/ContribsPager.php
index 6f482cd06d87..094e319a0633 100644
--- a/includes/specials/pagers/ContribsPager.php
+++ b/includes/specials/pagers/ContribsPager.php
@@ -226,7 +226,8 @@ class ContribsPager extends RangeChronologicalPager {
'diff',
'hist',
'pipe-separator',
- 'uctop'
+ 'uctop',
+ 'changeslist-nocomment',
];
foreach ( $msgs as $msg ) {
@@ -760,7 +761,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>";
}