1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-09-19 00:38:51 +02:00

Remove product literal strings in "pht()", part 1

Summary: Ref T13658. I used the linter in D21763 to identify these and `split` them into arbitrary groups of 10 files.

Test Plan:
This test plan is non-exhaustive, because some of these strings are difficult to reach.

  - Looked at "Create Service" in Almanac.
  - Used "bin/auth" to go through a one-time auth workflow (not all related strings can be hit on a single workflow).
  - Started the "Generate Keypair" worfklow in "SSH Public Keys".

Subscribers: PHID-OPKG-gm6ozazyms6q6i22gyam

Maniphest Tasks: T13658

Differential Revision: https://secure.phabricator.com/D21765
This commit is contained in:
epriestley 2022-04-25 10:14:43 -07:00
parent de980cc54e
commit 3e82ab5adb
10 changed files with 65 additions and 49 deletions

View file

@ -1,6 +1,6 @@
<?php <?php
echo pht('Populating Phabricator files with mail keys xactions...')."\n"; echo pht('Populating files with mail keys...')."\n";
$table = new PhabricatorFile(); $table = new PhabricatorFile();
$table_name = $table->getTableName(); $table_name = $table->getTableName();

View file

@ -5,13 +5,13 @@ $root = dirname(dirname(dirname(__FILE__)));
require_once $root.'/scripts/init/init-setup.php'; require_once $root.'/scripts/init/init-setup.php';
$args = new PhutilArgumentParser($argv); $args = new PhutilArgumentParser($argv);
$args->setTagline(pht('manage Phabricator storage and schemata')); $args->setTagline(pht('manage storage and schemata'));
$args->setSynopsis(<<<EOHELP $args->setSynopsis(<<<EOHELP
**storage** __workflow__ [__options__] **storage** __workflow__ [__options__]
Manage Phabricator database storage and schema versioning. Manage database storage and schema versioning.
**storage** upgrade **storage** upgrade
Initialize or upgrade Phabricator storage. Initialize or upgrade storage.
**storage** upgrade --user __root__ --password __hunter2__ **storage** upgrade --user __root__ --password __hunter2__
Use administrative credentials for schema changes. Use administrative credentials for schema changes.
@ -74,7 +74,7 @@ try {
'name' => 'disable-utf8mb4', 'name' => 'disable-utf8mb4',
'help' => pht( 'help' => pht(
'Disable %s, even if the database supports it. This is an '. 'Disable %s, even if the database supports it. This is an '.
'advanced feature used for testing changes to Phabricator; you '. 'advanced feature used for testing internal changes; you '.
'should not normally use this flag.', 'should not normally use this flag.',
'utf8mb4'), 'utf8mb4'),
), ),
@ -168,9 +168,9 @@ foreach ($refs as $ref) {
'Unable to connect to MySQL using the configured credentials. '. 'Unable to connect to MySQL using the configured credentials. '.
'You must configure standard credentials before you can upgrade '. 'You must configure standard credentials before you can upgrade '.
'storage. Run these commands to set up credentials:'), 'storage. Run these commands to set up credentials:'),
" phabricator/ $ ./bin/config set mysql.host __host__\n". " $ ./bin/config set mysql.host __host__\n".
" phabricator/ $ ./bin/config set mysql.user __username__\n". " $ ./bin/config set mysql.user __username__\n".
" phabricator/ $ ./bin/config set mysql.pass __password__", " $ ./bin/config set mysql.pass __password__",
pht( pht(
'These standard credentials are separate from any administrative '. 'These standard credentials are separate from any administrative '.
'credentials provided to this command with __%s__ or '. 'credentials provided to this command with __%s__ or '.

View file

@ -130,9 +130,9 @@ try {
if (!PhabricatorEnv::isClusterAddress($remote_address)) { if (!PhabricatorEnv::isClusterAddress($remote_address)) {
throw new Exception( throw new Exception(
pht( pht(
'This request originates from outside of the Phabricator cluster '. 'This request originates from outside of the cluster address range. '.
'address range. Requests signed with a trusted device key must '. 'Requests signed with a trusted device key must originate from '.
'originate from trusted hosts.')); 'trusted hosts.'));
} }
$device = id(new AlmanacDeviceQuery()) $device = id(new AlmanacDeviceQuery())
@ -228,7 +228,9 @@ try {
$command_list = implode(', ', $command_list); $command_list = implode(', ', $command_list);
$error_lines = array(); $error_lines = array();
$error_lines[] = pht('Welcome to Phabricator.'); $error_lines[] = pht(
'Welcome to %s.',
PlatformSymbols::getPlatformServerName());
$error_lines[] = pht( $error_lines[] = pht(
'You are logged in as %s.', 'You are logged in as %s.',
$user_name); $user_name);
@ -236,7 +238,7 @@ try {
if (!$original_argv) { if (!$original_argv) {
$error_lines[] = pht( $error_lines[] = pht(
'You have not specified a command to run. This means you are requesting '. 'You have not specified a command to run. This means you are requesting '.
'an interactive shell, but Phabricator does not provide interactive '. 'an interactive shell, but this server does not provide interactive '.
'shells over SSH.'); 'shells over SSH.');
$error_lines[] = pht( $error_lines[] = pht(
'(Usually, you should run a command like "git clone" or "hg push" '. '(Usually, you should run a command like "git clone" or "hg push" '.
@ -270,7 +272,7 @@ try {
if (empty($workflows[$command])) { if (empty($workflows[$command])) {
$error_lines[] = pht( $error_lines[] = pht(
'You have specified the command "%s", but that command is not '. 'You have specified the command "%s", but that command is not '.
'supported by Phabricator. As received by Phabricator, your entire '. 'supported by this server. As received by this server, your entire '.
'argument list was:', 'argument list was:',
$command); $command);

View file

@ -10,12 +10,12 @@ final class AlmanacClusterDatabaseServiceType
} }
public function getServiceTypeName() { public function getServiceTypeName() {
return pht('Phabricator Cluster: Database'); return pht('Cluster: Database');
} }
public function getServiceTypeDescription() { public function getServiceTypeDescription() {
return pht( return pht(
'Defines a database service for use in a Phabricator cluster.'); 'Defines a database service for use in a cluster.');
} }
} }

View file

@ -10,12 +10,12 @@ final class AlmanacClusterRepositoryServiceType
} }
public function getServiceTypeName() { public function getServiceTypeName() {
return pht('Phabricator Cluster: Repository'); return pht('Cluster: Repository');
} }
public function getServiceTypeDescription() { public function getServiceTypeDescription() {
return pht( return pht(
'Defines a repository service for use in a Phabricator cluster.'); 'Defines a repository service for use in a cluster.');
} }
public function getFieldSpecifications() { public function getFieldSpecifications() {

View file

@ -89,8 +89,7 @@ final class PhutilPhabricatorAuthAdapter extends PhutilOAuthAuthAdapter {
} catch (PhutilJSONParserException $ex) { } catch (PhutilJSONParserException $ex) {
throw new Exception( throw new Exception(
pht( pht(
'Expected valid JSON response from Phabricator %s request.', 'Expected valid JSON response from "user.whoami" request.'),
'user.whoami'),
$ex); $ex);
} }
} }

View file

@ -254,12 +254,16 @@ abstract class PhabricatorAuthController extends PhabricatorController {
} }
$invite_item = id(new PHUIObjectItemView()) $invite_item = id(new PHUIObjectItemView())
->setHeader(pht('Welcome to Phabricator!')) ->setHeader(
pht(
'Welcome to %s!',
PlatformSymbols::getPlatformServerName()))
->setImageURI($invite_author->getProfileImageURI()) ->setImageURI($invite_author->getProfileImageURI())
->addAttribute( ->addAttribute(
pht( pht(
'%s has invited you to join Phabricator.', '%s has invited you to join %s.',
$invite_author->getFullName())); $invite_author->getFullName(),
PlatformSymbols::getPlatformServerName()));
$invite_list = id(new PHUIObjectItemListView()) $invite_list = id(new PHUIObjectItemListView())
->addItem($invite_item) ->addItem($invite_item)

View file

@ -151,7 +151,9 @@ final class PhabricatorAuthOneTimeLoginController
switch ($link_type) { switch ($link_type) {
case PhabricatorAuthSessionEngine::ONETIME_WELCOME: case PhabricatorAuthSessionEngine::ONETIME_WELCOME:
$title = pht('Welcome to Phabricator'); $title = pht(
'Welcome to %s',
PlatformSymbols::getPlatformServerName());
break; break;
case PhabricatorAuthSessionEngine::ONETIME_RECOVER: case PhabricatorAuthSessionEngine::ONETIME_RECOVER:
$title = pht('Account Recovery'); $title = pht('Account Recovery');
@ -159,7 +161,9 @@ final class PhabricatorAuthOneTimeLoginController
case PhabricatorAuthSessionEngine::ONETIME_USERNAME: case PhabricatorAuthSessionEngine::ONETIME_USERNAME:
case PhabricatorAuthSessionEngine::ONETIME_RESET: case PhabricatorAuthSessionEngine::ONETIME_RESET:
default: default:
$title = pht('Log in to Phabricator'); $title = pht(
'Log in to %s',
PlatformSymbols::getPlatformServerName());
break; break;
} }

View file

@ -83,8 +83,8 @@ final class PhabricatorAuthRegisterController
if (!PhabricatorUserEmail::isValidAddress($default_email)) { if (!PhabricatorUserEmail::isValidAddress($default_email)) {
$errors[] = pht( $errors[] = pht(
'The email address associated with this external account ("%s") is '. 'The email address associated with this external account ("%s") is '.
'not a valid email address and can not be used to register a '. 'not a valid email address and can not be used to register an '.
'Phabricator account. Choose a different, valid address.', 'account. Choose a different, valid address.',
phutil_tag('strong', array(), $default_email)); phutil_tag('strong', array(), $default_email));
$default_email = null; $default_email = null;
} }
@ -102,8 +102,7 @@ final class PhabricatorAuthRegisterController
$errors[] = pht( $errors[] = pht(
'The email address associated with this account ("%s") is '. 'The email address associated with this account ("%s") is '.
'already in use by an application and can not be used to '. 'already in use by an application and can not be used to '.
'register a new Phabricator account. Choose a different, valid '. 'register a new account. Choose a different, valid address.',
'address.',
phutil_tag('strong', array(), $default_email)); phutil_tag('strong', array(), $default_email));
$default_email = null; $default_email = null;
} }
@ -122,8 +121,8 @@ final class PhabricatorAuthRegisterController
array( array(
pht( pht(
'The account you are attempting to register with has an invalid '. 'The account you are attempting to register with has an invalid '.
'email address (%s). This Phabricator install only allows '. 'email address (%s). This server only allows registration with '.
'registration with specific email addresses:', 'specific email addresses:',
$debug_email), $debug_email),
phutil_tag('br'), phutil_tag('br'),
phutil_tag('br'), phutil_tag('br'),
@ -157,16 +156,17 @@ final class PhabricatorAuthRegisterController
->addHiddenInput('phase', 1) ->addHiddenInput('phase', 1)
->appendParagraph( ->appendParagraph(
pht( pht(
'You are creating a new Phabricator account linked to an '. 'You are creating a new account linked to an existing '.
'existing external account from outside Phabricator.')) 'external account.'))
->appendParagraph( ->appendParagraph(
pht( pht(
'The email address ("%s") associated with the external account '. 'The email address ("%s") associated with the external account '.
'is already in use by an existing Phabricator account. Multiple '. 'is already in use by an existing %s account. Multiple '.
'Phabricator accounts may not have the same email address, so '. '%s accounts may not have the same email address, so '.
'you can not use this email address to register a new '. 'you can not use this email address to register a new account.',
'Phabricator account.', phutil_tag('strong', array(), $show_existing),
phutil_tag('strong', array(), $show_existing))) PlatformSymbols::getPlatformServerName(),
PlatformSymbols::getPlatformServerName()))
->appendParagraph( ->appendParagraph(
pht( pht(
'If you want to register a new account, continue with this '. 'If you want to register a new account, continue with this '.
@ -174,10 +174,11 @@ final class PhabricatorAuthRegisterController
'for the new account.')) 'for the new account.'))
->appendParagraph( ->appendParagraph(
pht( pht(
'If you want to link an existing Phabricator account to this '. 'If you want to link an existing %s account to this '.
'external account, do not continue. Instead: log in to your '. 'external account, do not continue. Instead: log in to your '.
'existing account, then go to "Settings" and link the account '. 'existing account, then go to "Settings" and link the account '.
'in the "External Accounts" panel.')) 'in the "External Accounts" panel.',
PlatformSymbols::getPlatformServerName()))
->appendParagraph( ->appendParagraph(
pht( pht(
'If you continue, you will create a new account. You will not '. 'If you continue, you will create a new account. You will not '.
@ -187,10 +188,10 @@ final class PhabricatorAuthRegisterController
} else { } else {
$errors[] = pht( $errors[] = pht(
'The external account you are registering with has an email address '. 'The external account you are registering with has an email address '.
'that is already in use ("%s") by an existing Phabricator account. '. 'that is already in use ("%s") by an existing %s account. '.
'Choose a new, valid email address to register a new Phabricator '. 'Choose a new, valid email address to register a new account.',
'account.', phutil_tag('strong', array(), $show_existing),
phutil_tag('strong', array(), $show_existing)); PlatformSymbols::getPlatformServerName());
} }
} }
@ -595,7 +596,9 @@ final class PhabricatorAuthRegisterController
if ($is_setup) { if ($is_setup) {
$crumbs->addTextCrumb(pht('Setup Admin Account')); $crumbs->addTextCrumb(pht('Setup Admin Account'));
$title = pht('Welcome to Phabricator'); $title = pht(
'Welcome to %s',
PlatformSymbols::getPlatformServerName());
} else { } else {
$crumbs->addTextCrumb(pht('Register')); $crumbs->addTextCrumb(pht('Register'));
$crumbs->addTextCrumb($provider->getProviderName()); $crumbs->addTextCrumb($provider->getProviderName());
@ -607,7 +610,10 @@ final class PhabricatorAuthRegisterController
if ($is_setup) { if ($is_setup) {
$welcome_view = id(new PHUIInfoView()) $welcome_view = id(new PHUIInfoView())
->setSeverity(PHUIInfoView::SEVERITY_NOTICE) ->setSeverity(PHUIInfoView::SEVERITY_NOTICE)
->setTitle(pht('Welcome to Phabricator')) ->setTitle(
pht(
'Welcome to %s',
PlatformSymbols::getPlatformServerName()))
->appendChild( ->appendChild(
pht( pht(
'Installation is complete. Register your administrator account '. 'Installation is complete. Register your administrator account '.
@ -710,8 +716,9 @@ final class PhabricatorAuthRegisterController
} }
private function sendWaitingForApprovalEmail(PhabricatorUser $user) { private function sendWaitingForApprovalEmail(PhabricatorUser $user) {
$title = '[Phabricator] '.pht( $title = pht(
'New User "%s" Awaiting Approval', '[%s] New User "%s" Awaiting Approval',
PlatformSymbols::getPlatformServerName(),
$user->getUsername()); $user->getUsername());
$body = new PhabricatorMetaMTAMailBody(); $body = new PhabricatorMetaMTAMailBody();

View file

@ -105,7 +105,7 @@ final class PhabricatorAuthSSHKeyGenerateController
'This workflow will generate a new SSH keypair, add the public '. 'This workflow will generate a new SSH keypair, add the public '.
'key, and let you download the private key.')) 'key, and let you download the private key.'))
->appendParagraph( ->appendParagraph(
pht('Phabricator will not retain a copy of the private key.')) pht('The private key will not be retained.'))
->addSubmitButton(pht('Generate New Keypair')) ->addSubmitButton(pht('Generate New Keypair'))
->addCancelButton($cancel_uri); ->addCancelButton($cancel_uri);
} catch (Exception $ex) { } catch (Exception $ex) {