From ad49be53a8632b3a13257f3a89229ae504e92dd7 Mon Sep 17 00:00:00 2001 From: Raimond Spekking Date: Mon, 3 Nov 2008 17:45:38 +0000 Subject: [PATCH] Make show/hide links in watchlist consistent to recent changes (and ipblocklist too). Use the same messages for RC/WL to keep translations consistent. --- includes/specials/SpecialWatchlist.php | 30 ++++++++++++++------------ languages/messages/MessagesEn.php | 12 ----------- maintenance/language/messages.inc | 12 ----------- 3 files changed, 16 insertions(+), 38 deletions(-) diff --git a/includes/specials/SpecialWatchlist.php b/includes/specials/SpecialWatchlist.php index 7cf4879b0e..737d7f338f 100644 --- a/includes/specials/SpecialWatchlist.php +++ b/includes/specials/SpecialWatchlist.php @@ -250,38 +250,40 @@ function wfSpecialWatchlist( $par ) { $thisTitle = SpecialPage::getTitleFor( 'Watchlist' ); $skin = $wgUser->getSkin(); + $showLinktext = wfMsgHtml( 'show' ); + $hideLinktext = wfMsgHtml( 'hide' ); # Hide/show minor edits - $label = $hideMinor ? wfMsgHtml( 'watchlist-show-minor' ) : wfMsgHtml( 'watchlist-hide-minor' ); + $label = $hideMinor ? $showLinktext : $hideLinktext; $linkBits = wfArrayToCGI( array( 'hideMinor' => 1 - (int)$hideMinor ), $nondefaults ); - $links[] = $skin->makeKnownLinkObj( $thisTitle, $label, $linkBits ); + $links[] = wfMsgHtml( 'rcshowhideminor', $skin->makeKnownLinkObj( $thisTitle, $label, $linkBits ) ); # Hide/show bot edits - $label = $hideBots ? wfMsgHtml( 'watchlist-show-bots' ) : wfMsgHtml( 'watchlist-hide-bots' ); + $label = $hideBots ? $showLinktext : $hideLinktext; $linkBits = wfArrayToCGI( array( 'hideBots' => 1 - (int)$hideBots ), $nondefaults ); - $links[] = $skin->makeKnownLinkObj( $thisTitle, $label, $linkBits ); + $links[] = wfMsgHtml( 'rcshowhidebots', $skin->makeKnownLinkObj( $thisTitle, $label, $linkBits ) ); # Hide/show anonymous edits - $label = $hideAnons ? wfMsgHtml( 'watchlist-show-anons' ) : wfMsgHtml( 'watchlist-hide-anons' ); + $label = $hideAnons ? $showLinktext : $hideLinktext; $linkBits = wfArrayToCGI( array( 'hideAnons' => 1 - (int)$hideAnons ), $nondefaults ); - $links[] = $skin->makeKnownLinkObj( $thisTitle, $label, $linkBits ); + $links[] = wfMsgHtml( 'rcshowhideanons', $skin->makeKnownLinkObj( $thisTitle, $label, $linkBits ) ); # Hide/show logged in edits - $label = $hideLiu ? wfMsgHtml( 'watchlist-show-liu' ) : wfMsgHtml( 'watchlist-hide-liu' ); + $label = $hideLiu ? $showLinktext : $hideLinktext; $linkBits = wfArrayToCGI( array( 'hideLiu' => 1 - (int)$hideLiu ), $nondefaults ); - $links[] = $skin->makeKnownLinkObj( $thisTitle, $label, $linkBits ); + $links[] = wfMsgHtml( 'rcshowhideliu', $skin->makeKnownLinkObj( $thisTitle, $label, $linkBits ) ); # Hide/show own edits - $label = $hideOwn ? wfMsgHtml( 'watchlist-show-own' ) : wfMsgHtml( 'watchlist-hide-own' ); + $label = $hideOwn ? $showLinktext : $hideLinktext; $linkBits = wfArrayToCGI( array( 'hideOwn' => 1 - (int)$hideOwn ), $nondefaults ); - $links[] = $skin->makeKnownLinkObj( $thisTitle, $label, $linkBits ); - + $links[] = wfMsgHtml( 'rcshowhidemine', $skin->makeKnownLinkObj( $thisTitle, $label, $linkBits ) ); + # Hide/show patrolled edits if( $wgUser->useRCPatrol() ) { - $label = $hidePatrolled ? wfMsgHtml( 'watchlist-show-patrolled' ) : wfMsgHtml( 'watchlist-hide-patrolled' ); + $label = $hidePatrolled ? $showLinktext : $hideLinktext; $linkBits = wfArrayToCGI( array( 'hidePatrolled' => 1 - (int)$hidePatrolled ), $nondefaults ); - $links[] = $skin->makeKnownLinkObj( $thisTitle, $label, $linkBits ); + $links[] = wfMsgHtml( 'rcshowhidepatr', $skin->makeKnownLinkObj( $thisTitle, $label, $linkBits ) ); } - + # Namespace filter and put the whole form together. $form .= $wlInfo; $form .= $cutofflinks; diff --git a/languages/messages/MessagesEn.php b/languages/messages/MessagesEn.php index 63b6fed9df..b5bd7bdb0c 100644 --- a/languages/messages/MessagesEn.php +++ b/languages/messages/MessagesEn.php @@ -2254,18 +2254,6 @@ Future changes to this page and its associated talk page will be listed there, a 'iteminvalidname' => "Problem with item '$1', invalid name...", 'wlnote' => "Below {{PLURAL:$1|is the last change|are the last '''$1''' changes}} in the last {{PLURAL:$2|hour|'''$2''' hours}}.", 'wlshowlast' => 'Show last $1 hours $2 days $3', -'watchlist-show-bots' => 'Show bot edits', -'watchlist-hide-bots' => 'Hide bot edits', -'watchlist-show-own' => 'Show my edits', -'watchlist-hide-own' => 'Hide my edits', -'watchlist-show-minor' => 'Show minor edits', -'watchlist-hide-minor' => 'Hide minor edits', -'watchlist-show-anons' => 'Show anonymous edits', -'watchlist-hide-anons' => 'Hide anonymous edits', -'watchlist-show-liu' => 'Show logged-in user edits', -'watchlist-hide-liu' => 'Hide logged-in user edits', -'watchlist-show-patrolled' => 'Show patrolled edits', -'watchlist-hide-patrolled' => 'Hide patrolled edits', 'watchlist-options' => 'Watchlist options', # Displayed when you click the "watch" button and it is in the process of watching diff --git a/maintenance/language/messages.inc b/maintenance/language/messages.inc index d1a11f6ce8..060f23cefc 100644 --- a/maintenance/language/messages.inc +++ b/maintenance/language/messages.inc @@ -1514,18 +1514,6 @@ $wgMessageStructure = array( 'iteminvalidname', 'wlnote', 'wlshowlast', - 'watchlist-show-bots', - 'watchlist-hide-bots', - 'watchlist-show-own', - 'watchlist-hide-own', - 'watchlist-show-minor', - 'watchlist-hide-minor', - 'watchlist-show-anons', - 'watchlist-hide-anons', - 'watchlist-show-liu', - 'watchlist-hide-liu', - 'watchlist-show-patrolled', - 'watchlist-hide-patrolled', 'watchlist-options', ), 'watching' => array( -- 2.20.1