Bsitu has uploaded a new change for review.

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


Change subject: (bug 47095)  Email digest header tweaks
......................................................................

(bug 47095)  Email digest header tweaks

plus adding escape to some of the messages

Change-Id: I296de4e5ebe92b737837c7ddcf3f631b16a9cf8b
---
M Echo.i18n.php
M Hooks.php
M formatters/BasicFormatter.php
M includes/EmailBatch.php
4 files changed, 37 insertions(+), 33 deletions(-)


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

diff --git a/Echo.i18n.php b/Echo.i18n.php
index 18f6854..be30850 100644
--- a/Echo.i18n.php
+++ b/Echo.i18n.php
@@ -30,12 +30,12 @@
        'echo-dismiss-prefs-message' => 'You can turn these back on in 
Preferences',
 
        // Category titles
-       'echo-category-title-edit-user-talk' => 'Talk page post',
-       'echo-category-title-article-linked' => 'Page link',
-       'echo-category-title-reverted' => 'Edit revert',
-       'echo-category-title-mention' => 'Mention',
-       'echo-category-title-other' => 'Other',
-       'echo-category-title-system' => 'System',
+       'echo-category-title-edit-user-talk' => 'Talk page 
{{PLURAL:$1|post|posts}}',
+       'echo-category-title-article-linked' => 'Page {{PLURAL:$1|link|links}}',
+       'echo-category-title-reverted' => 'Edit {{PLURAL:$1|revert|reverts}}',
+       'echo-category-title-mention' => '{{PLURAL:$1|Mention|Mentions}}',
+       'echo-category-title-other' => '{{PLURAL:$1|Other|Others}}',
+       'echo-category-title-system' => '{{PLURAL:$1|System|Systems}}',
 
        // Errors
        'echo-no-agent' => '[Nobody]',
@@ -159,11 +159,11 @@
        // Email batch
        'echo-email-batch-separator' => 
'________________________________________________', # only translate this 
message to other languages if you have to change it
        'echo-email-batch-bullet' => '•', # only translate this message to 
other languages if you have to change it
-       'echo-email-batch-subject-daily' => 'You have $1 
{{PLURAL:$2|notification|notifications}} today',
-       'echo-email-batch-subject-weekly' => 'You have $1 
{{PLURAL:$2|notification|notifications}} this week',
+       'echo-email-batch-subject-daily' => 'You have new 
{{PLURAL:$2|notification|notifications}} today',
+       'echo-email-batch-subject-weekly' => 'You have new 
{{PLURAL:$2|notification|notifications}} this week',
        'echo-email-batch-body-daily' => '$1,
 
