jenkins-bot has submitted this change and it was merged.

Change subject: Split messages for recent change legend and letter tooltips
......................................................................


Split messages for recent change legend and letter tooltips

This makes it possible to use formatting in the legend ones
(e.g. links to help pages) and to use different wording
(the one for tooltips is sometimes too verbose for the legend).

Documented the format of $wgRecentChangesFlags better.

The default text in not modified in this change.

Bug: 58715
Bug: 60235
Change-Id: Ie9872c8fb3e43620877300ee8536bb5ddee5ab46
---
M includes/DefaultSettings.php
M includes/specialpage/ChangesListSpecialPage.php
M languages/i18n/en.json
M languages/i18n/qqq.json
4 files changed, 41 insertions(+), 24 deletions(-)

Approvals:
  Raimond Spekking: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/includes/DefaultSettings.php b/includes/DefaultSettings.php
index be3f3c3..5b42750 100644
--- a/includes/DefaultSettings.php
+++ b/includes/DefaultSettings.php
@@ -5772,24 +5772,42 @@
  * To register a new one:
  * @code
  * $wgRecentChangesFlags['flag'] => array(
+ *   // message for the letter displayed next to rows on changes lists
  *   'letter' => 'letter-msg',
- *   'title' => 'tooltip-msg'
+ *   // message for the tooltip of the letter
+ *   'title' => 'tooltip-msg',
+ *   // optional (defaults to 'tooltip-msg'), message to use in the legend box
+ *   'legend' => 'legend-msg',
+ *   // optional (defaults to 'flag'), CSS class to put on changes lists rows
+ *   'class' => 'css-class',
  * );
  * @endcode
- *
- * Optional 'class' allows to set a css class different than the flag name.
  *
  * @since 1.22
  */
 $wgRecentChangesFlags = array(
-       'newpage' => array( 'letter' => 'newpageletter',
-               'title' => 'recentchanges-label-newpage' ),
-       'minor' => array( 'letter' => 'minoreditletter',
-               'title' => 'recentchanges-label-minor', 'class' => 'minoredit' 
),
-       'bot' => array( 'letter' => 'boteditletter',
-               'title' => 'recentchanges-label-bot', 'class' => 'botedit' ),
-       'unpatrolled' => array( 'letter' => 'unpatrolledletter',
-               'title' => 'recentchanges-label-unpatrolled' ),
+       'newpage' => array(
+               'letter' => 'newpageletter',
+               'title' => 'recentchanges-label-newpage',
+               'legend' => 'recentchanges-legend-newpage',
+       ),
+       'minor' => array(
+               'letter' => 'minoreditletter',
+               'title' => 'recentchanges-label-minor',
+               'legend' => 'recentchanges-legend-minor',
+               'class' => 'minoredit',
+       ),
+       'bot' => array(
+               'letter' => 'boteditletter',
+               'title' => 'recentchanges-label-bot',
+               'legend' => 'recentchanges-legend-bot',
+               'class' => 'botedit',
+       ),
+       'unpatrolled' => array(
+               'letter' => 'unpatrolledletter',
+               'title' => 'recentchanges-label-unpatrolled',
+               'legend' => 'recentchanges-legend-unpatrolled',
+       ),
 );
 
 /** @} */ # end RC/watchlist }
diff --git a/includes/specialpage/ChangesListSpecialPage.php 
b/includes/specialpage/ChangesListSpecialPage.php
index f7c95d1..ad1ee36 100644
--- a/includes/specialpage/ChangesListSpecialPage.php
+++ b/includes/specialpage/ChangesListSpecialPage.php
@@ -412,23 +412,16 @@
                        unset( $legendItems['unpatrolled'] );
                }
                foreach ( $legendItems as $key => $item ) { # generate items of 
the legend
-                       $label = $item['title'];
+                       $label = isset( $item['legend'] ) ? $item['legend'] : 
$item['title'];
                        $letter = $item['letter'];
                        $cssClass = isset( $item['class'] ) ? $item['class'] : 
$key;
 
                        $legend .= Html::element( 'dt',
                                array( 'class' => $cssClass ), $context->msg( 
$letter )->text()
+                       ) . "\n" .
+                       Html::rawElement( 'dd', array(),
+                               $context->msg( $label )->parse()
                        ) . "\n";
-                       if ( $key === 'newpage' ) {
-                               $legend .= Html::openElement( 'dd' );
-                               $legend .= $context->msg( $label )->escaped();
-                               $legend .= ' ' . $context->msg( 
'recentchanges-legend-newpage' )->parse();
-                               $legend .= Html::closeElement( 'dd' ) . "\n";
-                       } else {
-                               $legend .= Html::element( 'dd', array(),
-                                       $context->msg( $label )->text()
-                               ) . "\n";
-                       }
                }
                # (+-123)
                $legend .= Html::rawElement( 'dt',
diff --git a/languages/i18n/en.json b/languages/i18n/en.json
index 0d72a36..14b4b4b 100644
--- a/languages/i18n/en.json
+++ b/languages/i18n/en.json
@@ -1200,7 +1200,10 @@
        "recentchanges-label-unpatrolled": "This edit has not yet been 
patrolled",
        "recentchanges-label-plusminus": "The page size changed by this number 
of bytes",
        "recentchanges-legend-heading": "'''Legend:'''",
-       "recentchanges-legend-newpage": "(also see [[Special:NewPages|list of 
new pages]])",
+       "recentchanges-legend-newpage": "{{int:recentchanges-label-newpage}} 
(also see [[Special:NewPages|list of new pages]])",
+       "recentchanges-legend-minor": "{{int:recentchanges-label-minor}}",
+       "recentchanges-legend-bot": "{{int:recentchanges-label-bot}}",
+       "recentchanges-legend-unpatrolled": 
"{{int:recentchanges-label-unpatrolled}}",
        "recentchanges-legend-plusminus": "(<em>±123</em>)",
        "rcnotefrom": "Below are the changes since <strong>$2</strong> (up to 
<strong>$1</strong> shown).",
        "rclistfrom": "Show new changes starting from $2, $3",
diff --git a/languages/i18n/qqq.json b/languages/i18n/qqq.json
index d94214b..c9aed64 100644
--- a/languages/i18n/qqq.json
+++ b/languages/i18n/qqq.json
@@ -1362,7 +1362,10 @@
        "recentchanges-label-unpatrolled": "Tooltip for 
{{msg-mw|unpatrolledletter}}",
        "recentchanges-label-plusminus": "Legend item for 
plus/minus.\n\nPreceded by legend example 
{{msg-mw|Recentchanges-legend-plusminus}}.",
        "recentchanges-legend-heading": "Used as a heading for legend box on 
[[Special:RecentChanges]] and [[Special:Watchlist]].\n{{Identical|Legend}}",
-       "recentchanges-legend-newpage": "Used as legend in 
[[Special:RecentChanges]]. Preceded by {{msg-mw|Recentchanges-label-newpage}}.",
+       "recentchanges-legend-newpage": "Used as legend on 
[[Special:RecentChanges]] and [[Special:Watchlist]].",
+       "recentchanges-legend-minor": "Used as legend on 
[[Special:RecentChanges]] and [[Special:Watchlist]].",
+       "recentchanges-legend-bot": "Used as legend on 
[[Special:RecentChanges]] and [[Special:Watchlist]].",
+       "recentchanges-legend-unpatrolled": "Used as legend on 
[[Special:RecentChanges]] and [[Special:Watchlist]].",
        "recentchanges-legend-plusminus": "{{optional}}\nA plus/minus sign with 
a number for the legend.",
        "rcnotefrom": "This message is displayed at [[Special:RecentChanges]] 
when viewing recentchanges from some specific time.\n\nThe corresponding 
message is {{msg-mw|Rclistfrom}} (split into date and time).\n\nParameters:\n* 
$1 - the maximum number of changes that are displayed\n* $2 - a date and 
time\n* $3 - (Optional) a date\n* $4 - (Optional) a time",
        "rclistfrom": "Used on [[Special:RecentChanges]]. Parameters:\n* $1 - 
(Currently not use) date and time. The date and the time adds to the rclistfrom 
description.\n* $2 - time. The time adds to the rclistfrom link description 
(with split of date and time).\n* $3 - date. The date adds to the rclistfrom 
link description (with split of date and time).\n\nThe corresponding message is 
{{msg-mw|Rcnotefrom}}.",

-- 
To view, visit https://gerrit.wikimedia.org/r/132477
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: Ie9872c8fb3e43620877300ee8536bb5ddee5ab46
Gerrit-PatchSet: 4
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Bartosz Dziewoński <[email protected]>
Gerrit-Reviewer: Bartosz Dziewoński <[email protected]>
Gerrit-Reviewer: Danny B. <[email protected]>
Gerrit-Reviewer: Raimond Spekking <[email protected]>
Gerrit-Reviewer: Siebrand <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to