From: Alexandre Emsenhuber Date: Thu, 18 Apr 2013 07:18:54 +0000 (+0200) Subject: Merge 'passwordreset-pretext' and 'passwordreset-text' messages X-Git-Tag: 1.31.0-rc.0~19543^2 X-Git-Url: http://git.cyclocoop.org/ecrire?a=commitdiff_plain;h=3305dc816289b1e72a8cb93769a371aec6c3fbca;p=lhc%2Fweb%2Fwiklou.git Merge 'passwordreset-pretext' and 'passwordreset-text' messages It is confusing to have in the same two messages which can be interpreted with different meanings. When there is more than one way of resetting a password, two messages are being show to the user: - 'passwordreset-pretext' saying to fill only one of the fields below - 'passwordreset-text' saying to *complete* the form, which people can interpret as "fill all the fields below" This already got changed at the English Wikipedia, see https://en.wikipedia.org/wiki/Wikipedia:MediaWiki_messages/Archive_5#Special:PasswordReset_improvements I think it's worth changing MediaWiki too. Change-Id: Ia2f0c889959d11396411ba44ae595ffad5d498d2 --- diff --git a/includes/specials/SpecialPasswordReset.php b/includes/specials/SpecialPasswordReset.php index fd46c038b8..3b675544a3 100644 --- a/includes/specials/SpecialPasswordReset.php +++ b/includes/specials/SpecialPasswordReset.php @@ -103,11 +103,8 @@ class SpecialPasswordReset extends FormSpecialPage { } public function alterForm( HTMLForm $form ) { - $form->setSubmitTextMsg( 'mailmypassword' ); - } - - protected function preText() { global $wgPasswordResetRoutes; + $i = 0; if ( isset( $wgPasswordResetRoutes['username'] ) && $wgPasswordResetRoutes['username'] ) { $i++; @@ -119,7 +116,10 @@ class SpecialPasswordReset extends FormSpecialPage { $i++; } - return $this->msg( 'passwordreset-pretext', $i )->parseAsBlock(); + $message = ( $i > 1 ) ? 'passwordreset-text-many' : 'passwordreset-text-one'; + + $form->setHeaderText( $this->msg( $message, $i )->parseAsBlock() ); + $form->setSubmitTextMsg( 'mailmypassword' ); } /** diff --git a/languages/messages/MessagesEn.php b/languages/messages/MessagesEn.php index bc3a381fa7..7d632ff70b 100644 --- a/languages/messages/MessagesEn.php +++ b/languages/messages/MessagesEn.php @@ -1275,11 +1275,11 @@ You may have already successfully changed your password or requested a new tempo # Special:PasswordReset 'passwordreset' => 'Reset password', -'passwordreset-text' => 'Complete this form to reset your password.', +'passwordreset-text-one' => 'Complete this form to reset your password.', +'passwordreset-text-many' => '{{PLURAL:$1|Enter one of the pieces of data to reset your password.}}', 'passwordreset-legend' => 'Reset password', 'passwordreset-disabled' => 'Password resets have been disabled on this wiki.', 'passwordreset-emaildisabled' => 'Email features have been disabled on this wiki.', -'passwordreset-pretext' => '{{PLURAL:$1||Enter one of the pieces of data below}}', 'passwordreset-username' => 'Username:', 'passwordreset-domain' => 'Domain:', 'passwordreset-capture' => 'View the resulting email?', diff --git a/languages/messages/MessagesQqq.php b/languages/messages/MessagesQqq.php index e78989829f..6cd4acc14b 100644 --- a/languages/messages/MessagesQqq.php +++ b/languages/messages/MessagesQqq.php @@ -1348,7 +1348,10 @@ See also: # Special:PasswordReset 'passwordreset' => 'Title of [[Special:PasswordReset]]. {{Identical|Reset password}}', -'passwordreset-text' => 'Text on [[Special:PasswordReset]]', +'passwordreset-text-one' => 'Text on [[Special:PasswordReset]] that appears when there is only one way of resetting the password.', +'passwordreset-text-many' => 'Text on [[Special:PasswordReset]] that appears when there are multiple ways of resetting the password. + +* $1 is the number of password reset routes.', 'passwordreset-legend' => '{{Identical|Reset password}}', 'passwordreset-disabled' => 'Used as error message in changing password.', 'passwordreset-emaildisabled' => "Used as error message in changing password when site's email feature is disabled.", @@ -8684,7 +8687,7 @@ See also: 'specialpages-group-media' => '{{doc-special-group|like=[[Special:FilePath]], [[Special:MIMESearch]] and [[Special:Upload]]}}', 'specialpages-group-users' => '{{doc-special-group|like=[[Special:ActiveUsers]], [[Special:Contributions]] and [[Special:ListGroupRights]]}}', 'specialpages-group-highuse' => '{{doc-special-group|like=[[Special:MostCategories]], [[Special:MostLinked]] and [[Special:MostRevisions]]}}', -'specialpages-group-pages' => '{{doc-special-group|like=[[Special:AllPages]], [[Special:PrefixIndex]], [[Special:Categories]], +'specialpages-group-pages' => '{{doc-special-group|like=[[Special:AllPages]], [[Special:PrefixIndex]], [[Special:Categories]], [[Special:Disambiguations]], etc}}', 'specialpages-group-pagetools' => '{{doc-special-group|like=[[Special:MovePage]], [[Special:Undelete]], [[Special:WhatLinksHere]], [[Special:Export]] etc}}', 'specialpages-group-wiki' => '{{doc-special-group|like=[[Special:Version]], [[Special:Statistics]], [[Special:LockDB]], etc}}', diff --git a/maintenance/language/messages.inc b/maintenance/language/messages.inc index fdd37e666c..25d7bf4f52 100644 --- a/maintenance/language/messages.inc +++ b/maintenance/language/messages.inc @@ -584,11 +584,11 @@ $wgMessageStructure = array( ), 'passwordreset' => array( 'passwordreset', - 'passwordreset-text', + 'passwordreset-text-one', + 'passwordreset-text-many', 'passwordreset-legend', 'passwordreset-disabled', 'passwordreset-emaildisabled', - 'passwordreset-pretext', 'passwordreset-username', 'passwordreset-domain', 'passwordreset-capture',