mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/Echo
synced 2024-11-23 23:44:53 +00:00
Don't use {$this->type} in message keys where not needed
It makes the code less clear and makes message keys harder to grep for. Change-Id: I0641e7cd0b8262d8b6548a06d505e19c1b5a1fb0
This commit is contained in:
parent
754338fe48
commit
9832d2af8b
|
@ -15,7 +15,7 @@ class EchoForeignPresentationModel extends EchoEventPresentationModel {
|
|||
|
||||
// notification-header-foreign-alert
|
||||
// notification-header-foreign-notice
|
||||
return "notification-header-{$this->type}-{$section}";
|
||||
return "notification-header-foreign-{$section}";
|
||||
}
|
||||
|
||||
public function getHeaderMessage() {
|
||||
|
@ -33,7 +33,7 @@ class EchoForeignPresentationModel extends EchoEventPresentationModel {
|
|||
|
||||
public function getBodyMessage() {
|
||||
$data = $this->event->getExtra();
|
||||
$msg = wfMessage( "notification-body-{$this->type}" );
|
||||
$msg = wfMessage( 'notification-body-foreign' );
|
||||
$msg->params( $this->language->listToText( $this->getWikiNames( $data['wikis'] ) ) );
|
||||
return $msg;
|
||||
}
|
||||
|
|
|
@ -49,7 +49,7 @@ class EchoEditUserTalkPresentationModel extends EchoEventPresentationModel {
|
|||
|
||||
public function getHeaderMessage() {
|
||||
if ( $this->isBundled() ) {
|
||||
$msg = $this->msg( "notification-bundle-header-{$this->type}-v2" );
|
||||
$msg = $this->msg( 'notification-bundle-header-edit-user-talk-v2' );
|
||||
$count = $this->getNotificationCountForOutput();
|
||||
|
||||
// Repeat is B/C until unused parameter is removed from translations
|
||||
|
@ -57,7 +57,7 @@ class EchoEditUserTalkPresentationModel extends EchoEventPresentationModel {
|
|||
$msg->params( $this->getViewingUserForGender() );
|
||||
return $msg;
|
||||
} elseif ( $this->section->exists() ) {
|
||||
$msg = $this->getMessageWithAgent( "notification-header-{$this->type}-with-section" );
|
||||
$msg = $this->getMessageWithAgent( 'notification-header-edit-user-talk-with-section' );
|
||||
$msg->params( $this->getViewingUserForGender() );
|
||||
$msg->plaintextParams( $this->section->getTruncatedSectionTitle() );
|
||||
return $msg;
|
||||
|
@ -71,8 +71,8 @@ class EchoEditUserTalkPresentationModel extends EchoEventPresentationModel {
|
|||
public function getCompactHeaderMessage() {
|
||||
$hasSection = $this->section->exists();
|
||||
$key = $hasSection
|
||||
? "notification-compact-header-{$this->type}-with-section"
|
||||
: "notification-compact-header-{$this->type}";
|
||||
? 'notification-compact-header-edit-user-talk-with-section'
|
||||
: 'notification-compact-header-edit-user-talk';
|
||||
$msg = $this->getMessageWithAgent( $key );
|
||||
$msg->params( $this->getViewingUserForGender() );
|
||||
if ( $hasSection ) {
|
||||
|
|
|
@ -58,9 +58,9 @@ class EchoPageLinkedPresentationModel extends EchoEventPresentationModel {
|
|||
|
||||
protected function getHeaderMessageKey() {
|
||||
if ( $this->getBundleCount( true, [ $this, 'getLinkedPageId' ] ) > 1 ) {
|
||||
return "notification-bundle-header-{$this->type}";
|
||||
return 'notification-bundle-header-page-linked';
|
||||
}
|
||||
return "notification-header-{$this->type}";
|
||||
return 'notification-header-page-linked';
|
||||
}
|
||||
|
||||
public function getHeaderMessage() {
|
||||
|
|
|
@ -20,7 +20,7 @@ class EchoRevertedPresentationModel extends EchoEventPresentationModel {
|
|||
public function getBodyMessage() {
|
||||
$summary = $this->event->getExtraParam( 'summary' );
|
||||
if ( !$this->isAutomaticSummary( $summary ) && $this->userCan( Revision::DELETED_COMMENT ) ) {
|
||||
$msg = $this->msg( "notification-body-{$this->type}" );
|
||||
$msg = $this->msg( 'notification-body-reverted' );
|
||||
$msg->plaintextParams( $this->formatSummary( $summary ) );
|
||||
return $msg;
|
||||
} else {
|
||||
|
|
Loading…
Reference in a new issue