1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-10 00:42:41 +01:00

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

Summary: Ref T13658.

Test Plan:
This test plan is non-exhaustive.

  - Used Auth to start an "another copy of Phabricator" OAuth server workflow.

Maniphest Tasks: T13658

Differential Revision: https://secure.phabricator.com/D21766
This commit is contained in:
epriestley 2022-04-25 10:29:01 -07:00
parent 3e82ab5adb
commit b8b392481f
10 changed files with 44 additions and 43 deletions

View file

@ -44,7 +44,7 @@ final class PhabricatorEmailVerificationController
$title = pht('Address Already Verified');
$content = pht(
'This email address has already been verified.');
$continue = pht('Continue to Phabricator');
$continue = pht('Continue');
} else if ($request->isFormPost()) {
id(new PhabricatorUserEditor())
@ -55,7 +55,7 @@ final class PhabricatorEmailVerificationController
$content = pht(
'The email address %s is now verified.',
phutil_tag('strong', array(), $email->getAddress()));
$continue = pht('Continue to Phabricator');
$continue = pht('Continue');
} else {
$title = pht('Verify Email Address');
$content = pht(

View file

@ -39,7 +39,7 @@ final class PhabricatorAuthContactNumberTestController
->setSensitiveContent(false)
->setBody(
pht(
'This is a terse test text message from Phabricator (%s).',
'This is a terse test text message (from "%s").',
$uri->getDomain()))
->save();

View file

@ -133,7 +133,9 @@ final class PhabricatorDuoAuthFactor
->setTransactionType($xaction_usernames)
->setOptions(
array(
'username' => pht('Use Phabricator Username'),
'username' => pht(
'Use %s Username',
PlatformSymbols::getPlatformServerName()),
'email' => pht('Use Primary Email Address'),
)),
id(new PhabricatorSelectEditField())
@ -510,7 +512,7 @@ final class PhabricatorDuoAuthFactor
->setIsError(true)
->setErrorMessage(
pht(
'This factor has been removed from your device, so Phabricator '.
'This factor has been removed from your device, so this server '.
'can not send you a challenge. To continue, an administrator '.
'must strip this factor from your account.'));
}
@ -547,7 +549,7 @@ final class PhabricatorDuoAuthFactor
// The Duo push timeout is 60 seconds. Set our challenge to expire slightly
// more quickly so that we'll re-issue a new challenge before Duo times out.
// This should keep users away from a dead-end where they can't respond to
// Duo but Phabricator won't issue a new challenge yet.
// Duo but we won't issue a new challenge yet.
$ttl_seconds = 55;
return array(

View file

@ -388,7 +388,8 @@ final class PhabricatorSMSAuthFactor
->setSensitiveContent(true)
->setBody(
pht(
'Phabricator (%s) MFA Code: %s',
'%s (%s) MFA Code: %s',
PlatformSymbols::getPlatformServerName(),
$this->getInstallDisplayName(),
$envelope->openEnvelope()))
->save();

View file

@ -9,9 +9,9 @@ final class PhabricatorAuthManagementTrustOAuthClientWorkflow
->setExamples('**trust-oauth-client** [--id client_id]')
->setSynopsis(
pht(
'Set Phabricator to trust an OAuth client. Phabricator '.
'redirects to trusted OAuth clients that users have authorized '.
'without user intervention.'))
'Mark an OAuth client as trusted. Trusted OAuth clients may be '.
'reauthorized without requiring users to manually confirm the '.
'action.'))
->setArguments(
array(
array(
@ -28,8 +28,7 @@ final class PhabricatorAuthManagementTrustOAuthClientWorkflow
if (!$id) {
throw new PhutilArgumentUsageException(
pht(
'Specify an OAuth client id with %s.',
'--id'));
'Specify an OAuth client id with "--id".'));
}
$client = id(new PhabricatorOAuthServerClientQuery())
@ -46,7 +45,7 @@ final class PhabricatorAuthManagementTrustOAuthClientWorkflow
if ($client->getIsTrusted()) {
throw new PhutilArgumentUsageException(
pht(
'Phabricator already trusts OAuth client "%s".',
'OAuth client "%s" is already trusted.',
$client->getName()));
}
@ -57,7 +56,7 @@ final class PhabricatorAuthManagementTrustOAuthClientWorkflow
$console->writeOut(
"%s\n",
pht(
'Updated; Phabricator trusts OAuth client %s.',
'OAuth client "%s" is now trusted.',
$client->getName()));
}

View file

