From e0c3170455beddddaf3a232d46588c1de9a2a0f8 Mon Sep 17 00:00:00 2001 From: MatmaRex Date: Mon, 20 May 2013 16:09:01 +0200 Subject: [PATCH 1/1] RecentChanges, RecentChangesLinked, Watchlist: message when no items Use consistent message in RecentChanges, RecentChangesLinked, and Watchlist when there are no items to be shown. Previously RecentChanges just showed empty space and RecentChangesLinked and Watchlist used two different messages. Harmonized both the text and the code. Message added: 'recentchanges-noresult' Messages removed: 'recentchangeslinked-noresult', 'watchnochange' Change-Id: Idf9f7a8422d9ad13dc46c69ee284b04cbbe211b7 --- includes/specials/SpecialRecentchanges.php | 10 ++++++++-- includes/specials/SpecialRecentchangeslinked.php | 6 ------ includes/specials/SpecialWatchlist.php | 4 +++- languages/messages/MessagesEn.php | 3 +-- languages/messages/MessagesQqq.php | 3 +-- maintenance/language/messages.inc | 3 +-- 6 files changed, 14 insertions(+), 15 deletions(-) diff --git a/includes/specials/SpecialRecentchanges.php b/includes/specials/SpecialRecentchanges.php index 1f10ad4c33..af425467b2 100644 --- a/includes/specials/SpecialRecentchanges.php +++ b/includes/specials/SpecialRecentchanges.php @@ -516,6 +516,13 @@ class SpecialRecentChanges extends IncludableSpecialPage { $counter = 1; $list = ChangesList::newFromContext( $this->getContext() ); + if ( $rows->numRows() === 0 ) { + $this->getOutput()->wrapWikiMsg( + "
\n$1\n
", 'recentchanges-noresult' + ); + return; + } + $s = $list->beginRecentChangesList(); foreach ( $rows as $obj ) { if ( $limit == 0 ) { @@ -707,8 +714,7 @@ class SpecialRecentChanges extends IncludableSpecialPage { } /** - * Send the text to be displayed after the options, for use in - * Recentchangeslinked + * Send the text to be displayed after the options, for use in subclasses. * * @param FormOptions $opts */ diff --git a/includes/specials/SpecialRecentchangeslinked.php b/includes/specials/SpecialRecentchangeslinked.php index 4773c4a327..62777773b0 100644 --- a/includes/specials/SpecialRecentchangeslinked.php +++ b/includes/specials/SpecialRecentchangeslinked.php @@ -265,10 +265,4 @@ class SpecialRecentchangeslinked extends SpecialRecentChanges { $this->getOutput()->addBacklinkSubtitle( $target ); } } - - function setBottomText( FormOptions $opts ) { - if ( isset( $this->mResultEmpty ) && $this->mResultEmpty ) { - $this->getOutput()->addWikiMsg( 'recentchangeslinked-noresult' ); - } - } } diff --git a/includes/specials/SpecialWatchlist.php b/includes/specials/SpecialWatchlist.php index f5e3660ff7..2a28a11b02 100644 --- a/includes/specials/SpecialWatchlist.php +++ b/includes/specials/SpecialWatchlist.php @@ -387,7 +387,9 @@ class SpecialWatchlist extends SpecialPage { # If there's nothing to show, stop here if ( $numRows == 0 ) { - $output->addWikiMsg( 'watchnochange' ); + $output->wrapWikiMsg( + "
\n$1\n
", 'recentchanges-noresult' + ); return; } diff --git a/languages/messages/MessagesEn.php b/languages/messages/MessagesEn.php index bc3a381fa7..0aacfd9ad8 100644 --- a/languages/messages/MessagesEn.php +++ b/languages/messages/MessagesEn.php @@ -2158,6 +2158,7 @@ Your email address is not revealed when other users contact you.', 'recentchanges-legend' => 'Recent changes options', 'recentchanges-summary' => 'Track the most recent changes to the wiki on this page.', 'recentchangestext' => '-', # do not translate or duplicate this message to other languages +'recentchanges-noresult' => 'No changes during the given period matching these criteria.', 'recentchanges-feed-description' => 'Track the most recent changes to the wiki in this feed.', 'recentchanges-label-newpage' => 'This edit created a new page', 'recentchanges-label-minor' => 'This is a minor edit', @@ -2197,7 +2198,6 @@ Your email address is not revealed when other users contact you.', 'recentchangeslinked-feed' => 'Related changes', 'recentchangeslinked-toolbox' => 'Related changes', 'recentchangeslinked-title' => 'Changes related to "$1"', -'recentchangeslinked-noresult' => 'No changes on linked pages during the given period.', 'recentchangeslinked-summary' => "This is a list of changes made recently to pages linked from a specified page (or to members of a specified category). Pages on [[Special:Watchlist|your watchlist]] are '''bold'''.", 'recentchangeslinked-page' => 'Page name:', @@ -2921,7 +2921,6 @@ Future changes to this page and its associated talk page will be listed there.', 'unwatchthispage' => 'Stop watching', 'notanarticle' => 'Not a content page', 'notvisiblerev' => 'The last revision by a different user has been deleted', -'watchnochange' => 'None of your watched items were edited in the time period displayed.', 'watchlist-details' => '{{PLURAL:$1|$1 page|$1 pages}} on your watchlist, not counting talk pages.', 'wlheader-enotif' => 'Email notification is enabled.', 'wlheader-showupdated' => "Pages that have been changed since you last visited them are shown in '''bold'''.", diff --git a/languages/messages/MessagesQqq.php b/languages/messages/MessagesQqq.php index 9d5bacbaae..77e66d70ee 100644 --- a/languages/messages/MessagesQqq.php +++ b/languages/messages/MessagesQqq.php @@ -2979,6 +2979,7 @@ See also: {{Identical|Recent changes}}', 'recentchanges-legend' => 'Legend of the fieldset of [[Special:RecentChanges]]', 'recentchanges-summary' => 'Summary of [[Special:RecentChanges]].', +'recentchanges-noresult' => 'Used in [[Special:RecentChanges]], [[Special:RecentChangesLinked]], and [[Special:Watchlist]] when there are no changes to be shown.', 'recentchanges-feed-description' => 'Used in feed of RecentChanges. See example [{{canonicalurl:Special:RecentChanges|feed=atom}} feed].', 'recentchanges-label-newpage' => 'Tooltip for {{msg-mw|newpageletter}}', 'recentchanges-label-minor' => 'Tooltip for {{msg-mw|minoreditletter}}', @@ -3077,7 +3078,6 @@ This message is followed by {{msg-mw|Recentchangeslinked-feed}}. Parameters: * \$1 - the name of the page for which related changes are shown", -'recentchangeslinked-noresult' => 'Used in [[Special:RecentChangesLinked]], when there are no changes.', 'recentchangeslinked-summary' => 'Summary of [[Special:RecentChangesLinked]].', 'recentchangeslinked-page' => '{{Identical|Page name}}', 'recentchangeslinked-to' => 'Checkbox in [[Special:RecentChangesLinked]].', @@ -4514,7 +4514,6 @@ Possible alternatives to the word 'content' are 'subject matter' or 'wiki subjec See also: * {{msg-mw|Cantrollback}}', -'watchnochange' => 'Used in [[Special:Watchlist]] if there is nothing to show.', 'watchlist-details' => 'Message on [[Special:Watchlist]]. Parameters: * $1 - number of pages in your watchlist This is paired with the message {{msg-mw|Nowatchlist}} which appears instead of Watchlist-details when $1 is 0. diff --git a/maintenance/language/messages.inc b/maintenance/language/messages.inc index fdd37e666c..4e9d8644ed 100644 --- a/maintenance/language/messages.inc +++ b/maintenance/language/messages.inc @@ -1286,6 +1286,7 @@ $wgMessageStructure = array( 'recentchanges-legend', 'recentchanges-summary', 'recentchangestext', + 'recentchanges-noresult', 'recentchanges-feed-description', 'recentchanges-label-newpage', 'recentchanges-label-minor', @@ -1325,7 +1326,6 @@ $wgMessageStructure = array( 'recentchangeslinked-feed', 'recentchangeslinked-toolbox', 'recentchangeslinked-title', - 'recentchangeslinked-noresult', 'recentchangeslinked-summary', 'recentchangeslinked-page', 'recentchangeslinked-to', @@ -1976,7 +1976,6 @@ $wgMessageStructure = array( 'unwatchthispage', 'notanarticle', 'notvisiblerev', - 'watchnochange', 'watchlist-details', 'wlheader-enotif', 'wlheader-showupdated', -- 2.20.1