diff options
author | Glaisher <glaisher.wiki@gmail.com> | 2016-07-30 15:05:36 +0500 |
---|---|---|
committer | Reedy <reedy@wikimedia.org> | 2016-08-07 13:32:52 +0000 |
commit | c08f8566b4c5764e40830d5c97fc1e5fcb65f4a7 (patch) | |
tree | 69cb01f708d75c3dd669df7a669eb28621eec6f3 /includes/api/ApiWatch.php | |
parent | 8771ae98720eadfe95cdaf134e3dc2ca06526309 (diff) | |
download | mediawikicore-c08f8566b4c5764e40830d5c97fc1e5fcb65f4a7.tar.gz mediawikicore-c08f8566b4c5764e40830d5c97fc1e5fcb65f4a7.zip |
Use different message when (un)watching a page in talk namespace
addedwatchtext and removedwatchtext uses the phrase "$1 and its discussion page".
As this is inaccurate on talk namespace pages, two new messages, addedwatchtext-talk
and removedwatchtext-talk, have been introduced for use in talk namespace pages.
Bug: T87856
Change-Id: Iafd86402d3a2a65ce2be007c87c981ac08f44e67
Diffstat (limited to 'includes/api/ApiWatch.php')
-rw-r--r-- | includes/api/ApiWatch.php | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/includes/api/ApiWatch.php b/includes/api/ApiWatch.php index f09fdcb063c9..3a7a082148dc 100644 --- a/includes/api/ApiWatch.php +++ b/includes/api/ApiWatch.php @@ -110,14 +110,16 @@ class ApiWatch extends ApiBase { $status = UnwatchAction::doUnwatch( $title, $user ); $res['unwatched'] = $status->isOK(); if ( $status->isOK() ) { - $res['message'] = $this->msg( 'removedwatchtext', $title->getPrefixedText() ) + $msgKey = $title->isTalkPage() ? 'removedwatchtext-talk' : 'removedwatchtext'; + $res['message'] = $this->msg( $msgKey, $title->getPrefixedText() ) ->title( $title )->parseAsBlock(); } } else { $status = WatchAction::doWatch( $title, $user ); $res['watched'] = $status->isOK(); if ( $status->isOK() ) { - $res['message'] = $this->msg( 'addedwatchtext', $title->getPrefixedText() ) + $msgKey = $title->isTalkPage() ? 'addedwatchtext-talk' : 'addedwatchtext'; + $res['message'] = $this->msg( $msgKey, $title->getPrefixedText() ) ->title( $title )->parseAsBlock(); } } |