-You have $2 {{PLURAL:$3|notification|notifications}} on {{SITENAME}} today.  
View them here:
+You have new {{PLURAL:$3|notification|notifications}} on {{SITENAME}} today.  
View them here:
 {{canonicalurl:{{#special:Notifications}}}}
 
 $4
@@ -171,13 +171,12 @@
 $5',
        'echo-email-batch-body-weekly' => '$1,
 
-You have $2 {{PLURAL:$3|notification|notifications}} on {{SITENAME}} this 
week.  View them here:
+You have new {{PLURAL:$3|notification|notifications}} on {{SITENAME}} this 
week.  View them here:
 {{canonicalurl:{{#special:Notifications}}}}
 
 $4
 
 $5',
-       'echo-email-batch-category-header' => '$1 $2 
{{PLURAL:$1|notification|notifications}}',
 );
 
 /** Message documentation (Message documentation)
@@ -226,16 +225,22 @@
 ** {{msg-mw|Echo-category-title-other}}
 ** {{msg-mw|Echo-category-title-system}}',
        'echo-dismiss-prefs-message' => 'Used in Dismiss interface.',
-       'echo-category-title-edit-user-talk' => 'This is a short title for 
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}}.',
-       'echo-category-title-article-linked' => 'This is a short title for 
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}}.',
-       'echo-category-title-reverted' => 'This is a short title for 
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}}.',
-       'echo-category-title-mention' => 'This is a short title for 
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}}.',
+       'echo-category-title-edit-user-talk' => 'This is a short title for 
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}}. Parameters:
+* $1 - the number used for plural support',
+       'echo-category-title-article-linked' => 'This is a short title for 
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}}. Parameters:
+* $1 - the number used for plural support',
+       'echo-category-title-reverted' => 'This is a short title for 
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}}. Parameters:
+* $1 - the number used for plural support',
+       'echo-category-title-mention' => 'This is a short title for 
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}}. Parameters:
+* $1 - the number used for plural support',
        'echo-category-title-other' => 'This is a short title for 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}}.
-{{Identical|Other}}',
+{{Identical|Other}} Parameters:
+* $1 - the number used for plural support',
        'echo-category-title-system' => 'This is a short title for 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}}.
-{{Identical|System}}',
+{{Identical|System}} Parameters:
+* $1 - the number used for plural support',
        '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.',
diff --git a/Hooks.php b/Hooks.php
index 399ed73..3efecdb 100644
--- a/Hooks.php
+++ b/Hooks.php
@@ -331,14 +331,14 @@
                // Build the columns (output formats)
                $columns = array();
                foreach ( $wgEchoNotifiers as $notifierType => $notifierData ) {
-                       $formatMessage = wfMessage( 'echo-pref-' . 
$notifierType )->plain();
+                       $formatMessage = wfMessage( 'echo-pref-' . 
$notifierType )->escaped();
                        $columns[$formatMessage] = $notifierType;
                }
 
                // Build the rows (notification categories)
                $rows = array();
                foreach ( $validSortedCategories as $category ) {
-                       $categoryMessage = wfMessage( 'echo-category-title-' . 
$category )->plain();
+                       $categoryMessage = wfMessage( 'echo-category-title-' . 
$category )->numParams( 1 )->escaped();
                        $rows[$categoryMessage] = $category;
                }
 
diff --git a/formatters/BasicFormatter.php b/formatters/BasicFormatter.php
index c50539c..d0e069c 100644
--- a/formatters/BasicFormatter.php
+++ b/formatters/BasicFormatter.php
@@ -213,14 +213,15 @@
        protected function formatDismissInterface( $event, $user ) {
                $dismissTitle = wfMessage( 'echo-category-title-' . 
$event->getCategory() )
                        ->inLanguage( $user->getOption( 'language' ) )
-                       ->escaped();
+                       ->numParams( 1 )
+                       ->text();
                $dismissMessage = wfMessage( 'echo-dismiss-message', 
$dismissTitle )
                        ->inLanguage( $user->getOption( 'language' ) )
-                       ->text();
+                       ->escaped();
                $dismiss = Xml::tags( 'div', array( 'class' => 
'mw-echo-dismiss-message' ), $dismissMessage ) . "\n";
                $prefsMessage = wfMessage( 'echo-dismiss-prefs-message' )
                        ->inLanguage( $user->getOption( 'language' ) )
-                       ->text();
+                       ->escaped();
                $dismiss .= Xml::tags( 'div', array( 'class' => 
'mw-echo-prefs-dismiss-message' ), $prefsMessage ) . "\n";
                $dismiss = Xml::tags( 'div', array( 'class' => 
'mw-echo-dismiss', 'style' => 'display:none;' ), $dismiss ) . "\n";
                return $dismiss;
diff --git a/includes/EmailBatch.php b/includes/EmailBatch.php
index 8caf9b5..593c7b3 100644
--- a/includes/EmailBatch.php
+++ b/includes/EmailBatch.php
@@ -180,17 +180,15 @@
                $result = array();
                // build the text section for each category
                foreach( $this->content as $category => $notifs ) {
-                       $output = wfMessage( 'echo-email-batch-category-header' 
)
-                                       ->numParams( count( $notifs ) )
-                                       // Messages that can be used here:
-                                       // * echo-category-title-system
-                                       // * echo-category-title-other
-                                       // * echo-category-title-edit-user-talk
-                                       // * echo-category-title-reverted
-                                       // * echo-category-title-article-linked
-                                       // * echo-category-title-mention
-                                       ->params( wfMessage( 
'echo-category-title-' . $category )->text() )
-                                       ->text() . "\n";
+                       // Messages that can be used here:
+                       // * echo-category-title-system
+                       // * echo-category-title-other
+                       // * echo-category-title-edit-user-talk
+                       // * echo-category-title-reverted
+                       // * echo-category-title-article-linked
+                       // * echo-category-title-mention
+                       $output = wfMessage( 'echo-category-title-' . $category 
)->numParams( count( $notifs ) )->text() . "\n";
+       
                        foreach( $notifs as $notif ) {
                                $output .= "\n " . wfMessage( 
'echo-email-batch-bullet' )->text() . ' ' . $notif;
                        }

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I296de4e5ebe92b737837c7ddcf3f631b16a9cf8b
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