Bsitu has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/54993


Change subject: Consolidate messages and fix dismiss title
......................................................................

Consolidate messages and fix dismiss title

1. Dismiss title should be based on $event->getCategory instead of 
$event->getCategory
2. Remove various echo-email-batch-category-header-* messages
3. update echo-dismiss-title-* to echo-category-title-*

Change-Id: I02fc85072f3d5967668c94eb28c8ecff606023d0
---
M Echo.i18n.php
M formatters/BasicFormatter.php
M includes/EmailBatch.php
3 files changed, 77 insertions(+), 68 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Echo 
refs/changes/93/54993/1

diff --git a/Echo.i18n.php b/Echo.i18n.php
index 395a9e2..8133826 100644
--- a/Echo.i18n.php
+++ b/Echo.i18n.php
@@ -32,10 +32,14 @@
        'echo-dismiss-button' => 'Dismiss',
        'echo-dismiss-message' => 'Turn off all $1 notifications',
        'echo-dismiss-prefs-message' => 'You can turn these back on in 
Preferences',
-       'echo-dismiss-title-edit-user-talk' => 'Talk page post',
-       'echo-dismiss-title-article-linked' => 'Page linked',
-       'echo-dismiss-title-reverted' => 'Edit reverted',
-       'echo-dismiss-title-mention' => 'Mention',
+
+       // Category titles
+       'echo-category-title-edit-user-talk' => 'Talk page post',
+       'echo-category-title-article-linked' => 'Page linked',
+       'echo-category-title-reverted' => 'Edit reverted',
+       'echo-category-title-mention' => 'Mention',
+       'echo-category-title-other' => 'Other',
+       'echo-category-title-system' => 'System',
 
        // Errors
        'echo-no-agent' => '[Nobody]',
@@ -156,12 +160,7 @@
 $4
 
 $5',
