Niharika29 has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/350889 )
Change subject: Fix broken LoginNotify emails ...................................................................... Fix broken LoginNotify emails Bug: T163742 Change-Id: I26b7c65c798cee376ba4c750851e7e7669d96e01 --- M LoginNotifyPresentationModel.php M i18n/en.json M i18n/qqq.json 3 files changed, 26 insertions(+), 2 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/LoginNotify refs/changes/89/350889/1 diff --git a/LoginNotifyPresentationModel.php b/LoginNotifyPresentationModel.php index f3ec6e7..e061d50 100644 --- a/LoginNotifyPresentationModel.php +++ b/LoginNotifyPresentationModel.php @@ -17,11 +17,33 @@ */ public function getPrimaryLink() { return [ - 'url' => 'https://mediawiki.org/wiki/Help:Login_notifications' + 'url' => 'https://mediawiki.org/wiki/Help:Login_notifications', + 'label' => $this->msg( 'loginnotify-primary-link' )->text() ]; } /** + * Define the email subject string + * + * @return string Message string for email subject + */ + public function getSubjectMessage() { + switch ( $this->event->getType() ) { + case 'login-fail-known': + case 'login-fail-new': + $msg = $this->msg( 'notification-loginnotify-login-fail-email-subject' ); + $msg->params( $this->getUser()->getName() ); + $msg->params( $this->event->getExtraParam( 'count', 0 ) ); + break; + default: + $msg = $this->msg( 'notification-loginnotify-login-success-email-subject' ); + $msg->params( $this->getUser()->getName() ); + break; + } + return $msg; + } + + /** * Include the number of attempts in the message if needed * * @return Message diff --git a/i18n/en.json b/i18n/en.json index b150f98..2507524 100644 --- a/i18n/en.json +++ b/i18n/en.json @@ -12,11 +12,12 @@ "echo-category-title-login-success": "Login from new computer", "echo-pref-tooltip-login-success": "Notify me whenever somebody logs into my account from a computer I have not used before.", "loginnotify-login-fail": "There have been several failed attempts to log in to your account", + "loginnotify-primary-link": "Help information", "notification-loginnotify-login-fail-email-subject": "{{PLURAL:$2|Failed attempt|Multiple failed attempts}} to log in to {{SITENAME}} as $1", "notification-loginnotify-login-success-email-subject": "Login to {{SITENAME}} as $1 from a computer you have not recently used", - "notification-header-login-success": "Someone has successfully logged into your account from a computer which you have not edited from recently.", "notification-loginnotify-login-fail-new-emailbatch": "There {{PLURAL:$2|has been a failed attempt|have been $2 failed attempts}} to log in to your account '$1' on {{SITENAME}}. If it wasn't you, please make sure your account has a strong password.", "notification-loginnotify-login-fail-known-emailbatch": "There {{PLURAL:$2|has been a failed attempt|have been $2 failed attempts}} to log in to your account, '$1' on {{SITENAME}}. If it wasn't you, please make sure your account has a strong password.", + "notification-header-login-success": "Someone has successfully logged into your account from a computer which you have not edited from recently.", "notification-loginnotify-login-success-emailbatch": "Someone has successfully logged into your account '$1' on {{SITENAME}} from a computer which you have not edited from recently.", "notification-new-bundled-header-login-fail": "There {{PLURAL:$1|has been '''a failed attempt'''|have been '''$1 failed attempts'''}} to log in to your account from a new device since the last time you logged in. If it wasn't you, please make sure your account has a strong password.", "notification-known-header-login-fail": "There have been {{PLURAL:$1|has been '''a failed attempt'''|have been '''$1 failed attempts'''}} to log in to your account since the last time you logged in. If it wasn't you, please make sure your account has a strong password.", diff --git a/i18n/qqq.json b/i18n/qqq.json index 9a749c5..6dfbb32 100644 --- a/i18n/qqq.json +++ b/i18n/qqq.json @@ -11,6 +11,7 @@ "echo-category-title-login-success": "Label for 2 checkboxes in the Notifications section of [[Special:Preferences]]. The checkbox controls if the user receives notification on someone logging in to this account from a computer that has not previously been used to log in by this user.", "echo-pref-tooltip-login-success": "Help tooltip for {{msg-mw|echo-category-title-login-success}}", "loginnotify-login-fail": "FIXME I have no idea where this message is used.\n{{notranslate}}", + "loginnotify-primary-link": "Label for link to a help page about the feature", "notification-loginnotify-login-fail-email-subject": "Email subject line for email notice that there have been failed login attempts for the user's account. $1 is the user in question.", "notification-loginnotify-login-success-email-subject": "Email subject line for email notice that someone has logged in to the user's account from a computer that has not previously been used. $1 is the user in question.", "notification-header-login-success": "Text of notification for when someone successfully logs in as the current account from a computer that has not been previously used by that account. This is shown in the user's echo notifications, and is possibly emailed to the user.\n* $1 = Username for account, formatted for display\n* $2 = Username for account, unformatted for use in GENDER", -- To view, visit https://gerrit.wikimedia.org/r/350889 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I26b7c65c798cee376ba4c750851e7e7669d96e01 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/LoginNotify Gerrit-Branch: master Gerrit-Owner: Niharika29 <nko...@wikimedia.org> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits