1
0
Fork 0
mirror of https://we.phorge.it/source/arcanist.git synced 2024-10-26 02:27:11 +02:00

Remove all product name literals in "pht()" in Arcanist

Summary:
Ref T13658. Remove all product name literals from "pht()" strings, by replacing them with generic text where that feels reasonably natural, or "PlatformSymbols" calls elsewhere.

These calls were identified with `arc lint --everything` after enabling the lint rule in D21763.

Test Plan: Read strings, ran "arc".

Maniphest Tasks: T13658

Differential Revision: https://secure.phabricator.com/D21764
This commit is contained in:
epriestley 2022-04-25 09:35:13 -07:00
parent a33aeb3c36
commit 93cf13cdb9
16 changed files with 83 additions and 77 deletions

View file

@ -68,7 +68,10 @@ $base_args->parsePartial(
array(
'name' => 'conduit-uri',
'param' => 'uri',
'help' => pht('Connect to Phabricator install specified by __uri__.'),
'help' => pht(
'Connect to the %s (or compatible software) server specified by '.
'__uri__.',
PlatformSymbols::getPlatformServerName()),
),
array(
'name' => 'conduit-token',
@ -85,7 +88,8 @@ $base_args->parsePartial(
'repeat' => true,
'help' => pht(
'Specify a runtime configuration value. This will take precedence '.
'over static values, and only affect the current arcanist invocation.'),
'over static values, and only affect the current process: the '.
'setting is not saved anywhere.'),
),
));
@ -310,9 +314,13 @@ try {
$message = phutil_console_format(
"%s\n\n - %s\n - %s\n - %s\n",
pht(
'This command requires arc to connect to a Phabricator install, '.
'but no Phabricator installation is configured. To configure a '.
'Phabricator URI:'),
'This command requires %s to connect to a %s (or compatible '.
'software) server, but no %s server is configured. To configure a '.
'%s server URI:',
PlatformSymbols::getPlatformClientName(),
PlatformSymbols::getPlatformServerName(),
PlatformSymbols::getPlatformServerName(),
PlatformSymbols::getPlatformServerName()),
pht(
'set a default location with `%s`; or',
'arc set-config default <uri>'),
@ -688,10 +696,12 @@ function arcanist_load_libraries(
"**<bg:yellow> %s </bg>** %s\n",
pht('VERY META'),
pht(
'You are running one copy of Arcanist (at path "%s") against '.
'another copy of Arcanist (at path "%s"). Code in the current '.
'You are running one copy of %s (at path "%s") against '.
'another copy of %s (at path "%s"). Code in the current '.
'working directory will not be loaded or executed.',
PlatformSymbols::getPlatformClientName(),
$executing_directory,
PlatformSymbols::getPlatformClientName(),
$working_directory)));
}
}

View file

@ -89,8 +89,8 @@ final class ArcanistConduitEngine
$block = id(new PhutilConsoleBlock())
->addParagraph(
pht(
'This command needs to communicate with Phabricator, but no '.
'Phabricator URI is configured.'))
'This command needs to communicate with a server, but no '.
'server URI is configured.'))
->addList($list);
throw new ArcanistUsageException($block->drawConsoleString());

View file

@ -71,10 +71,10 @@ final class ArcanistArcConfigurationEngineExtension
->setSummary(pht('Repository for the current working copy.'))
->setHelp(
pht(
'Associate the working copy with a specific Phabricator '.
'repository. Normally, Arcanist can figure this association '.
'out on its own, but if your setup is unusual you can use '.
'this option to tell it what the desired value is.'))
'Associate the working copy with a specific repository. Normally, '.
'this association can be determined automatically, but if your '.
'setup is unusual you can use this option to tell it what the '.
'desired value is.'))
->setExamples(
array(
'libexample',
@ -89,14 +89,15 @@ final class ArcanistArcConfigurationEngineExtension
'conduit_uri',
'default',
))
->setSummary(pht('Phabricator install to connect to.'))
->setSummary(pht('Server to connect to.'))
->setHelp(
pht(
'Associates this working copy with a specific installation of '.
'Phabricator.'))
'%s (or compatible software).',
PlatformSymbols::getPlatformServerName()))
->setExamples(
array(
'https://phabricator.mycompany.com/',
'https://devtools.example.com/',
)),
id(new ArcanistAliasesConfigOption())
->setKey(self::KEY_ALIASES)

