Merge 'passwordreset-pretext' and 'passwordreset-text' messages
authorAlexandre Emsenhuber <ialex.wiki@gmail.com>
Thu, 18 Apr 2013 07:18:54 +0000 (09:18 +0200)
committerAlexandre Emsenhuber <ialex.wiki@gmail.com>
Wed, 29 May 2013 06:33:46 +0000 (08:33 +0200)
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

includes/specials/SpecialPasswordReset.php
languages/messages/MessagesEn.php
languages/messages/MessagesQqq.php
maintenance/language/messages.inc

index fd46c03..3b67554 100644 (file)
@@ -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' );
        }
 
        /**
index bc3a381..7d632ff 100644 (file)
@@ -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?',
index e789898..6cd4acc 100644 (file)
@@ -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}}',
index fdd37e6..25d7bf4 100644 (file)
@@ -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',