mirror of
https://we.phorge.it/source/phorge.git
synced 2024-12-23 05:50:55 +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:
parent
3e82ab5adb
commit
b8b392481f
10 changed files with 44 additions and 43 deletions
|
@ -44,7 +44,7 @@ final class PhabricatorEmailVerificationController
|
||||||
$title = pht('Address Already Verified');
|
$title = pht('Address Already Verified');
|
||||||
$content = pht(
|
$content = pht(
|
||||||
'This email address has already been verified.');
|
'This email address has already been verified.');
|
||||||
$continue = pht('Continue to Phabricator');
|
$continue = pht('Continue');
|
||||||
} else if ($request->isFormPost()) {
|
} else if ($request->isFormPost()) {
|
||||||
|
|
||||||
id(new PhabricatorUserEditor())
|
id(new PhabricatorUserEditor())
|
||||||
|
@ -55,7 +55,7 @@ final class PhabricatorEmailVerificationController
|
||||||
$content = pht(
|
$content = pht(
|
||||||
'The email address %s is now verified.',
|
'The email address %s is now verified.',
|
||||||
phutil_tag('strong', array(), $email->getAddress()));
|
phutil_tag('strong', array(), $email->getAddress()));
|
||||||
$continue = pht('Continue to Phabricator');
|
$continue = pht('Continue');
|
||||||
} else {
|
} else {
|
||||||
$title = pht('Verify Email Address');
|
$title = pht('Verify Email Address');
|
||||||
$content = pht(
|
$content = pht(
|
||||||
|
|
|
@ -39,7 +39,7 @@ final class PhabricatorAuthContactNumberTestController
|
||||||
->setSensitiveContent(false)
|
->setSensitiveContent(false)
|
||||||
->setBody(
|
->setBody(
|
||||||
pht(
|
pht(
|
||||||
'This is a terse test text message from Phabricator (%s).',
|
'This is a terse test text message (from "%s").',
|
||||||
$uri->getDomain()))
|
$uri->getDomain()))
|
||||||
->save();
|
->save();
|
||||||
|
|
||||||
|
|
|
@ -133,7 +133,9 @@ final class PhabricatorDuoAuthFactor
|
||||||
->setTransactionType($xaction_usernames)
|
->setTransactionType($xaction_usernames)
|
||||||
->setOptions(
|
->setOptions(
|
||||||
array(
|
array(
|
||||||
'username' => pht('Use Phabricator Username'),
|
'username' => pht(
|
||||||
|
'Use %s Username',
|
||||||
|
PlatformSymbols::getPlatformServerName()),
|
||||||
'email' => pht('Use Primary Email Address'),
|
'email' => pht('Use Primary Email Address'),
|
||||||
)),
|
)),
|
||||||
id(new PhabricatorSelectEditField())
|
id(new PhabricatorSelectEditField())
|
||||||
|
@ -510,7 +512,7 @@ final class PhabricatorDuoAuthFactor
|
||||||
->setIsError(true)
|
->setIsError(true)
|
||||||
->setErrorMessage(
|
->setErrorMessage(
|
||||||
pht(
|
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 '.
|
'can not send you a challenge. To continue, an administrator '.
|
||||||
'must strip this factor from your account.'));
|
'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
|
// 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.
|
// 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
|
// 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;
|
$ttl_seconds = 55;
|
||||||
|
|
||||||
return array(
|
return array(
|
||||||
|
|
|
@ -388,7 +388,8 @@ final class PhabricatorSMSAuthFactor
|
||||||
->setSensitiveContent(true)
|
->setSensitiveContent(true)
|
||||||
->setBody(
|
->setBody(
|
||||||
pht(
|
pht(
|
||||||
'Phabricator (%s) MFA Code: %s',
|
'%s (%s) MFA Code: %s',
|
||||||
|
PlatformSymbols::getPlatformServerName(),
|
||||||
$this->getInstallDisplayName(),
|
$this->getInstallDisplayName(),
|
||||||
$envelope->openEnvelope()))
|
$envelope->openEnvelope()))
|
||||||
->save();
|
->save();
|
||||||
|
|
|
@ -9,9 +9,9 @@ final class PhabricatorAuthManagementTrustOAuthClientWorkflow
|
||||||
->setExamples('**trust-oauth-client** [--id client_id]')
|
->setExamples('**trust-oauth-client** [--id client_id]')
|
||||||
->setSynopsis(
|
->setSynopsis(
|
||||||
pht(
|
pht(
|
||||||
'Set Phabricator to trust an OAuth client. Phabricator '.
|
'Mark an OAuth client as trusted. Trusted OAuth clients may be '.
|
||||||
'redirects to trusted OAuth clients that users have authorized '.
|
'reauthorized without requiring users to manually confirm the '.
|
||||||
'without user intervention.'))
|
'action.'))
|
||||||
->setArguments(
|
->setArguments(
|
||||||
array(
|
array(
|
||||||
array(
|
array(
|
||||||
|
@ -28,8 +28,7 @@ final class PhabricatorAuthManagementTrustOAuthClientWorkflow
|
||||||
if (!$id) {
|
if (!$id) {
|
||||||
throw new PhutilArgumentUsageException(
|
throw new PhutilArgumentUsageException(
|
||||||
pht(
|
pht(
|
||||||
'Specify an OAuth client id with %s.',
|
'Specify an OAuth client id with "--id".'));
|
||||||
'--id'));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$client = id(new PhabricatorOAuthServerClientQuery())
|
$client = id(new PhabricatorOAuthServerClientQuery())
|
||||||
|
@ -46,7 +45,7 @@ final class PhabricatorAuthManagementTrustOAuthClientWorkflow
|
||||||
if ($client->getIsTrusted()) {
|
if ($client->getIsTrusted()) {
|
||||||
throw new PhutilArgumentUsageException(
|
throw new PhutilArgumentUsageException(
|
||||||
pht(
|
pht(
|
||||||
'Phabricator already trusts OAuth client "%s".',
|
'OAuth client "%s" is already trusted.',
|
||||||
$client->getName()));
|
$client->getName()));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -57,7 +56,7 @@ final class PhabricatorAuthManagementTrustOAuthClientWorkflow
|
||||||
$console->writeOut(
|
$console->writeOut(
|
||||||
"%s\n",
|
"%s\n",
|
||||||
pht(
|
pht(
|
||||||
'Updated; Phabricator trusts OAuth client %s.',
|
'OAuth client "%s" is now trusted.',
|
||||||
$client->getName()));
|
$client->getName()));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -9,9 +9,8 @@ final class PhabricatorAuthManagementUntrustOAuthClientWorkflow
|
||||||
->setExamples('**untrust-oauth-client** [--id client_id]')
|
->setExamples('**untrust-oauth-client** [--id client_id]')
|
||||||
->setSynopsis(
|
->setSynopsis(
|
||||||
pht(
|
pht(
|
||||||
'Set Phabricator to not trust an OAuth client. Phabricator '.
|
'Remove trust from an OAuth client. Users must manually confirm '.
|
||||||
'redirects to trusted OAuth clients that users have authorized '.
|
'reauthorization of untrusted OAuth clients.'))
|
||||||
'without user intervention.'))
|
|
||||||
->setArguments(
|
->setArguments(
|
||||||
array(
|
array(
|
||||||
array(
|
array(
|
||||||
|
@ -46,7 +45,7 @@ final class PhabricatorAuthManagementUntrustOAuthClientWorkflow
|
||||||
if (!$client->getIsTrusted()) {
|
if (!$client->getIsTrusted()) {
|
||||||
throw new PhutilArgumentUsageException(
|
throw new PhutilArgumentUsageException(
|
||||||
pht(
|
pht(
|
||||||
'Phabricator already does not trust OAuth client "%s".',
|
'OAuth client "%s" is already untrusted.',
|
||||||
$client->getName()));
|
$client->getName()));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -57,7 +56,7 @@ final class PhabricatorAuthManagementUntrustOAuthClientWorkflow
|
||||||
$console->writeOut(
|
$console->writeOut(
|
||||||
"%s\n",
|
"%s\n",
|
||||||
pht(
|
pht(
|
||||||
'Updated; Phabricator does not trust OAuth client %s.',
|
'OAuth client "%s" is now trusted.',
|
||||||
$client->getName()));
|
$client->getName()));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -7,17 +7,16 @@ final class PhabricatorPhabricatorAuthProvider
|
||||||
const PROPERTY_PHABRICATOR_URI = 'oauth2:phabricator:uri';
|
const PROPERTY_PHABRICATOR_URI = 'oauth2:phabricator:uri';
|
||||||
|
|
||||||
public function getProviderName() {
|
public function getProviderName() {
|
||||||
return pht('Phabricator');
|
return PlatformSymbols::getPlatformServerName();
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getConfigurationHelp() {
|
public function getConfigurationHelp() {
|
||||||
if ($this->isCreate()) {
|
if ($this->isCreate()) {
|
||||||
return pht(
|
return pht(
|
||||||
"**Step 1 of 2 - Name Phabricator OAuth Instance**\n\n".
|
"**Step 1 of 2 - Name Remote Server**\n\n".
|
||||||
'Choose a permanent name for the OAuth server instance of '.
|
'Choose a permanent name for the remote server you want to connect '.
|
||||||
'Phabricator. //This// instance of Phabricator uses this name '.
|
'to. This name is used internally to keep track of the remote '.
|
||||||
'internally to keep track of the OAuth server instance of '.
|
'server, in case the URL changes later.');
|
||||||
'Phabricator, in case the URL changes later.');
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return parent::getConfigurationHelp();
|
return parent::getConfigurationHelp();
|
||||||
|
@ -29,8 +28,8 @@ final class PhabricatorPhabricatorAuthProvider
|
||||||
$login_uri = PhabricatorEnv::getURI($this->getLoginURI());
|
$login_uri = PhabricatorEnv::getURI($this->getLoginURI());
|
||||||
|
|
||||||
return pht(
|
return pht(
|
||||||
"**Step 2 of 2 - Configure Phabricator OAuth Instance**\n\n".
|
"**Step 2 of 2 - Configure OAuth Server**\n\n".
|
||||||
"To configure Phabricator OAuth, create a new application here:".
|
"To configure OAuth, create a new application here:".
|
||||||
"\n\n".
|
"\n\n".
|
||||||
"%s/oauthserver/client/create/".
|
"%s/oauthserver/client/create/".
|
||||||
"\n\n".
|
"\n\n".
|
||||||
|
@ -54,7 +53,7 @@ final class PhabricatorPhabricatorAuthProvider
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function getLoginIcon() {
|
protected function getLoginIcon() {
|
||||||
return 'Phabricator';
|
return PlatformSymbols::getPlatformServerName();
|
||||||
}
|
}
|
||||||
|
|
||||||
private function isCreate() {
|
private function isCreate() {
|
||||||
|
@ -106,23 +105,23 @@ final class PhabricatorPhabricatorAuthProvider
|
||||||
$key_uri = self::PROPERTY_PHABRICATOR_URI;
|
$key_uri = self::PROPERTY_PHABRICATOR_URI;
|
||||||
|
|
||||||
if (!strlen($values[$key_name])) {
|
if (!strlen($values[$key_name])) {
|
||||||
$errors[] = pht('Phabricator instance name is required.');
|
$errors[] = pht('Server name is required.');
|
||||||
$issues[$key_name] = pht('Required');
|
$issues[$key_name] = pht('Required');
|
||||||
} else if (!preg_match('/^[a-z0-9.]+\z/', $values[$key_name])) {
|
} else if (!preg_match('/^[a-z0-9.]+\z/', $values[$key_name])) {
|
||||||
$errors[] = pht(
|
$errors[] = pht(
|
||||||
'Phabricator instance name must contain only lowercase letters, '.
|
'Server name must contain only lowercase letters, '.
|
||||||
'digits, and periods.');
|
'digits, and periods.');
|
||||||
$issues[$key_name] = pht('Invalid');
|
$issues[$key_name] = pht('Invalid');
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!strlen($values[$key_uri])) {
|
if (!strlen($values[$key_uri])) {
|
||||||
$errors[] = pht('Phabricator base URI is required.');
|
$errors[] = pht('Base URI is required.');
|
||||||
$issues[$key_uri] = pht('Required');
|
$issues[$key_uri] = pht('Required');
|
||||||
} else {
|
} else {
|
||||||
$uri = new PhutilURI($values[$key_uri]);
|
$uri = new PhutilURI($values[$key_uri]);
|
||||||
if (!$uri->getProtocol()) {
|
if (!$uri->getProtocol()) {
|
||||||
$errors[] = pht(
|
$errors[] = pht(
|
||||||
'Phabricator base URI should include protocol (like "%s").',
|
'Base URI should include protocol (like "%s").',
|
||||||
'https://');
|
'https://');
|
||||||
$issues[$key_uri] = pht('Invalid');
|
$issues[$key_uri] = pht('Invalid');
|
||||||
}
|
}
|
||||||
|
@ -161,7 +160,7 @@ final class PhabricatorPhabricatorAuthProvider
|
||||||
$form
|
$form
|
||||||
->appendChild(
|
->appendChild(
|
||||||
id(new AphrontFormTextControl())
|
id(new AphrontFormTextControl())
|
||||||
->setLabel(pht('Phabricator Instance Name'))
|
->setLabel(pht('Server Name'))
|
||||||
->setValue($v_name)
|
->setValue($v_name)
|
||||||
->setName(self::PROPERTY_PHABRICATOR_NAME)
|
->setName(self::PROPERTY_PHABRICATOR_NAME)
|
||||||
->setError($e_name)
|
->setError($e_name)
|
||||||
|
@ -170,26 +169,25 @@ final class PhabricatorPhabricatorAuthProvider
|
||||||
phutil_tag(
|
phutil_tag(
|
||||||
'tt',
|
'tt',
|
||||||
array(),
|
array(),
|
||||||
'`phabricator.oauthserver`'))));
|
'`example.oauthserver`'))));
|
||||||
} else {
|
} else {
|
||||||
$form
|
$form
|
||||||
->appendChild(
|
->appendChild(
|
||||||
id(new AphrontFormStaticControl())
|
id(new AphrontFormStaticControl())
|
||||||
->setLabel(pht('Phabricator Instance Name'))
|
->setLabel(pht('Server Name'))
|
||||||
->setValue($v_name));
|
->setValue($v_name));
|
||||||
}
|
}
|
||||||
|
|
||||||
$form
|
$form
|
||||||
->appendChild(
|
->appendChild(
|
||||||
id(new AphrontFormTextControl())
|
id(new AphrontFormTextControl())
|
||||||
->setLabel(pht('Phabricator Base URI'))
|
->setLabel(pht('Base URI'))
|
||||||
->setValue($v_uri)
|
->setValue($v_uri)
|
||||||
->setName(self::PROPERTY_PHABRICATOR_URI)
|
->setName(self::PROPERTY_PHABRICATOR_URI)
|
||||||
->setCaption(
|
->setCaption(
|
||||||
pht(
|
pht(
|
||||||
'The URI where the OAuth server instance of Phabricator is '.
|
'The URI where the OAuth server is installed. For example: %s',
|
||||||
'installed. For example: %s',
|
phutil_tag('tt', array(), 'https://devtools.example.com/')))
|
||||||
phutil_tag('tt', array(), 'https://phabricator.mycompany.com/')))
|
|
||||||
->setError($e_uri));
|
->setError($e_uri));
|
||||||
|
|
||||||
if (!$is_setup) {
|
if (!$is_setup) {
|
||||||
|
|
|
@ -51,8 +51,10 @@ final class PhabricatorAuthInviteWorker
|
||||||
->setForceDelivery(true)
|
->setForceDelivery(true)
|
||||||
->setSubject(
|
->setSubject(
|
||||||
pht(
|
pht(
|
||||||
'[Phabricator] %s has invited you to join Phabricator',
|
'[%s] %s has invited you to join %s',
|
||||||
$author->getFullName()))
|
PlatformSymbols::getPlatformServerName(),
|
||||||
|
$author->getFullName(),
|
||||||
|
PlatformSymbols::getPlatformServerName()))
|
||||||
->setBody($template)
|
->setBody($template)
|
||||||
->saveAndSend();
|
->saveAndSend();
|
||||||
}
|
}
|
||||||
|
|
|
@ -71,7 +71,7 @@ final class PhabricatorCalendarEventPolicyCodex
|
||||||
->setIsActive($object->isImportedEvent())
|
->setIsActive($object->isImportedEvent())
|
||||||
->setDescription(
|
->setDescription(
|
||||||
pht(
|
pht(
|
||||||
'Imported events can not be edited in Phabricator.'));
|
'Imported events can not be edited.'));
|
||||||
|
|
||||||
return $rules;
|
return $rules;
|
||||||
}
|
}
|
||||||
|
|
|
@ -31,7 +31,7 @@ final class PhabricatorConfigApplication extends PhabricatorApplication {
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getShortDescription() {
|
public function getShortDescription() {
|
||||||
return pht('Configure Phabricator');
|
return pht('Configure %s', PlatformSymbols::getPlatformServerName());
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getRoutes() {
|
public function getRoutes() {
|
||||||
|
|
Loading…
Reference in a new issue