View file

@ -15,7 +15,7 @@ final class ArcanistBlindlyTrustHTTPEngineExtension
}
public function getExtensionName() {
return pht('Arcanist HTTPS Trusted Domains');
return pht('HTTPS Trusted Domains');
}
public function shouldTrustAnySSLAuthorityForURI(PhutilURI $uri) {

View file

@ -42,12 +42,13 @@ final class PhutilEmailAddress extends Phobject {
public function __toString() {
$address = $this->getAddress();
if (strlen($this->displayName)) {
if (phutil_nonempty_string($this->displayName)) {
$display_name = $this->encodeDisplayName($this->displayName);
return $display_name.' <'.$address.'>';
} else {
return $address;
}
return $address;
}
public function setDisplayName($display_name) {

View file

@ -9,7 +9,7 @@ final class ArcanistArcToolset extends ArcanistToolset {
array(
'name' => 'conduit-uri',
'param' => 'uri',
'help' => pht('Connect to Phabricator install specified by __uri__.'),
'help' => pht('Connect to server specified by __uri__.'),
),
array(
'name' => 'conduit-token',

View file

@ -14,7 +14,7 @@ final class ArcanistShellCompleteWorkflow
public function getWorkflowInformation() {
$help = pht(<<<EOTEXT
Install shell completion so you can use the "tab" key to autocomplete
commands and flags in your shell for Arcanist toolsets and workflows.
commands and flags in your shell for toolsets and workflows.
The **bash** shell is supported.
@ -28,7 +28,7 @@ This will install shell completion into your current shell. After installing,
you may need to start a new shell (or open a new terminal window) to pick up
the updated configuration.
Once installed, completion should work across all Arcanist toolsets.
Once installed, completion should work across all toolsets.
**Using Completion**
@ -53,9 +53,9 @@ You can update shell completion without reinstalling it by running:
You may need to update shell completion if:
- you install new Arcanist toolsets; or
- you move the Arcanist directory; or
- you upgrade Arcanist and the new version fixes shell completion bugs.
- you install new toolsets; or
- you move this software on disk; or
- you upgrade this software and the new version fixes shell completion bugs.
EOTEXT
);

View file

@ -141,7 +141,7 @@ function phutil_format_units_generic(
$scale = array_shift($scales);
$label = array_shift($labels);
while ($n >= $scale && count($labels)) {
$remainder += ($n % $scale) * $accum;
$remainder += ((int)$n % $scale) * $accum;
$n /= $scale;
$accum *= $scale;
$label = array_shift($labels);

View file

@ -15,8 +15,7 @@ Allows you to make a raw Conduit method call:
- Call parameters are required, and read as a JSON blob from stdin.
- Results are written to stdout as a JSON blob.
This workflow is primarily useful for writing scripts which integrate
with Phabricator. Examples:
This workflow is primarily useful for writing scripts. Examples:
$ echo '{}' | arc call-conduit -- conduit.ping
$ echo '{"phid":"PHID-FILE-xxxx"}' | arc call-conduit -- file.download

View file

@ -115,8 +115,7 @@ EOTEXT
'raw' => array(
'help' => pht(
'Read diff from stdin, not from the working copy. This disables '.
'many Arcanist/Phabricator features which depend on having access '.
'to the working copy.'),
'many features which depend on having access to the working copy.'),
'conflicts' => array(
'apply-patches' => pht('%s disables lint.', '--raw'),
'never-apply-patches' => pht('%s disables lint.', '--raw'),
@ -138,8 +137,8 @@ EOTEXT
'param' => 'command',
'help' => pht(
'Generate diff by executing a specified command, not from the '.
'working copy. This disables many Arcanist/Phabricator features '.
'which depend on having access to the working copy.'),
'working copy. This disables many features which depend on having '.
'access to the working copy.'),
'conflicts' => array(
'apply-patches' => pht('%s disables lint.', '--raw-command'),
'never-apply-patches' => pht('%s disables lint.', '--raw-command'),
@ -326,9 +325,8 @@ EOTEXT
'head' => array(
'param' => 'commit',
'help' => pht(
'Specify the end of the commit range. This disables many '.
'Arcanist/Phabricator features which depend on having access to '.
'the working copy.'),
'Specify the end of the commit range. This disables many features '.
'which depend on having access to the working copy.'),
'supports' => array('git'),
'nosupport' => array(
'svn' => pht('Subversion does not support commit ranges.'),
@ -517,7 +515,7 @@ EOTEXT
if ($is_draft) {
throw new ArcanistUsageException(
pht(
'You have specified "--draft", but the version of Phabricator '.
'You have specified "--draft", but the software version '.
'on the server is too old to support draft revisions. Omit '.
'the flag or upgrade the server software.'));
}
@ -949,7 +947,7 @@ EOTEXT
} catch (ConduitClientException $e) {
if ($e->getErrorCode() == 'ERR-BAD-ARCANIST-PROJECT') {
echo phutil_console_wrap(
pht('Lookup of encoding in arcanist project failed: %s',
pht('Lookup of encoding in project failed: %s',
$e->getMessage())."\n");
} else {
throw $e;
@ -990,10 +988,10 @@ EOTEXT
'these files will be marked as binary.',
phutil_count($utf8_problems)),
pht(
"You can learn more about how Phabricator handles character ".
"You can learn more about how this software handles character ".
"encodings (and how to configure encoding settings and detect and ".
"correct encoding problems) by reading 'User Guide: UTF-8 and ".
"Character Encoding' in the Phabricator documentation."),
"Character Encoding' in the documentation."),
pht(
'%s AFFECTED FILE(S)',
phutil_count($utf8_problems)));
@ -2652,7 +2650,7 @@ EOTEXT
if (!$supported) {
$this->writeInfo(
pht('SKIP STAGING'),
pht('Phabricator does not support staging areas for this repository.'));
pht('The server does not support staging areas for this repository.'));
return self::STAGING_REPOSITORY_UNSUPPORTED;
}

View file

@ -19,12 +19,12 @@ EOTEXT
public function getCommandHelp() {
return phutil_console_format(<<<EOTEXT
Supports: http, https
Installs Conduit credentials into your ~/.arcrc for the given install
of Phabricator. You need to do this before you can use 'arc', as it
enables 'arc' to link your command-line activity with your account on
the web. Run this command from within a project directory to install
that project's certificate, or specify an explicit URI (like
"https://phabricator.example.com/").
Installs Conduit credentials into your ~/.arcrc for the given server.
You need to do this before you can use 'arc', as it enables 'arc' to
link your command-line activity with your account on the web. Run
this command from within a project directory to install that
project's certificate, or specify an explicit URI (like
"https://devtools.example.com/").
EOTEXT
);
}
@ -91,12 +91,11 @@ EOTEXT
// Ignore.
}
echo phutil_console_format("**%s**\n", pht('LOGIN TO PHABRICATOR'));
echo phutil_console_format("**%s**\n", pht('LOG IN'));
echo phutil_console_format(
"%s\n\n%s\n\n%s",
pht(
'Open this page in your browser and login to '.
'Phabricator if necessary:'),
'Open this page in your browser and log in if necessary:'),
$token_uri,
pht('Then paste the API Token on that page below.'));
@ -204,7 +203,7 @@ EOTEXT
$uri = $conduit_uri;
}
$example = 'https://phabricator.example.com/';
$example = 'https://devtools.example.com/';
$uri_object = new PhutilURI($uri);
$protocol = $uri_object->getProtocol();

View file

@ -11,13 +11,13 @@ final class ArcanistLiberateWorkflow
// TOOLSETS: Expand this help.
$help = pht(<<<EOTEXT
Create or update an Arcanist library.
Create or update a library.
EOTEXT
);
return $this->newWorkflowInformation()
->setSynopsis(
pht('Create or update an Arcanist library.'))
pht('Create or update a library.'))
->addExample(pht('**liberate**'))
->addExample(pht('**liberate** [__path__]'))
->setHelp($help);

View file

@ -9,12 +9,12 @@ final class ArcanistUpgradeWorkflow
public function getWorkflowInformation() {
$help = pht(<<<EOTEXT
Upgrade Arcanist to the latest version.
Upgrade this program to the latest version.
EOTEXT
);
return $this->newWorkflowInformation()
->setSynopsis(pht('Upgrade Arcanist to the latest version.'))
->setSynopsis(pht('Upgrade this program to the latest version.'))
->addExample(pht('**upgrade**'))
->setHelp($help);
}
@ -51,10 +51,10 @@ EOTEXT
if (!$is_git) {
throw new PhutilArgumentUsageException(
pht(
'The "arc upgrade" workflow uses "git pull" to upgrade '.
'Arcanist, but the "arcanist/" directory (in "%s") is not a Git '.
'working copy. You must leave "arcanist/" as a Git '.
'working copy to use "arc upgrade".',
'The "arc upgrade" workflow uses "git pull" to upgrade, but '.
'the "arcanist/" directory (in "%s") is not a Git working '.
'copy. You must leave "arcanist/" as a Git working copy to '.
'use "arc upgrade".',
$root));
}
@ -125,7 +125,7 @@ EOTEXT
$log->writeSuccess(
pht('UPGRADED'),
pht('Your copy of Arcanist is now up to date.'));
pht('This software is now up to date.'));
return 0;
}

View file

@ -9,7 +9,7 @@ final class ArcanistUploadWorkflow
public function getWorkflowInformation() {
$help = pht(<<<EOTEXT
Upload one or more files from local disk to Phabricator.
Upload one or more files from local disk.
EOTEXT
);

View file

@ -28,15 +28,15 @@ The __symbol__ may be a branch or bookmark name, a revision name (like "D123"),
a task name (like "T123"), or a new symbol.
If you provide a symbol which currently does not identify any ongoing work,
Arcanist will create a new branch or bookmark with the name you provide.
a new branch or bookmark will be created with the name you provide.
If you provide the name of an existing branch or bookmark, Arcanist will switch
to that branch or bookmark.
If you provide the name of an existing branch or bookmark, the working copy
will be switched to that branch or bookmark.
If you provide the name of a revision or task, Arcanist will look for a related
branch or bookmark that exists in the working copy. If it finds one, it will
switch to it. If it does not find one, it will attempt to create a new branch
or bookmark.
If you provide the name of a revision or task, the workflow will look for a
related branch or bookmark that already exists in the working copy. If one is
found, it will switch to it. If it does not find one, it will attempt to create
a new branch or bookmark.
When "arc work" creates a branch or bookmark, it will use **--start** as the
branchpoint if it is provided. Otherwise, the current working copy state will

View file

@ -534,7 +534,7 @@ abstract class ArcanistWorkflow extends Phobject {
$conduit_uri = $this->conduitURI;
$message = phutil_console_format(
"\n%s\n\n %s\n\n%s\n%s",
pht('YOU NEED TO __INSTALL A CERTIFICATE__ TO LOGIN TO PHABRICATOR'),
pht('YOU NEED TO __INSTALL A CERTIFICATE__ TO LOG IN'),
pht('To do this, run: **%s**', 'arc install-certificate'),
pht("The server '%s' rejected your request:", $conduit_uri),
$ex->getMessage());
@ -1957,11 +1957,10 @@ abstract class ArcanistWorkflow extends Phobject {
} catch (ConduitClientException $ex) {
if ($ex->getErrorCode() == 'ERR-CONDUIT-CALL') {
$reasons[] = pht(
'This version of Arcanist is more recent than the version of '.
'Phabricator you are connecting to: the Phabricator install is '.
'out of date and does not have support for identifying '.
'repositories by callsign or URI. Update Phabricator to enable '.
'these features.');
'This software version on the server you are connecting to is out '.
'of date and does not have support for identifying repositories '.
'by callsign or URI. Update the server sofwware to enable these '.
'features.');
return array(null, $reasons);
}
throw $ex;
@ -2204,9 +2203,8 @@ abstract class ArcanistWorkflow extends Phobject {
throw new ArcanistUsageException(
pht(
"Unable to find a browser command to run. Set '%s' in your ".
"Arcanist config to specify a command to use.",
'browser'));
'Unable to find a browser command to run. Set "browser" in your '.
'configuration to specify a command to use.'));
}