1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-12-22 05:20:56 +01: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
echo pht('Populating Phabricator files with mail keys xactions...')."\n";
echo pht('Populating files with mail keys...')."\n";
$table = new PhabricatorFile();
$table_name = $table->getTableName();

View file

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

View file

@ -130,9 +130,9 @@ try {
if (!PhabricatorEnv::isClusterAddress($remote_address)) {
throw new Exception(
pht(
'This request originates from outside of the Phabricator cluster '.
'address range. Requests signed with a trusted device key must '.
'originate from trusted hosts.'));
'This request originates from outside of the cluster address range. '.
'Requests signed with a trusted device key must originate from '.
'trusted hosts.'));
}
$device = id(new AlmanacDeviceQuery())
@ -228,7 +228,9 @@ try {
$command_list = implode(', ', $command_list);
$error_lines = array();
$error_lines[] = pht('Welcome to Phabricator.');
$error_lines[] = pht(
'Welcome to %s.',
PlatformSymbols::getPlatformServerName());
$error_lines[] = pht(
'You are logged in as %s.',
$user_name);
@ -236,7 +238,7 @@ try {
if (!$original_argv) {
$error_lines[] = pht(
'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.');
$error_lines[] = pht(
'(Usually, you should run a command like "git clone" or "hg push" '.
@ -270,7 +272,7 @@ try {
if (empty($workflows[$command])) {
$error_lines[] = pht(
'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:',
$command);

View file

@ -10,12 +10,12 @@ final class AlmanacClusterDatabaseServiceType
}
public function getServiceTypeName() {
return pht('Phabricator Cluster: Database');
return pht('Cluster: Database');
}
public function getServiceTypeDescription() {
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() {
return pht('Phabricator Cluster: Repository');
return pht('Cluster: Repository');
}
public function getServiceTypeDescription() {
return pht(
'Defines a repository service for use in a Phabricator cluster.');
'Defines a repository service for use in a cluster.');
}
public function getFieldSpecifications() {

View file

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

View file

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

View file

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

View file

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

View file

@ -105,7 +105,7 @@ final class PhabricatorAuthSSHKeyGenerateController
'This workflow will generate a new SSH keypair, add the public '.
'key, and let you download the private key.'))
->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'))
->addCancelButton($cancel_uri);
} catch (Exception $ex) {