diff --git a/i18n/en.json b/i18n/en.json index 8c382b5d3..8d0fd94d9 100644 --- a/i18n/en.json +++ b/i18n/en.json @@ -83,6 +83,7 @@ "discussiontools-notification-removed-topic-disable": "Stop receiving notifications like this", "discussiontools-notification-removed-topic-disabled-title": "{{GENDER:|You}} will no longer receive notifications when a topic is archived or removed.", "discussiontools-notification-removed-topic-disabled-body": "You can change this in [[Special:Preferences#mw-prefsection-echo-echosubscriptions|your preferences]].", + "discussiontools-notification-topic-hidden": "(topic removed)", "discussiontools-notification-subscribed-new-comment-header": "$1 {{GENDER:$2|replied}} in \"$4\".", "discussiontools-notification-subscribed-new-comment-header-bundled": "{{PLURAL:$1|One new reply|$1 new replies|100=99+ new replies}} in \"$3\".", "discussiontools-notification-subscribed-new-comment-header-compact": "$1: $3.", diff --git a/i18n/qqq.json b/i18n/qqq.json index 27539b54f..83b011231 100644 --- a/i18n/qqq.json +++ b/i18n/qqq.json @@ -97,6 +97,7 @@ "discussiontools-notification-removed-topic-disable": "Button to disable notifications of the given type, shown below an Echo notification.", "discussiontools-notification-removed-topic-disabled-title": "Title of notification popup shown when a user disables this type of Echo notifications.", "discussiontools-notification-removed-topic-disabled-body": "Body of notification popup shown when a user disables this type of Echo notifications.", + "discussiontools-notification-topic-hidden": "Text shown instead of topic title when the topic title has been hidden and context user does not have permission to see it", "discussiontools-notification-subscribed-new-comment-header": "Notification header text for when there is a reply on a topic. Parameters:\n* $1 - the formatted username of the user who replied to the topic\n* $2 - the username for gender purposes\n* $3 - title of the page\n* $4 - title of the topic.", "discussiontools-notification-subscribed-new-comment-header-bundled": "Notification header text for when there is a multiple replies on a topic. Parameters:\n* $1 - the number of replies for display\n* $2 - the raw number of replies, for PLURAL\n* $3 - title of the topic.\n{{Related|discussiontools-notification-bundle}}", "discussiontools-notification-subscribed-new-comment-header-compact": "{{optional}}\nNotification compact header text for when there is a reply on a topic. Parameters:\n* $1 - the formatted username of the user who replied to the topic\n* $2 - the username for gender purposes\n* $3 - excerpt of the reply.\n{{Related|discussiontools-notification-header-flow}}", diff --git a/includes/Notifications/SubscribedNewCommentPresentationModel.php b/includes/Notifications/SubscribedNewCommentPresentationModel.php index 96339dabd..cdc8fbecd 100644 --- a/includes/Notifications/SubscribedNewCommentPresentationModel.php +++ b/includes/Notifications/SubscribedNewCommentPresentationModel.php @@ -88,17 +88,20 @@ class SubscribedNewCommentPresentationModel extends EchoEventPresentationModel { if ( $this->isBundled() ) { $count = $this->getNotificationCountForOutput(); $msg = $this->msg( $this->getHeaderMessageKey() ); - // Repeat is B/C until unused parameter is removed from translations $msg->numParams( $count, $count ); - $msg->plaintextParams( $this->section->getTruncatedSectionTitle() ); - return $msg; } else { $msg = parent::getHeaderMessage(); $msg->params( $this->getTruncatedTitleText( $this->event->getTitle(), true ) ); - $msg->plaintextParams( $this->section->getTruncatedSectionTitle() ); - return $msg; } + + if ( $this->section->exists() ) { + $msg->plaintextParams( $this->section->getTruncatedSectionTitle() ); + } else { + $msg->plaintextParams( $this->msg( 'discussiontools-notification-topic-hidden' )->text() ); + } + + return $msg; } /**