-       'echo-email-batch-category-header-edit-user-talk' => '$1 talk page 
{{PLURAL:$1|message|messages}}',
-       'echo-email-batch-category-header-reverted' => '$1 
{{PLURAL:$1|edit|edits}} reverted',
-       'echo-email-batch-category-header-article-linked' => '$1 
{{PLURAL:$1|page|pages}} linked',
-       'echo-email-batch-category-header-mention' => '$1 
{{PLURAL:$1|mention|mentions}}',
-       'echo-email-batch-category-header-other' => '$1 uncategorized 
{{PLURAL:$1|notification|notifications}}',
-       'echo-email-batch-category-header-system' => '$1 system 
{{PLURAL:$1|notification|notifications}}',
+       'echo-email-batch-category-header' => '$1 $2 
{{PLURAL:$1|notification|notifications}}', 
 );
 
 /** Message documentation (Message documentation)
@@ -229,41 +228,72 @@
 {{Identical|Dismiss}}',
        'echo-dismiss-message' => 'Message asking the user if they want to turn 
off all notifications of a certain type. Parameters:
 * $1 - the name of the type; one of the following:
-** {{msg-mw|Echo-dismiss-title-edit-user-talk}}
-** {{msg-mw|Echo-dismiss-title-reverted}}
-** {{msg-mw|Echo-dismiss-title-article-linked}}',
-       'echo-dismiss-title-edit-user-talk' => 'Used as the name of 
notification type.
+** {{msg-mw|Echo-category-title-edit-user-talk}}
+** {{msg-mw|Echo-category-title-article-linked}}
+** {{msg-mw|Echo-category-title-reverted}}
+** {{msg-mw|Echo-category-title-mention}}
+** {{msg-mw|Echo-category-title-other}}
+** {{msg-mw|Echo-category-title-system}}',
+       'echo-category-title-edit-user-talk' => 'Used as the name of 
notification category.
 
-Used as <code>$1</code> in {{msg-mw|Echo-dismiss-message}}.
+Used as <code>$1</code> in {{msg-mw|Echo-dismiss-message}} and <code>$2</code> 
in {{msg-mw|Echo-email-batch-category-header}}.
 
 See also:
-* {{msg-mw|echo-dismiss-title-article-linked}}
-* {{msg-mw|echo-dismiss-title-reverted}}
-* {{msg-mw|echo-dismiss-title-mention}}',
-       'echo-dismiss-title-article-linked' => 'Used as the name of 
notification type.
+* {{msg-mw|Echo-category-title-article-linked}}
+* {{msg-mw|Echo-category-title-reverted}}
+* {{msg-mw|Echo-category-title-mention}}
+* {{msg-mw|Echo-category-title-other}}
+* {{msg-mw|Echo-category-title-system}}',
+       'echo-category-title-article-linked' => 'Used as the name of 
notification category.
 
-Used as <code>$1</code> in {{msg-mw|Echo-dismiss-message}}.
+Used as <code>$1</code> in {{msg-mw|Echo-dismiss-message}} and <code>$2</code> 
in {{msg-mw|Echo-email-batch-category-header}}.
 
 See also:
-* {{msg-mw|echo-dismiss-title-edit-user-talk}}
-* {{msg-mw|echo-dismiss-title-reverted}}
-* {{msg-mw|echo-dismiss-title-mention}}',
-       'echo-dismiss-title-reverted' => 'Used as the name of notification type.
+* {{msg-mw|Echo-category-title-edit-user-talk}}
+* {{msg-mw|Echo-category-title-reverted}}
+* {{msg-mw|Echo-category-title-mention}}
+* {{msg-mw|Echo-category-title-other}}
+* {{msg-mw|Echo-category-title-system}}',
+       'echo-category-title-reverted' => 'Used as the name of notification 
category.
 
-Used as <code>$1</code> in {{msg-mw|Echo-dismiss-message}}.
+Used as <code>$1</code> in {{msg-mw|Echo-dismiss-message}} and <code>$2</code> 
in {{msg-mw|Echo-email-batch-category-header}}.
 
 See also:
-* {{msg-mw|echo-dismiss-title-edit-user-talk}}
-* {{msg-mw|echo-dismiss-title-article-linked}}
-* {{msg-mw|echo-dismiss-title-mention}}',
-       'echo-dismiss-title-mention' => 'Used as the name of notification type.
+* {{msg-mw|Echo-category-title-edit-user-talk}}
+* {{msg-mw|Echo-category-title-article-linked}}
+* {{msg-mw|Echo-category-title-mention}}
+* {{msg-mw|Echo-category-title-other}}
+* {{msg-mw|Echo-category-title-system}}',
+       'echo-category-title-mention' => 'Used as the name of notification 
category.
 
-Used as <code>$1</code> in {{msg-mw|Echo-dismiss-message}}.
+Used as <code>$1</code> in {{msg-mw|Echo-dismiss-message}} and <code>$2</code> 
in {{msg-mw|Echo-email-batch-category-header}}.
 
 See also:
-* {{msg-mw|echo-dismiss-title-edit-user-talk}}
-* {{msg-mw|echo-dismiss-title-article-linked}}
-* {{msg-mw|echo-dismiss-title-reverted}}',
+* {{msg-mw|Echo-category-title-edit-user-talk}}
+* {{msg-mw|Echo-category-title-article-linked}}
+* {{msg-mw|Echo-category-title-reverted}}
+* {{msg-mw|Echo-category-title-other}}
+* {{msg-mw|Echo-category-title-system}}',
+       'echo-category-title-other' => 'Used as the name of notification 
category.
+
+Used as <code>$1</code> in {{msg-mw|Echo-dismiss-message}} and <code>$2</code> 
in {{msg-mw|Echo-email-batch-category-header}}.
+
+See also:
+* {{msg-mw|Echo-category-title-edit-user-talk}}
+* {{msg-mw|Echo-category-title-article-linked}}
+* {{msg-mw|Echo-category-title-reverted}}
+* {{msg-mw|Echo-category-title-mention}}
+* {{msg-mw|Echo-category-title-system}}',
+       'echo-category-title-system' => 'Used as the name of notification 
category.
+
+Used as <code>$1</code> in {{msg-mw|Echo-dismiss-message}} and <code>$2</code> 
in {{msg-mw|Echo-email-batch-category-header}}.
+
+See also:
+* {{msg-mw|Echo-category-title-edit-user-talk}}
+* {{msg-mw|Echo-category-title-article-linked}}
+* {{msg-mw|Echo-category-title-reverted}}
+* {{msg-mw|Echo-category-title-mention}}
+* {{msg-mw|Echo-category-title-other}}',
        'echo-no-agent' => 'Shown in place of a username in a notification
        if the notification has no specified user.',
        'echo-no-title' => 'Shown in place of a page title in a notification if 
the notification has no specified page title.',
@@ -485,39 +515,15 @@
 * $5 is the e-mail footer, {{msg-mw|echo-email-footer-default}}
 See also:
 * {{msg-mw|Echo-email-batch-body-daily}}',
-       'echo-email-batch-category-header-edit-user-talk' => 'E-mail batch 
section title for edit-user-talk category
-* $1 is the numeric count
-See also:
-* {{msg-mw|Echo-email-batch-category-header-reverted}}
-* {{msg-mw|Echo-email-batch-category-header-article-linked}}
-* {{msg-mw|Echo-email-batch-category-header-other}}',
-       'echo-email-batch-category-header-reverted' => 'E-mail batch section 
title for reverted category
-* $1 is the numeric count
-See also:
-* {{msg-mw|Echo-email-batch-category-header-edit-user-talk}}
-* {{msg-mw|Echo-email-batch-category-header-article-linked}}
-* {{msg-mw|Echo-email-batch-category-header-other}}',
-       'echo-email-batch-category-header-article-linked' => 'E-mail batch 
section title for article-linked category
-* $1 is the numeric count
-See also:
-* {{msg-mw|Echo-email-batch-category-header-edit-user-talk}}
-* {{msg-mw|Echo-email-batch-category-header-reverted}}
-* {{msg-mw|Echo-email-batch-category-header-other}}',
-       'echo-email-batch-category-header-mention' => 'E-mail batch section 
title for mention category
-* $1 is the numeric count',
-       'echo-email-batch-category-header-other' => 'E-mail batch section title 
for events with category not specified
-* $1 is the numeric count
-See also:
-* {{msg-mw|Echo-email-batch-category-header-edit-user-talk}}
-* {{msg-mw|Echo-email-batch-category-header-reverted}}
-* {{msg-mw|Echo-email-batch-category-header-article-linked}}',
-       'echo-email-batch-category-header-system' => 'E-mail batch section 
title for system events category (events without user agents)
-* $1 is the numeric count
-See also:
-* {{msg-mw|Echo-email-batch-category-header-edit-user-talk}}
-* {{msg-mw|Echo-email-batch-category-header-reverted}}
-* {{msg-mw|Echo-email-batch-category-header-article-linked}}
-* {{msg-mw|Echo-email-batch-category-header-other}}',
+       'echo-email-batch-category-header' => 'E-mail digest section title. 
Parameters:
+* $1 - the numeric count
+* $2 - the name of the type; one of the following:
+** {{msg-mw|Echo-category-title-edit-user-talk}}
+** {{msg-mw|Echo-category-title-article-linked}}
+** {{msg-mw|Echo-category-title-reverted}}
+** {{msg-mw|Echo-category-title-mention}}
+** {{msg-mw|Echo-category-title-other}}
+** {{msg-mw|Echo-category-title-system}}',
 );
 
 /** Afrikaans (Afrikaans)
diff --git a/formatters/BasicFormatter.php b/formatters/BasicFormatter.php
index 41e0ade..25de60b 100644
--- a/formatters/BasicFormatter.php
+++ b/formatters/BasicFormatter.php
@@ -172,7 +172,7 @@
         * @return string
         */
        protected function formatDismissInterface( $event, $user ) {
-               $dismissTitle = wfMessage( 'echo-dismiss-title-' . 
$event->getType() )
+               $dismissTitle = wfMessage( 'echo-category-title-' . 
$event->getCategory() )
                        ->inLanguage( $user->getOption( 'language' ) )
                        ->escaped();
                $dismissMessage = wfMessage( 'echo-dismiss-message', 
$dismissTitle )
diff --git a/includes/EmailBatch.php b/includes/EmailBatch.php
index 9a52b32..fe3883e 100644
--- a/includes/EmailBatch.php
+++ b/includes/EmailBatch.php
@@ -168,7 +168,10 @@
                $result = array();
                // build the text section for each category
                foreach( $this->content as $category => $notifs ) {
-                       $output = wfMessage( 
'echo-email-batch-category-header-' . $category )->params( count( $notifs ) 
)->text() . "\n";
+                       $output = wfMessage( 'echo-email-batch-category-header' 
)->params(
+                                       count( $notifs ),
+                                       wfMessage( 'echo-category-title-' . 
$category )->text()
+                               )->text() . "\n";
                        foreach( $notifs as $notif ) {
                                $output .= "\n " . wfMessage( 
'echo-email-batch-bullet' )->text() . ' ' . $notif;
                        }

-- 
To view, visit https://gerrit.wikimedia.org/r/54993
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I02fc85072f3d5967668c94eb28c8ecff606023d0
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Echo
Gerrit-Branch: master
Gerrit-Owner: Bsitu <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to