(bug 44253) Add message when there are few watchers
authorBrad Jorsch <bjorsch@wikimedia.org>
Tue, 29 Jan 2013 03:13:16 +0000 (22:13 -0500)
committerBrad Jorsch <bjorsch@wikimedia.org>
Tue, 29 Jan 2013 18:27:21 +0000 (13:27 -0500)
When a page has fewer than $wgUnwatchedPageThreshold watchers and the
user does not have the 'unwatchedpages' right, the row for number if
watchers is not being displayed at all. This is confusing to some users,
so instead display the row with an appropriate message.

Change-Id: I2425e45ec5db2dc743f875acf3fd3717b7d06286

includes/actions/InfoAction.php
languages/messages/MessagesEn.php
languages/messages/MessagesQqq.php
maintenance/language/messages.inc

index 1cca95c..acb8c00 100644 (file)
@@ -274,6 +274,11 @@ class InfoAction extends FormlessAction {
                        $pageInfo['header-basic'][] = array(
                                $this->msg( 'pageinfo-watchers' ), $lang->formatNum( $pageCounts['watchers'] )
                        );
+               } elseif ( $wgUnwatchedPageThreshold !== false ) {
+                       $pageInfo['header-basic'][] = array(
+                               $this->msg( 'pageinfo-watchers' ),
+                               $this->msg( 'pageinfo-few-watchers' )->numParams( $wgUnwatchedPageThreshold )
+                       );
                }
 
                // Redirects to this page
index 7ed6123..3a477c7 100644 (file)
@@ -3768,6 +3768,7 @@ This is probably caused by a link to a blacklisted external site.',
 'pageinfo-robot-noindex'          => 'Not indexable',
 'pageinfo-views'                  => 'Number of views',
 'pageinfo-watchers'               => 'Number of page watchers',
+'pageinfo-few-watchers'           => 'Fewer than $1 {{PLURAL:$1|watcher|watchers}}',
 'pageinfo-redirects-name'         => 'Redirects to this page',
 'pageinfo-redirects-value'        => '$1', # only translate this message to other languages if you have to change it
 'pageinfo-subpages-name'          => 'Subpages of this page',
index bb0e151..429cd7e 100644 (file)
@@ -6522,6 +6522,7 @@ See also:
 'pageinfo-robot-noindex' => 'An indication that the page is not indexable (that is, is not listed on the results page of a search engine).',
 'pageinfo-views' => 'The number of times the page has been viewed.',
 'pageinfo-watchers' => 'The number of users watching the page.',
+'pageinfo-few-watchers' => 'Message displayed when there are fewer than $wgUnwatchedPageThreshold watchers. $1 is the value of $wgUnwatchedPageThreshold.',
 'pageinfo-redirects-name' => "The number of redirects to the page.
 
 Used as link text, linked to '{{int:Whatlinkshere-title}}' page ([[Special:WhatLinksHere]]).",
index 1ab22e2..e2997c4 100644 (file)
@@ -2702,6 +2702,7 @@ $wgMessageStructure = array(
                'pageinfo-robot-noindex',
                'pageinfo-views',
                'pageinfo-watchers',
+               'pageinfo-few-watchers',
                'pageinfo-redirects-name',
                'pageinfo-redirects-value',
                'pageinfo-subpages-name',