Mattflaschen has uploaded a new change for review. (
https://gerrit.wikimedia.org/r/360785 )
Change subject: Fix Thanks messages not say "received your thanks"
......................................................................
Fix Thanks messages not say "received your thanks"
We don't know if they'll receive it, due to Echo preferences
being private.
Bug: T168589
Change-Id: I45375ea3fdc48128513c53c945e55578307633d4
---
M SpecialThanks.php
M i18n/en.json
M i18n/qqq.json
M modules/ext.thanks.mobilediff.js
4 files changed, 10 insertions(+), 9 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Thanks
refs/changes/85/360785/1
diff --git a/SpecialThanks.php b/SpecialThanks.php
index 9458304..99ec212 100644
--- a/SpecialThanks.php
+++ b/SpecialThanks.php
@@ -158,6 +158,7 @@
* Display a message to the user.
*/
public function onSuccess() {
+ $sender = $this->getUser();
$recipient = User::newFromName( $this->result['recipient'] );
$link = Linker::userLink( $recipient->getId(),
$recipient->getName() );
@@ -169,7 +170,7 @@
$this->getOutput()->addHTML( $this->msg( $msgKey )
->rawParams( $link )
- ->params( $recipient->getName() )->parse()
+ ->params( $recipient->getName(), $sender->getName()
)->parse()
);
}
diff --git a/i18n/en.json b/i18n/en.json
index 997b6e9..80d8501 100644
--- a/i18n/en.json
+++ b/i18n/en.json
@@ -23,7 +23,7 @@
"thanks-thank-tooltip-no": "{{GENDER:$1|Cancel}} the thank you
notification",
"thanks-thank-tooltip-yes": "{{GENDER:$1|Send}} the thank you
notification",
"thanks-confirmation2": "{{GENDER:$1|Send}} public thanks for this
edit?",
- "thanks-thanked-notice": "$1 received your thanks for
{{GENDER:$2|his|her|their}} edit.",
+ "thanks-thanked-notice": "{{GENDER:$3|You}} thanked $1 for
{{GENDER:$2|his|her|their}} edit.",
"thanks": "Send thanks",
"thanks-submit": "Send thanks",
"thanks-form-revid": "Revision ID for edit",
@@ -43,7 +43,7 @@
"notification-link-text-view-post": "View comment",
"thanks-error-invalidpostid": "Post ID is not valid.",
"flow-thanks-confirmation-special": "Do you want to publicly send
thanks for this comment?",
- "flow-thanks-thanked-notice": "$1 received your thanks for
{{GENDER:$2|his|her|their}} comment.",
+ "flow-thanks-thanked-notice": "{{GENDER:$3|You}} thanked $1 for
{{GENDER:$2|his|her|their}} comment.",
"notification-flow-thanks-post-link": "your comment",
"notification-header-flow-thank": "$1 {{GENDER:$2|thanked}}
{{GENDER:$5|you}} for your comment in \"<strong>$3</strong>\".",
"notification-compact-header-flow-thank": "$1 {{GENDER:$2|thanked}}
{{GENDER:$3|you}}.",
diff --git a/i18n/qqq.json b/i18n/qqq.json
index 05ddf80..cd33ba1 100644
--- a/i18n/qqq.json
+++ b/i18n/qqq.json
@@ -33,7 +33,7 @@
"thanks-thank-tooltip-no": "Tooltip that appears when a user hovers
over the \"No\" confirmation link (which cancels the thank action).
Parameters:\n* $1 - The user sending the thanks. Can be used for GENDER
support.",
"thanks-thank-tooltip-yes": "Tooltip that appears when a user hovers
over the \"Yes\" confirmation link (which confirms the thank action).
Parameters:\n* $1 - The user sending the thanks. Can be used for GENDER
support.",
"thanks-confirmation2": "A confirmation message to make sure the user
actually wants to send thanks to another user.\n\nParameters:\n* $1 - The user
sending the thanks. Can be used for GENDER.\nSee also:\n*
{{msg-mw|Thanks-confirmation-special}}",
- "thanks-thanked-notice": "{{doc-singularthey}}\nPop-up message that is
displayed after a user has thanked another user for their
edit.\n\nParameters:\n* $1 - the username of the user that was thanked\n* $2 -
the gender of the user that was thanked\nSee also:\n*
{{msg-mw|Flow-thanks-thanked-notice}}",
+ "thanks-thanked-notice": "{{doc-singularthey}}\nPop-up message that is
displayed after a user has thanked another user for their
edit.\n\nParameters:\n* $1 - the username of the user that was thanked\n* $2 -
the gender of the user that was thanked.\n* $3 - The user sending the thanks.
Can be used for GENDER support.\nSee also:\n*
{{msg-mw|Flow-thanks-thanked-notice}}",
"thanks": "{{doc-special|Thanks|unlisted=1}}\nThe special page contains
the form to thank for the edit.",
"thanks-submit": "The text of the submit button on the Special:Thanks
page. {{Identical|Send thanks}}",
"thanks-form-revid": "Label for form field where the user inputs the
revision ID.",
@@ -53,7 +53,7 @@
"notification-link-text-view-post": "Label for button that links to a
comment on a Flow board",
"thanks-error-invalidpostid": "Error message that is displayed when the
Flow post UUID is not valid",
"flow-thanks-confirmation-special": "A confirmation message shown on
[[Special:Thanks]] to make sure the user wants to send thanks for a
comment.\n\nSee also:\n* {{msg-mw|Thanks-confirmation-special}}",
- "flow-thanks-thanked-notice": "{{doc-singularthey}}\nMessage displayed
after a user has thanked another user for their comment.\n\nParameters:\n* $1 -
the username of the user that was thanked\n* $2 - the gender of the user that
was thanked\nSee also:\n* {{msg-mw|Thanks-thanked-notice}}",
+ "flow-thanks-thanked-notice": "{{doc-singularthey}}\nMessage displayed
after a user has thanked another user for their comment.\n\nParameters:\n* $1 -
the username of the user that was thanked\n* $2 - the gender of the user that
was thanked\n* $3 - The user sending the thanks. Can be used for GENDER
support.\nSee also:\n* {{msg-mw|Thanks-thanked-notice}}",
"notification-flow-thanks-post-link": "The text of a link to the
comment made by the user.\n\nUsed for <code>$2</code> in
{{msg-mw|notification-flow-thanks}}. Should have capitalization appropriate for
the middle of a sentence.\n\nThis is an object in a sentence so it should be in
object case in languages where there is a special object form for words.",
"notification-header-flow-thank": "Header text for a notification when
a user is thanked for their comment on a Flow board. Parameters:\n* $1 is the
username of the user sending the thanks (not suitable for GENDER).\n* $2 is
either unused by the translation, or is the thanking user's name for use in
GENDER.\n* $3 is the title of the topic the comment belongs to\n* $4 is the
title of the page where the comment is located\n* $5 is either unused by the
translation, or is the username of the user being thanked, for use in
GENDER.\n{{related|Notification-header-flow}}",
"notification-compact-header-flow-thank": "Compact header text for a
notification when a user is thanked for their comment on a Flow board.
Parameters:\n* $1 is the username of the user sending the thanks (not suitable
for GENDER).\n* $2 is either unused by the translation, or is the thanking
user's name for use in GENDER.\n* $3 is either unused by the translation, or is
the username of the user being thanked, for use in
GENDER.\n{{related|Notification-header-flow}}",
diff --git a/modules/ext.thanks.mobilediff.js b/modules/ext.thanks.mobilediff.js
index f556a8d..1b9139c 100644
--- a/modules/ext.thanks.mobilediff.js
+++ b/modules/ext.thanks.mobilediff.js
@@ -4,16 +4,16 @@
*
* @param {string} name The username of the user who made the edit
* @param {string} revision The revision the user created
- * @param {string} gender The gender of the user who made the edit
+ * @param {string} recipientGender The gender of the user who made the
edit
*/
- function thankUser( name, revision, gender ) {
+ function thankUser( name, revision, recipientGender ) {
var d = $.Deferred();
( new mw.Api() ).postWithToken( 'csrf', {
action: 'thank',
rev: revision,
source: 'mobilediff'
} ).done( function () {
- mw.notify( mw.msg( 'thanks-thanked-notice', name,
gender ) );
+ mw.notify( mw.msg( 'thanks-thanked-notice', name,
recipientGender, mw.user ) );
d.resolve();
} )
.fail( function ( errorCode ) {
@@ -22,7 +22,7 @@
popup.show( mw.msg(
'thanks-error-invalidrevision' ) );
break;
case 'ratelimited':
- popup.show( mw.msg(
'thanks-error-ratelimited', gender ) );
+ popup.show( mw.msg(
'thanks-error-ratelimited', recipientGender ) );
break;
default:
popup.show( mw.msg(
'thanks-error-undefined', errorCode ) );
--
To view, visit https://gerrit.wikimedia.org/r/360785
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I45375ea3fdc48128513c53c945e55578307633d4
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Thanks
Gerrit-Branch: master
Gerrit-Owner: Mattflaschen <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits