From 251a7b06022444f662725833a3ac632de6eae16f Mon Sep 17 00:00:00 2001
From: Chad Little Your account has been disabled. '.pht('Your account has been disabled.').' An email has been sent with a link you can use to login. '.pht(
+ 'An email has been sent with a link you can use to login.'
+ ).' The authentication information in the link you clicked is '.
+ ' '.pht('The authentication information in the link you clicked is '.
'invalid or out of date. Make sure you are copy-and-pasting the '.
'entire link into your browser. You can try again, or request '.
- 'a new email.Forgot Password / Email Login
');
+ $panel->appendChild('
+ '.pht('Forgot Password / Email Login').'
');
$panel->appendChild($email_auth);
+ $panel->setNoBackground();
- return $this->buildStandardPageResponse(
+ return $this->buildApplicationPage(
array(
$error_view,
$panel,
),
array(
- 'title' => 'Create New Account',
+ 'title' => pht('Forgot Password'),
+ 'device' => true,
));
}
diff --git a/src/applications/auth/controller/PhabricatorEmailTokenController.php b/src/applications/auth/controller/PhabricatorEmailTokenController.php
index 0f2187ee31..855caa37af 100644
--- a/src/applications/auth/controller/PhabricatorEmailTokenController.php
+++ b/src/applications/auth/controller/PhabricatorEmailTokenController.php
@@ -49,21 +49,23 @@ final class PhabricatorEmailTokenController
!$target_user->validateEmailToken($target_email, $token)) {
$view = new AphrontRequestFailureView();
- $view->setHeader('Unable to Login');
+ $view->setHeader(pht('Unable to Login'));
$view->appendChild(
- '
The LDAP account you just authorized is already linked to '. - 'another Phabricator account. Before you can link it to a '. - 'different LDAP account, you must unlink the old account.
' + ''.pht('The LDAP account you just authorized is already '. + 'linked toanother Phabricator account. Before you can link it '. + 'to a different LDAP account, you must unlink the old '. + 'account.').'
' ); $dialog->addCancelButton('/settings/panel/ldap/'); @@ -60,12 +61,14 @@ final class PhabricatorLDAPLoginController extends PhabricatorAuthController { if (!$request->isDialogFormPost()) { $dialog = new AphrontDialogView(); $dialog->setUser($current_user); - $dialog->setTitle('Link LDAP Account'); + $dialog->setTitle(pht('Link LDAP Account')); $dialog->appendChild( - 'Link your LDAP account to your Phabricator account?
'); + ''. + pht('Link your LDAP account to your Phabricator account?'). + '
'); $dialog->addHiddenInput('username', $request->getStr('username')); $dialog->addHiddenInput('password', $request->getStr('password')); - $dialog->addSubmitButton('Link Accounts'); + $dialog->addSubmitButton(pht('Link Accounts')); $dialog->addCancelButton('/settings/panel/ldap/'); return id(new AphrontDialogResponse())->setDialog($dialog); @@ -116,27 +119,27 @@ final class PhabricatorLDAPLoginController extends PhabricatorAuthController { ->setAction('/ldap/login/') ->appendChild( id(new AphrontFormTextControl()) - ->setLabel('LDAP username') + ->setLabel(pht('LDAP username')) ->setName('username') ->setValue($ldap_username)) ->appendChild( id(new AphrontFormPasswordControl()) - ->setLabel('Password') + ->setLabel(pht('Password')) ->setName('password')); $ldap_form ->appendChild( id(new AphrontFormSubmitControl()) - ->setValue('Login')); + ->setValue(pht('Login'))); $panel = new AphrontPanelView(); $panel->setWidth(AphrontPanelView::WIDTH_FORM); - $panel->appendChild('You will not be able to login using this account '. - 'once you unlink it. Continue?
'); - $dialog->addSubmitButton('Unlink Account'); + ''.pht('You will not be able to login using this account '. + 'once you unlink it. Continue?').'
'); + $dialog->addSubmitButton(pht('Unlink Account')); $dialog->addCancelButton('/settings/panel/ldap/'); return id(new AphrontDialogResponse())->setDialog($dialog); diff --git a/src/applications/auth/controller/PhabricatorLoginController.php b/src/applications/auth/controller/PhabricatorLoginController.php index 6bc87c5aab..c4bda38a77 100644 --- a/src/applications/auth/controller/PhabricatorLoginController.php +++ b/src/applications/auth/controller/PhabricatorLoginController.php @@ -28,10 +28,10 @@ final class PhabricatorLoginController $dialog = new AphrontDialogView(); $dialog->setUser($user); - $dialog->setTitle('Login Required'); - $dialog->appendChild('You must login to continue.
'); - $dialog->addSubmitButton('Login'); - $dialog->addCancelButton('/', 'Cancel'); + $dialog->setTitle(pht('Login Required')); + $dialog->appendChild(''.pht('You must login to continue.').'
'); + $dialog->addSubmitButton(pht('Login')); + $dialog->addCancelButton('/', pht('Cancel')); return id(new AphrontDialogResponse())->setDialog($dialog); } @@ -62,10 +62,10 @@ final class PhabricatorLoginController $request->clearCookie('phsid'); $error_view = new AphrontErrorView(); - $error_view->setTitle('Invalid Session'); + $error_view->setTitle(pht('Invalid Session')); $error_view->setErrors(array( - "Your login session is invalid. Try logging in again. If that ". - "doesn't work, clear your browser cookies." + pht("Your login session is invalid. Try logging in again. If that ". + "doesn't work, clear your browser cookies.") )); } @@ -100,12 +100,12 @@ final class PhabricatorLoginController $require_captcha = true; if (!AphrontFormRecaptchaControl::processCaptcha($request)) { if (AphrontFormRecaptchaControl::hasCaptchaResponse($request)) { - $e_captcha = 'Invalid'; - $errors[] = 'CAPTCHA was not entered correctly.'; + $e_captcha = pht('Invalid'); + $errors[] = pht('CAPTCHA was not entered correctly.'); } else { - $e_captcha = 'Required'; - $errors[] = 'Too many login failures recently. You must '. - 'submit a CAPTCHA with your login request.'; + $e_captcha = pht('Required'); + $errors[] = pht('Too many login failures recently. You must '. + 'submit a CAPTCHA with your login request.'); } } } @@ -128,7 +128,7 @@ final class PhabricatorLoginController $envelope = new PhutilOpaqueEnvelope($request->getStr('password')); if (!$user || !$user->comparePassword($envelope)) { - $errors[] = 'Bad username/password.'; + $errors[] = pht('Bad username/password.'); } } @@ -160,7 +160,7 @@ final class PhabricatorLoginController if ($errors) { $error_view = new AphrontErrorView(); - $error_view->setTitle('Login Failed'); + $error_view->setTitle(pht('Login Failed')); $error_view->setErrors($errors); } @@ -170,16 +170,16 @@ final class PhabricatorLoginController ->setAction('/login/') ->appendChild( id(new AphrontFormTextControl()) - ->setLabel('Username/Email') + ->setLabel(pht('Username/Email')) ->setName('username_or_email') ->setValue($username_or_email)) ->appendChild( id(new AphrontFormPasswordControl()) - ->setLabel('Password') + ->setLabel(pht('Password')) ->setName('password') ->setCaption( ''. - 'Forgot your password? / Email Login')); + pht('Forgot your password? / Email Login').'')); if ($require_captcha) { $form->appendChild( @@ -190,7 +190,7 @@ final class PhabricatorLoginController $form ->appendChild( id(new AphrontFormSubmitControl()) - ->setValue('Login')); + ->setValue(pht('Login'))); // $panel->setCreateButton('Register New Account', '/login/register/'); @@ -206,18 +206,18 @@ final class PhabricatorLoginController ->setAction('/ldap/login/') ->appendChild( id(new AphrontFormTextControl()) - ->setLabel('LDAP username') + ->setLabel(pht('LDAP username')) ->setName('username') ->setValue($username_or_email)) ->appendChild( id(new AphrontFormPasswordControl()) - ->setLabel('Password') + ->setLabel(pht('Password')) ->setName('password')); $ldap_form ->appendChild( id(new AphrontFormSubmitControl()) - ->setValue('Login')); + ->setValue(pht('Login'))); $forms['LDAP Login'] = $ldap_form; } @@ -243,18 +243,23 @@ final class PhabricatorLoginController // CSRF for logged-out users is vaugely tricky. if ($provider->isProviderRegistrationEnabled()) { - $title = "Login or Register with {$provider_name}"; - $body = 'Login or register for Phabricator using your '. - phutil_escape_html($provider_name).' account.'; - $button = "Login or Register with {$provider_name}"; + $title = pht("Login or Register with %s", + phutil_escape_html($provider_name)); + $body = pht('Login or register for Phabricator using your %s account.', + phutil_escape_html($provider_name)); + $button = pht("Login or Register with %s", + phutil_escape_html($provider_name)); } else { - $title = "Login with {$provider_name}"; - $body = 'Login to your existing Phabricator account using your '. - phutil_escape_html($provider_name).' account.Login failed:
'. + ''.pht('Login failed:').'
'. $list. - 'Clear your cookies and try again.
'); + ''.pht('Clear your cookies and try again.').'
'); $view->appendChild( 'Are you sure you want to log out?
') - ->addSubmitButton('Log Out') + ->setTitle(pht('Log out of Phabricator?')) + ->appendChild(''.pht('Are you sure you want to log out?').'
') + ->addSubmitButton(pht('Logout')) ->addCancelButton('/'); return id(new AphrontDialogResponse())->setDialog($dialog); diff --git a/src/applications/auth/controller/PhabricatorMustVerifyEmailController.php b/src/applications/auth/controller/PhabricatorMustVerifyEmailController.php index 319163112d..999dec88ee 100644 --- a/src/applications/auth/controller/PhabricatorMustVerifyEmailController.php +++ b/src/applications/auth/controller/PhabricatorMustVerifyEmailController.php @@ -30,21 +30,25 @@ final class PhabricatorMustVerifyEmailController $email->sendVerificationEmail($user); $sent = new AphrontErrorView(); $sent->setSeverity(AphrontErrorView::SEVERITY_NOTICE); - $sent->setTitle('Email Sent'); - $sent->appendChild( - 'Another verification email was sent to '. - phutil_escape_html($email_address).'.
'); + $sent->setTitle(pht('Email Sent')); + $sent->appendChild(''. + pht('Another verification email was sent to %s.', + phutil_escape_html($email_address)).'
'); } $error_view = new AphrontRequestFailureView(); - $error_view->setHeader('Check Your Email'); + $error_view->setHeader(pht('Check Your Email')); $error_view->appendChild( - 'You must verify your email address to login. You should have a new '. + '
'. + pht('You must verify your email address to login. You should have a new '. 'email message from Phabricator with verification instructions in your '. - 'inbox ('.phutil_escape_html($email_address).').
'); + 'inbox (%s).', phutil_escape_html($email_address)). + ''); $error_view->appendChild( - 'If you did not receive an email, you can click the button below '. - 'to try sending another one.
'); + ''. + pht('If you did not receive an email, you can click the button below '. + 'to try sending another one.'). + '
'); $error_view->appendChild( 'The %s account you just authorized is already linked to '. + $dialog->setTitle(pht('Already Linked to Another Account')); + $dialog->appendChild('
'. + pht( + 'The %s account you just authorized is already linked to '. 'another Phabricator account. Before you can associate your %s '. 'account with this Phabriactor account, you must unlink it from '. 'the Phabricator account it is currently linked to.
', - $provider_name, - $provider_name)); + phutil_escape_html($provider_name), + phutil_escape_html($provider_name))).''; $dialog->addCancelButton($provider->getSettingsPanelURI()); return id(new AphrontDialogResponse())->setDialog($dialog); @@ -95,14 +95,15 @@ final class PhabricatorOAuthLoginController if ($existing_oauth) { $dialog = new AphrontDialogView(); $dialog->setUser($current_user); - $dialog->setTitle('Already Linked to an Account From This Provider'); - $dialog->appendChild( - hsprintf( - 'The account you are logged in with is already linked to a %s '. + $dialog->setTitle( + pht('Already Linked to an Account From This Provider')); + $dialog->appendChild('
'. + pht( + 'The account you are logged in with is already linked to a %s '. 'account. Before you can link it to a different %s account, you '. 'must unlink the old account.
', - $provider_name, - $provider_name)); + phutil_escape_html($provider_name), + phutil_escape_html($provider_name))).''; $dialog->addCancelButton($provider->getSettingsPanelURI()); return id(new AphrontDialogResponse())->setDialog($dialog); } @@ -110,11 +111,11 @@ final class PhabricatorOAuthLoginController if (!$request->isDialogFormPost()) { $dialog = new AphrontDialogView(); $dialog->setUser($current_user); - $dialog->setTitle('Link '.$provider_name.' Account'); + $dialog->setTitle(pht('Link %s Account', $provider_name)); $dialog->appendChild( - hsprintf( + pht( 'Link your %s account to your Phabricator account?
', - $provider_name)); + phutil_escape_html($provider_name))); $dialog->addHiddenInput('confirm_token', $provider->getAccessToken()); $dialog->addHiddenInput('expires', $oauth_info->getTokenExpires()); $dialog->addHiddenInput('state', $this->oauthState); @@ -168,14 +169,14 @@ final class PhabricatorOAuthLoginController if ($known_email) { $dialog = new AphrontDialogView(); $dialog->setUser($current_user); - $dialog->setTitle('Already Linked to Another Account'); - $dialog->appendChild( - hsprintf( - 'The %s account you just authorized has an email address which '. + $dialog->setTitle(pht('Already Linked to Another Account')); + $dialog->appendChild('
'. + pht( + 'The %s account you just authorized has an email address which '. 'is already in use by another Phabricator account. To link the '. 'accounts, log in to your Phabricator account and then go to '. - 'Settings.
', - $provider_name)); + 'Settings.', + phutil_escape_html($provider_name))).''; $user = id(new PhabricatorUser()) ->loadOneWhere('phid = %s', $known_email->getUserPHID()); @@ -189,9 +190,9 @@ final class PhabricatorOAuthLoginController ->getProviderName(); } $dialog->appendChild( - hsprintf( + pht( 'The account is associated with: %s.
', - implode(', ', $providers))); + implode(', ', phutil_escape_html($providers)))); } $dialog->addCancelButton('/login/'); @@ -203,14 +204,14 @@ final class PhabricatorOAuthLoginController if (!$provider->isProviderRegistrationEnabled()) { $dialog = new AphrontDialogView(); $dialog->setUser($current_user); - $dialog->setTitle('No Account Registration With '.$provider_name); - $dialog->appendChild( - hsprintf( - 'You can not register a new account using %s; you can only use '. + $dialog->setTitle(pht('No Account Registration with %s', $provider_name)); + $dialog->appendChild('
'. + pht( + 'You can not register a new account using %s; you can only use '. 'your %s account to log into an existing Phabricator account which '. - 'you have registered through other means.
', - $provider_name, - $provider_name)); + 'you have registered through other means.', + phutil_escape_html($provider_name), + phutil_escape_html($provider_name))).''; $dialog->addCancelButton('/login/'); return id(new AphrontDialogResponse())->setDialog($dialog); @@ -242,7 +243,7 @@ final class PhabricatorOAuthLoginController return $this->buildStandardPageResponse( $view, array( - 'title' => $provider_name.' Auth Failed', + 'title' => pht('Auth Failed'), )); } diff --git a/src/applications/auth/controller/PhabricatorOAuthUnlinkController.php b/src/applications/auth/controller/PhabricatorOAuthUnlinkController.php index 816dae4bba..bff01b251b 100644 --- a/src/applications/auth/controller/PhabricatorOAuthUnlinkController.php +++ b/src/applications/auth/controller/PhabricatorOAuthUnlinkController.php @@ -16,7 +16,7 @@ final class PhabricatorOAuthUnlinkController extends PhabricatorAuthController { if ($provider->isProviderLinkPermanent()) { throw new Exception( - "You may not unlink accounts from this OAuth provider."); + pht("You may not unlink accounts from this OAuth provider.")); } $provider_key = $provider->getProviderKey(); @@ -33,11 +33,11 @@ final class PhabricatorOAuthUnlinkController extends PhabricatorAuthController { if (!$request->isDialogFormPost()) { $dialog = new AphrontDialogView(); $dialog->setUser($user); - $dialog->setTitle('Really unlink account?'); + $dialog->setTitle(pht('Really unlink account?')); $dialog->appendChild( - 'You will not be able to login using this account '. - 'once you unlink it. Continue?
'); - $dialog->addSubmitButton('Unlink Account'); + ''.pht('You will not be able to login using this account '. + 'once you unlink it. Continue?').'
'); + $dialog->addSubmitButton(pht('Unlink Account')); $dialog->addCancelButton($provider->getSettingsPanelURI()); return id(new AphrontDialogResponse())->setDialog($dialog); diff --git a/src/applications/auth/controller/oauthregistration/PhabricatorOAuthDefaultRegistrationController.php b/src/applications/auth/controller/oauthregistration/PhabricatorOAuthDefaultRegistrationController.php index a88c27fd91..6b81024bf7 100644 --- a/src/applications/auth/controller/oauthregistration/PhabricatorOAuthDefaultRegistrationController.php +++ b/src/applications/auth/controller/oauthregistration/PhabricatorOAuthDefaultRegistrationController.php @@ -45,10 +45,10 @@ final class PhabricatorOAuthDefaultRegistrationController $user->setUsername($request->getStr('username')); $username = $user->getUsername(); if (!strlen($user->getUsername())) { - $e_username = 'Required'; - $errors[] = 'Username is required.'; + $e_username = pht('Required'); + $errors[] = pht('Username is required.'); } else if (!PhabricatorUser::validateUsername($username)) { - $e_username = 'Invalid'; + $e_username = pht('Invalid'); $errors[] = PhabricatorUser::describeValidUsername(); } else { $e_username = null; @@ -57,8 +57,8 @@ final class PhabricatorOAuthDefaultRegistrationController if (!$new_email) { $new_email = trim($request->getStr('email')); if (!$new_email) { - $e_email = 'Required'; - $errors[] = 'Email is required.'; + $e_email = pht('Required'); + $errors[] = pht('Email is required.'); } else { $e_email = null; } @@ -67,7 +67,7 @@ final class PhabricatorOAuthDefaultRegistrationController if ($new_email) { $email_ok = PhabricatorUserEmail::isAllowedAddress($new_email); if (!$email_ok) { - $e_email = 'Invalid'; + $e_email = pht('Invalid'); $errors[] = PhabricatorUserEmail::describeAllowedAddresses(); } } @@ -75,8 +75,8 @@ final class PhabricatorOAuthDefaultRegistrationController if (!strlen($user->getRealName())) { $user->setRealName($request->getStr('realname')); if (!strlen($user->getRealName())) { - $e_realname = 'Required'; - $errors[] = 'Real name is required.'; + $e_realname = pht('Required'); + $errors[] = pht('Real name is required.'); } else { $e_realname = null; } @@ -142,11 +142,11 @@ final class PhabricatorOAuthDefaultRegistrationController $new_email); if ($same_username) { - $e_username = 'Duplicate'; - $errors[] = 'That username or email is not unique.'; + $e_username = pht('Duplicate'); + $errors[] = pht('That username or email is not unique.'); } else if ($same_email) { - $e_email = 'Duplicate'; - $errors[] = 'That email is not unique.'; + $e_email = pht('Duplicate'); + $errors[] = pht('That email is not unique.'); } else { throw $exception; } @@ -157,7 +157,7 @@ final class PhabricatorOAuthDefaultRegistrationController $error_view = null; if ($errors) { $error_view = new AphrontErrorView(); - $error_view->setTitle('Registration Failed'); + $error_view->setTitle(pht('Registration Failed')); $error_view->setErrors($errors); } @@ -176,7 +176,7 @@ final class PhabricatorOAuthDefaultRegistrationController ->setAction($action_path) ->appendChild( id(new AphrontFormTextControl()) - ->setLabel('Username') + ->setLabel(pht('Username')) ->setName('username') ->setValue($user->getUsername()) ->setError($e_username)); @@ -184,7 +184,7 @@ final class PhabricatorOAuthDefaultRegistrationController if ($show_email_input) { $form->appendChild( id(new AphrontFormTextControl()) - ->setLabel('Email') + ->setLabel(pht('Email')) ->setName('email') ->setValue($request->getStr('email')) ->setCaption(PhabricatorUserEmail::describeAllowedAddresses()) @@ -194,7 +194,7 @@ final class PhabricatorOAuthDefaultRegistrationController if ($provider->retrieveUserRealName() === null) { $form->appendChild( id(new AphrontFormTextControl()) - ->setLabel('Real Name') + ->setLabel(pht('Real Name')) ->setName('realname') ->setValue($request->getStr('realname')) ->setError($e_realname)); @@ -203,20 +203,22 @@ final class PhabricatorOAuthDefaultRegistrationController $form ->appendChild( id(new AphrontFormSubmitControl()) - ->setValue('Create Account')); + ->setValue(pht('Create Account'))); $panel = new AphrontPanelView(); - $panel->setHeader('Create New Account'); + $panel->setHeader(pht('Create New Account')); $panel->setWidth(AphrontPanelView::WIDTH_FORM); $panel->appendChild($form); + $panel->setNoBackground(); - return $this->buildStandardPageResponse( + return $this->buildApplicationPage( array( $error_view, $panel, ), array( - 'title' => 'Create New Account', + 'title' => pht('Create New Account'), + 'device' => true )); } diff --git a/src/applications/auth/view/PhabricatorOAuthFailureView.php b/src/applications/auth/view/PhabricatorOAuthFailureView.php index 4853410dbd..b8fa2afd2f 100644 --- a/src/applications/auth/view/PhabricatorOAuthFailureView.php +++ b/src/applications/auth/view/PhabricatorOAuthFailureView.php @@ -29,7 +29,7 @@ final class PhabricatorOAuthFailureView extends AphrontView { $diagnose = null; $view = new AphrontRequestFailureView(); - $view->setHeader($provider_name.' Auth Failed'); + $view->setHeader(pht('%s Auth Failed', $provider_name)); if ($this->request) { $view->appendChild( hsprintf( @@ -79,7 +79,7 @@ final class PhabricatorOAuthFailureView extends AphrontView { $view->appendChild( '