Rephrase Echo 'edit-user-talk' notification

Bug: T123934
Change-Id: If053f9787127ca4488c51a663000a48bc717cadf
This commit is contained in:
Stephane Bisson 2016-01-14 11:33:21 -08:00
parent b06de34590
commit 9e536c91d4
3 changed files with 14 additions and 15 deletions

View file

@ -126,7 +126,7 @@
"echo-date-yesterday": "Yesterday",
"echo-load-more-error": "An error occurred while fetching more results.",
"notification-edit-talk-page-bundle": "$1 and $3 {{PLURAL:$4|other|others}} {{GENDER:$1|left}} messages on your [[User talk:$2|talk page]].",
"notification-bundle-header-edit-user-talk": "$1 and $4 {{PLURAL:$5|other|others}} {{GENDER:$2|left}} messages on {{GENDER:$3|your}} talk page.",
"notification-bundle-header-edit-user-talk-v2": "$1 new {{PLURAL:$2|messages}} on {{GENDER:$3|your}} talk page.",
"notification-edit-user-talk-email-batch-bundle-body": "$1 and $2 {{PLURAL:$3|other|others}} {{GENDER:$1|left}} a message on your talk page.",
"notification-page-linked-email-batch-bundle-body": "$2 was {{GENDER:$1|linked}} from $3 and $4 other {{PLURAL:$5|page|pages}}.",
"echo-email-batch-separator": "--",

View file

@ -147,7 +147,7 @@
"echo-date-yesterday": "The header text for yesterday's notification section.\n{{Identical|Yesterday}}",
"echo-load-more-error": "Error message for errors in loading more notifications",
"notification-edit-talk-page-bundle": "Bundled message for edit-user-talk notification. Parameters:\n* $1 - the name of the user who performed the action, which can be used for gender support\n* $2 - the name of the user being addressed\n* $3 - the count of other action performers, could be a number or {{msg-mw|Echo-notification-count}}. e.g. \"7\" or \"99+\"\n* $4 - a number used for plural support relating to $3 (likely identical to $3 it that is a number, and 100 otherwise)\nSee also:\n* {{msg-mw|Notification-edit-talk-page2}}\n* {{msg-mw|Notification-edit-talk-page-email-batch-body2}}\n* {{msg-mw|Notification-edit-talk-page-email-subject2}}",
"notification-bundle-header-edit-user-talk": "Bundled flyout header message for edit-user-talk notification. Parameters:\n* $1 - the formatted name of the user who performed the action\n* $2 - the username for GENDER\n* $3 - the name of the user being addressed\n* $4 - the count of other action performers, could be a number or {{msg-mw|Echo-notification-count}}. e.g. \"7\" or \"99+\"\n* $5 - a number used for plural support relating to $4 (likely identical to $4 if that is a number, and 100 otherwise)\nSee also:\n* {{msg-mw|Notification-edit-talk-page2}}\n* {{msg-mw|Notification-edit-talk-page-email-batch-body2}}\n* {{msg-mw|Notification-edit-talk-page-email-subject2}}\n{{Related|Notification-bundle}}",
"notification-bundle-header-edit-user-talk-v2": "Bundled header message for edit-user-talk notification. Parameters:\n* $1 - the formatted number of new messages\n* $2 - the number of new messages for PLURAL\n* $3 - the name of the user being addressed, can be used for GENDER\n{{Related|Notification-bundle}}",
"notification-edit-user-talk-email-batch-bundle-body": "Bundled message for edit-user-talk email digest notification. Parameters:\n* $1 - the username who performs the action, which can be used for gender support\n* $2 - the count of other action performers, could be number or {{msg-mw|echo-notification-count}}\n* $3 - a number used for plural support\n\nSee also:\n* {{msg-mw|Notification-edit-talk-page2}}\n* {{msg-mw|Notification-edit-talk-page-flyout2}}\n* {{msg-mw|Notification-edit-talk-page-email-batch-body2}}\n* {{msg-mw|Notification-edit-talk-page-email-subject2}}",
"notification-page-linked-email-batch-bundle-body": "Bundled message for page-linked email digest notification. Parameters:\n* $1 - the username who performs the action, which can be used for gender support\n* $2 - the link-to page title\n* $3 - the link-from page title\n* $4 - the count of other link-from page title, can be number or {{msg-mw|echo-notification-count}}\n* $5 - a number used for plural support (numeric version of $4)\n\nSee also:\n* {{msg-mw|Notification-page-linked}}\n* {{msg-mw|Notification-page-linked-flyout}}\n* {{msg-mw|Notification-page-linked-email-batch-body}}\n* {{msg-mw|Notification-page-linked-email-subject}}",
"echo-email-batch-separator": "{{optional}}\nEmail batch content separator",

View file

@ -12,7 +12,7 @@ class EchoEditUserTalkPresentationModel extends EchoEventPresentationModel {
public function getPrimaryLink() {
$title = $this->event->getTitle();
if ( $this->hasSection() ) {
if ( !$this->isBundled() && $this->hasSection() ) {
$title = Title::makeTitle(
$title->getNamespace(),
$title->getDBkey(),
@ -34,17 +34,21 @@ class EchoEditUserTalkPresentationModel extends EchoEventPresentationModel {
'icon' => 'changes',
'prioritized' => true
);
return array( $this->getAgentLink(), $diffLink );
if ( $this->isBundled() ) {
return array( $diffLink );
} else {
return array( $this->getAgentLink(), $diffLink );
}
}
public function getHeaderMessage() {
if ( $this->getBundleCount( true, array( $this,'getEventUser' ) ) > 1 ) {
$msg = $this->getMessageWithAgent( "notification-bundle-header-{$this->type}" );
list( $formattedCount, $countForPlural ) =
$this->getNotificationCountForOutput( false, array( $this, 'getEventUser' ) );
$msg->params( $this->getViewingUserForGender() );
if ( $this->isBundled() ) {
$msg = $this->msg( "notification-bundle-header-{$this->type}-v2" );
list( $formattedCount, $countForPlural ) = $this->getNotificationCountForOutput();
$msg->params( $formattedCount );
$msg->params( $countForPlural );
$msg->params( $this->getViewingUserForGender() );
return $msg;
} elseif ( $this->hasSection() ) {
$msg = $this->getMessageWithAgent( "notification-header-{$this->type}-with-section" );
@ -59,7 +63,7 @@ class EchoEditUserTalkPresentationModel extends EchoEventPresentationModel {
}
public function getBodyMessage() {
if ( $this->getBundleCount( true, array( $this,'getEventUser' ) ) === 1 && $this->hasSection() ) {
if ( !$this->isBundled() && $this->hasSection() ) {
$msg = $this->msg( 'notification-body-edit-user-talk-with-section' );
$msg->params( wfEscapeWikiText( $this->getRevisionSnippet() ) );
return $msg;
@ -68,11 +72,6 @@ class EchoEditUserTalkPresentationModel extends EchoEventPresentationModel {
}
}
public static function getEventUser( EchoEvent $event ) {
$agent = $event->getAgent();
return $agent->isAnon() ? $agent->getName() : $agent->getId();
}
private function hasSection() {
return (bool)$this->event->getExtraParam( 'section-title' );
}