@ -9,9 +9,8 @@ final class PhabricatorAuthManagementUntrustOAuthClientWorkflow
->setExamples('**untrust-oauth-client** [--id client_id]')
->setSynopsis(
pht(
'Set Phabricator to not trust an OAuth client. Phabricator '.
'redirects to trusted OAuth clients that users have authorized '.
'without user intervention.'))
'Remove trust from an OAuth client. Users must manually confirm '.
'reauthorization of untrusted OAuth clients.'))
->setArguments(
array(
array(
@ -46,7 +45,7 @@ final class PhabricatorAuthManagementUntrustOAuthClientWorkflow
if (!$client->getIsTrusted()) {
throw new PhutilArgumentUsageException(
pht(
'Phabricator already does not trust OAuth client "%s".',
'OAuth client "%s" is already untrusted.',
$client->getName()));
}
@ -57,7 +56,7 @@ final class PhabricatorAuthManagementUntrustOAuthClientWorkflow
$console->writeOut(
"%s\n",
pht(
'Updated; Phabricator does not trust OAuth client %s.',
'OAuth client "%s" is now trusted.',
$client->getName()));
}

View file

@ -7,17 +7,16 @@ final class PhabricatorPhabricatorAuthProvider
const PROPERTY_PHABRICATOR_URI = 'oauth2:phabricator:uri';
public function getProviderName() {
return pht('Phabricator');
return PlatformSymbols::getPlatformServerName();
}
public function getConfigurationHelp() {
if ($this->isCreate()) {
return pht(
"**Step 1 of 2 - Name Phabricator OAuth Instance**\n\n".
'Choose a permanent name for the OAuth server instance of '.
'Phabricator. //This// instance of Phabricator uses this name '.
'internally to keep track of the OAuth server instance of '.
'Phabricator, in case the URL changes later.');
"**Step 1 of 2 - Name Remote Server**\n\n".
'Choose a permanent name for the remote server you want to connect '.
'to. This name is used internally to keep track of the remote '.
'server, in case the URL changes later.');
}
return parent::getConfigurationHelp();
@ -29,8 +28,8 @@ final class PhabricatorPhabricatorAuthProvider
$login_uri = PhabricatorEnv::getURI($this->getLoginURI());
return pht(
"**Step 2 of 2 - Configure Phabricator OAuth Instance**\n\n".
"To configure Phabricator OAuth, create a new application here:".
"**Step 2 of 2 - Configure OAuth Server**\n\n".
"To configure OAuth, create a new application here:".
"\n\n".
"%s/oauthserver/client/create/".
"\n\n".
@ -54,7 +53,7 @@ final class PhabricatorPhabricatorAuthProvider
}
protected function getLoginIcon() {
return 'Phabricator';
return PlatformSymbols::getPlatformServerName();
}
private function isCreate() {
@ -106,23 +105,23 @@ final class PhabricatorPhabricatorAuthProvider
$key_uri = self::PROPERTY_PHABRICATOR_URI;
if (!strlen($values[$key_name])) {
$errors[] = pht('Phabricator instance name is required.');
$errors[] = pht('Server name is required.');
$issues[$key_name] = pht('Required');
} else if (!preg_match('/^[a-z0-9.]+\z/', $values[$key_name])) {
$errors[] = pht(
'Phabricator instance name must contain only lowercase letters, '.
'Server name must contain only lowercase letters, '.
'digits, and periods.');
$issues[$key_name] = pht('Invalid');
}
if (!strlen($values[$key_uri])) {
$errors[] = pht('Phabricator base URI is required.');
$errors[] = pht('Base URI is required.');
$issues[$key_uri] = pht('Required');
} else {
$uri = new PhutilURI($values[$key_uri]);
if (!$uri->getProtocol()) {
$errors[] = pht(
'Phabricator base URI should include protocol (like "%s").',
'Base URI should include protocol (like "%s").',
'https://');
$issues[$key_uri] = pht('Invalid');
}
@ -161,7 +160,7 @@ final class PhabricatorPhabricatorAuthProvider
$form
->appendChild(
id(new AphrontFormTextControl())
->setLabel(pht('Phabricator Instance Name'))
->setLabel(pht('Server Name'))
->setValue($v_name)
->setName(self::PROPERTY_PHABRICATOR_NAME)
->setError($e_name)
@ -170,26 +169,25 @@ final class PhabricatorPhabricatorAuthProvider
phutil_tag(
'tt',
array(),
'`phabricator.oauthserver`'))));
'`example.oauthserver`'))));
} else {
$form
->appendChild(
id(new AphrontFormStaticControl())
->setLabel(pht('Phabricator Instance Name'))
->setLabel(pht('Server Name'))
->setValue($v_name));
}
$form
->appendChild(
id(new AphrontFormTextControl())
->setLabel(pht('Phabricator Base URI'))
->setLabel(pht('Base URI'))
->setValue($v_uri)
->setName(self::PROPERTY_PHABRICATOR_URI)
->setCaption(
pht(
'The URI where the OAuth server instance of Phabricator is '.
'installed. For example: %s',
phutil_tag('tt', array(), 'https://phabricator.mycompany.com/')))
'The URI where the OAuth server is installed. For example: %s',
phutil_tag('tt', array(), 'https://devtools.example.com/')))
->setError($e_uri));
if (!$is_setup) {

View file

@ -51,8 +51,10 @@ final class PhabricatorAuthInviteWorker
->setForceDelivery(true)
->setSubject(
pht(
'[Phabricator] %s has invited you to join Phabricator',
$author->getFullName()))
'[%s] %s has invited you to join %s',
PlatformSymbols::getPlatformServerName(),
$author->getFullName(),
PlatformSymbols::getPlatformServerName()))
->setBody($template)
->saveAndSend();
}

View file

@ -71,7 +71,7 @@ final class PhabricatorCalendarEventPolicyCodex
->setIsActive($object->isImportedEvent())
->setDescription(
pht(
'Imported events can not be edited in Phabricator.'));
'Imported events can not be edited.'));
return $rules;
}

View file

@ -31,7 +31,7 @@ final class PhabricatorConfigApplication extends PhabricatorApplication {
}
public function getShortDescription() {
return pht('Configure Phabricator');
return pht('Configure %s', PlatformSymbols::getPlatformServerName());
}
public function getRoutes() {