X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=actions%2Fpasswordsettings.php;h=3ac1a3f94619c3d5f9d819a2000259295153d3a1;hb=57198a74647f8350db4de03b0b7ef157091a4359;hp=c9bd200bd8def93468e369baa00202bc8032bf88;hpb=592e2be5e1534c954c834fac65958d32bf0d874f;p=quix0rs-gnu-social.git diff --git a/actions/passwordsettings.php b/actions/passwordsettings.php index c9bd200bd8..3ac1a3f946 100644 --- a/actions/passwordsettings.php +++ b/actions/passwordsettings.php @@ -55,7 +55,8 @@ class PasswordsettingsAction extends SettingsAction function title() { - return _('Change password'); + // TRANS: Title for page where to change password. + return _m('TITLE','Change password'); } /** @@ -66,6 +67,7 @@ class PasswordsettingsAction extends SettingsAction function getInstructions() { + // TRANS: Instructions for page where to change password. return _('Change your password.'); } @@ -93,6 +95,7 @@ class PasswordsettingsAction extends SettingsAction 'action' => common_local_url('passwordsettings'))); $this->elementStart('fieldset'); + // TRANS: Fieldset legend on page where to change password. $this->element('legend', null, _('Password change')); $this->hidden('token', common_session_token()); @@ -101,20 +104,26 @@ class PasswordsettingsAction extends SettingsAction // Users who logged in with OpenID won't have a pwd if ($user->password) { $this->elementStart('li'); + // TRANS: Field label on page where to change password. $this->password('oldpassword', _('Old password')); $this->elementEnd('li'); } $this->elementStart('li'); + // TRANS: Field label on page where to change password. $this->password('newpassword', _('New password'), - _('6 or more characters')); + // TRANS: Field title on page where to change password. + _('6 or more characters.')); $this->elementEnd('li'); $this->elementStart('li'); - $this->password('confirm', _('Confirm'), - _('Same as password above')); + // TRANS: Field label on page where to change password. In this field the new password should be typed a second time. + $this->password('confirm', _m('LABEL','Confirm'), + // TRANS: Field title on page where to change password. + _('Same as password above.')); $this->elementEnd('li'); $this->elementEnd('ul'); - $this->submit('changepass', _('Change')); + // TRANS: Button text on page where to change password. + $this->submit('changepass', _m('BUTTON','Change')); $this->elementEnd('fieldset'); $this->elementEnd('form'); @@ -128,13 +137,13 @@ class PasswordsettingsAction extends SettingsAction * * @return void */ - function handlePost() { // CSRF protection $token = $this->trimmed('token'); if (!$token || $token != common_session_token()) { + // TRANS: Client error displayed when the session token does not match or is not given. $this->showForm(_('There was a problem with your session token. '. 'Try again, please.')); return; @@ -148,13 +157,15 @@ class PasswordsettingsAction extends SettingsAction $newpassword = $this->arg('newpassword'); $confirm = $this->arg('confirm'); - # Some validation + // Some validation if (strlen($newpassword) < 6) { + // TRANS: Form validation error on page where to change password. $this->showForm(_('Password must be 6 or more characters.')); return; } else if (0 != strcmp($newpassword, $confirm)) { - $this->showForm(_('Passwords don\'t match.')); + // TRANS: Form validation error on password change when password confirmation does not match. + $this->showForm(_('Passwords do not match.')); return; } @@ -162,7 +173,8 @@ class PasswordsettingsAction extends SettingsAction $oldpassword = $this->arg('oldpassword'); if (!common_check_user($user->nickname, $oldpassword)) { - $this->showForm(_('Incorrect old password')); + // TRANS: Form validation error on page where to change password. + $this->showForm(_('Incorrect old password.')); return; } }else{ @@ -178,17 +190,21 @@ class PasswordsettingsAction extends SettingsAction $val = $user->validate(); if ($val !== true) { + // TRANS: Form validation error on page where to change password. $this->showForm(_('Error saving user; invalid.')); return; } if (!$user->update($original)) { - $this->serverError(_('Can\'t save new password.')); + // TRANS: Server error displayed on page where to change password when password change + // TRANS: could not be made because of a server error. + $this->serverError(_('Cannot save new password.')); return; } Event::handle('EndChangePassword', array($user)); } + // TRANS: Form validation notice on page where to change password. $this->showForm(_('Password saved.'), true); } }