mirror of
https://we.phorge.it/source/phorge.git
synced 2024-12-21 04:50:55 +01:00
Fix pht
method calls
Summary: Ref T7046. This is mainly a proof-of-concept for D11661. Test Plan: `arc lint` Reviewers: #blessed_reviewers, epriestley Reviewed By: #blessed_reviewers, epriestley Subscribers: Korvin, epriestley Maniphest Tasks: T7046 Differential Revision: https://secure.phabricator.com/D11680
This commit is contained in:
parent
c66954af26
commit
aaf8d73ec7
11 changed files with 35 additions and 56 deletions
|
@ -192,7 +192,7 @@ final class AlmanacManagementRegisterWorkflow
|
||||||
|
|
||||||
$console->writeOut(
|
$console->writeOut(
|
||||||
"%s\n",
|
"%s\n",
|
||||||
pht('Installing device ID...', $raw_device));
|
pht('Installing device %s...', $raw_device));
|
||||||
|
|
||||||
// The permissions on this file are more open because the webserver also
|
// The permissions on this file are more open because the webserver also
|
||||||
// needs to read it.
|
// needs to read it.
|
||||||
|
|
|
@ -6,7 +6,8 @@ final class ConduitMethodDoesNotExistException
|
||||||
public function __construct($method_name) {
|
public function __construct($method_name) {
|
||||||
parent::__construct(
|
parent::__construct(
|
||||||
pht(
|
pht(
|
||||||
'Conduit API method "%s" does not exist.'));
|
'Conduit API method "%s" does not exist.',
|
||||||
|
$method_name));
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -385,8 +385,8 @@ final class PhabricatorSetupIssueView extends AphrontView {
|
||||||
'p',
|
'p',
|
||||||
array(),
|
array(),
|
||||||
pht(
|
pht(
|
||||||
'PHP also loaded these configuration file(s):',
|
'PHP also loaded these %s configuration file(s):',
|
||||||
count($more_loc)));
|
new PhutilNumber(count($more_loc))));
|
||||||
$info[] = phutil_tag(
|
$info[] = phutil_tag(
|
||||||
'pre',
|
'pre',
|
||||||
array(),
|
array(),
|
||||||
|
|
|
@ -60,7 +60,7 @@ final class DifferentialHovercardEventListener
|
||||||
implode_selected_handle_links(', ', $handles, $reviewer_phids));
|
implode_selected_handle_links(', ', $handles, $reviewer_phids));
|
||||||
|
|
||||||
if ($tasks) {
|
if ($tasks) {
|
||||||
$hovercard->addField(pht('Task(s)', count($tasks)),
|
$hovercard->addField(pht('%s Task(s)', new PhutilNumber(count($tasks))),
|
||||||
implode_selected_handle_links(', ', $handles, $tasks));
|
implode_selected_handle_links(', ', $handles, $tasks));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -79,15 +79,15 @@ final class DifferentialCreateMailReceiver extends PhabricatorMailReceiver {
|
||||||
count($diffs));
|
count($diffs));
|
||||||
} else {
|
} else {
|
||||||
$subject = pht(
|
$subject = pht(
|
||||||
'Diff creation failed; see body for error(s).',
|
'Diff creation failed; see body for %s error(s).',
|
||||||
count($errors));
|
new PhutilNumber(count($errors)));
|
||||||
}
|
}
|
||||||
$body = new PhabricatorMetaMTAMailBody();
|
$body = new PhabricatorMetaMTAMailBody();
|
||||||
$body->addRawSection($subject);
|
$body->addRawSection($subject);
|
||||||
if (count($diffs)) {
|
if (count($diffs)) {
|
||||||
$text_body = '';
|
$text_body = '';
|
||||||
$html_body = array();
|
$html_body = array();
|
||||||
$body_label = pht('DIFF LINK(S)', count($diffs));
|
$body_label = pht('%s DIFF LINK(S)', new PhutilNumber(count($diffs)));
|
||||||
foreach ($diffs as $filename => $diff_uri) {
|
foreach ($diffs as $filename => $diff_uri) {
|
||||||
$text_body .= $filename.': '.$diff_uri."\n";
|
$text_body .= $filename.': '.$diff_uri."\n";
|
||||||
$html_body[] = phutil_tag(
|
$html_body[] = phutil_tag(
|
||||||
|
@ -104,7 +104,7 @@ final class DifferentialCreateMailReceiver extends PhabricatorMailReceiver {
|
||||||
|
|
||||||
if (count($errors)) {
|
if (count($errors)) {
|
||||||
$body_section = new PhabricatorMetaMTAMailSection();
|
$body_section = new PhabricatorMetaMTAMailSection();
|
||||||
$body_label = pht('ERROR(S)', count($errors));
|
$body_label = pht('%s ERROR(S)', new PhutilNumber(count($errors)));
|
||||||
foreach ($errors as $error) {
|
foreach ($errors as $error) {
|
||||||
$body_section->addFragment($error);
|
$body_section->addFragment($error);
|
||||||
}
|
}
|
||||||
|
|
|
@ -10,40 +10,27 @@ abstract class DifferentialChangesetHTMLRenderer
|
||||||
$file = $changeset->getFileType();
|
$file = $changeset->getFileType();
|
||||||
|
|
||||||
$messages = array();
|
$messages = array();
|
||||||
$none = hsprintf('');
|
|
||||||
switch ($change) {
|
switch ($change) {
|
||||||
|
|
||||||
case DifferentialChangeType::TYPE_ADD:
|
case DifferentialChangeType::TYPE_ADD:
|
||||||
switch ($file) {
|
switch ($file) {
|
||||||
case DifferentialChangeType::FILE_TEXT:
|
case DifferentialChangeType::FILE_TEXT:
|
||||||
$messages[] = pht(
|
$messages[] = pht('This file was added.');
|
||||||
'This file was <strong>added</strong>.',
|
|
||||||
$none);
|
|
||||||
break;
|
break;
|
||||||
case DifferentialChangeType::FILE_IMAGE:
|
case DifferentialChangeType::FILE_IMAGE:
|
||||||
$messages[] = pht(
|
$messages[] = pht('This image was added.');
|
||||||
'This image was <strong>added</strong>.',
|
|
||||||
$none);
|
|
||||||
break;
|
break;
|
||||||
case DifferentialChangeType::FILE_DIRECTORY:
|
case DifferentialChangeType::FILE_DIRECTORY:
|
||||||
$messages[] = pht(
|
$messages[] = pht('This directory was added.');
|
||||||
'This directory was <strong>added</strong>.',
|
|
||||||
$none);
|
|
||||||
break;
|
break;
|
||||||
case DifferentialChangeType::FILE_BINARY:
|
case DifferentialChangeType::FILE_BINARY:
|
||||||
$messages[] = pht(
|
$messages[] = pht('This binary file was added.');
|
||||||
'This binary file was <strong>added</strong>.',
|
|
||||||
$none);
|
|
||||||
break;
|
break;
|
||||||
case DifferentialChangeType::FILE_SYMLINK:
|
case DifferentialChangeType::FILE_SYMLINK:
|
||||||
$messages[] = pht(
|
$messages[] = pht('This symlink was added.');
|
||||||
'This symlink was <strong>added</strong>.',
|
|
||||||
$none);
|
|
||||||
break;
|
break;
|
||||||
case DifferentialChangeType::FILE_SUBMODULE:
|
case DifferentialChangeType::FILE_SUBMODULE:
|
||||||
$messages[] = pht(
|
$messages[] = pht('This submodule was added.');
|
||||||
'This submodule was <strong>added</strong>.',
|
|
||||||
$none);
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
@ -51,34 +38,22 @@ abstract class DifferentialChangesetHTMLRenderer
|
||||||
case DifferentialChangeType::TYPE_DELETE:
|
case DifferentialChangeType::TYPE_DELETE:
|
||||||
switch ($file) {
|
switch ($file) {
|
||||||
case DifferentialChangeType::FILE_TEXT:
|
case DifferentialChangeType::FILE_TEXT:
|
||||||
$messages[] = pht(
|
$messages[] = pht('This file was deleted.');
|
||||||
'This file was <strong>deleted</strong>.',
|
|
||||||
$none);
|
|
||||||
break;
|
break;
|
||||||
case DifferentialChangeType::FILE_IMAGE:
|
case DifferentialChangeType::FILE_IMAGE:
|
||||||
$messages[] = pht(
|
$messages[] = pht('This image was deleted.');
|
||||||
'This image was <strong>deleted</strong>.',
|
|
||||||
$none);
|
|
||||||
break;
|
break;
|
||||||
case DifferentialChangeType::FILE_DIRECTORY:
|
case DifferentialChangeType::FILE_DIRECTORY:
|
||||||
$messages[] = pht(
|
$messages[] = pht('This directory was deleted.');
|
||||||
'This directory was <strong>deleted</strong>.',
|
|
||||||
$none);
|
|
||||||
break;
|
break;
|
||||||
case DifferentialChangeType::FILE_BINARY:
|
case DifferentialChangeType::FILE_BINARY:
|
||||||
$messages[] = pht(
|
$messages[] = pht('This binary file was deleted.');
|
||||||
'This binary file was <strong>deleted</strong>.',
|
|
||||||
$none);
|
|
||||||
break;
|
break;
|
||||||
case DifferentialChangeType::FILE_SYMLINK:
|
case DifferentialChangeType::FILE_SYMLINK:
|
||||||
$messages[] = pht(
|
$messages[] = pht('This symlink was deleted.');
|
||||||
'This symlink was <strong>deleted</strong>.',
|
|
||||||
$none);
|
|
||||||
break;
|
break;
|
||||||
case DifferentialChangeType::FILE_SUBMODULE:
|
case DifferentialChangeType::FILE_SUBMODULE:
|
||||||
$messages[] = pht(
|
$messages[] = pht('This submodule was deleted.');
|
||||||
'This submodule was <strong>deleted</strong>.',
|
|
||||||
$none);
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -31,8 +31,7 @@ final class PhabricatorPeopleApproveController
|
||||||
|
|
||||||
$title = pht(
|
$title = pht(
|
||||||
'Phabricator Account "%s" Approved',
|
'Phabricator Account "%s" Approved',
|
||||||
$user->getUsername(),
|
$user->getUsername());
|
||||||
$admin->getUsername());
|
|
||||||
|
|
||||||
$body = pht(
|
$body = pht(
|
||||||
"Your Phabricator account (%s) has been approved by %s. You can ".
|
"Your Phabricator account (%s) has been approved by %s. You can ".
|
||||||
|
|
|
@ -52,7 +52,7 @@ final class PhabricatorRepositoryURINormalizer extends Phobject {
|
||||||
case self::TYPE_MERCURIAL:
|
case self::TYPE_MERCURIAL:
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
throw new Exception(pht('Unknown URI type "%s"!'));
|
throw new Exception(pht('Unknown URI type "%s"!', $type));
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->type = $type;
|
$this->type = $type;
|
||||||
|
|
|
@ -48,7 +48,9 @@ final class PhabricatorRepositoryManagementLookupUsersWorkflow
|
||||||
|
|
||||||
if (empty($refs_raw['data'])) {
|
if (empty($refs_raw['data'])) {
|
||||||
throw new Exception(
|
throw new Exception(
|
||||||
pht('Unable to retrieve details for commit "%s"!'));
|
pht(
|
||||||
|
'Unable to retrieve details for commit "%s"!',
|
||||||
|
$commit->getPHID()));
|
||||||
}
|
}
|
||||||
|
|
||||||
$ref = DiffusionCommitRef::newFromConduitResult(head($refs_raw['data']));
|
$ref = DiffusionCommitRef::newFromConduitResult(head($refs_raw['data']));
|
||||||
|
|
|
@ -17,9 +17,9 @@ abstract class PhabricatorBaseEnglishTranslation
|
||||||
'This configuration value is related:',
|
'This configuration value is related:',
|
||||||
'These configuration values are related:',
|
'These configuration values are related:',
|
||||||
),
|
),
|
||||||
'Task(s)' => array('Task', 'Tasks'),
|
'%s Task(s)' => array('Task', 'Tasks'),
|
||||||
|
|
||||||
'ERROR(S)' => array('ERROR', 'ERRORS'),
|
'%s ERROR(S)' => array('ERROR', 'ERRORS'),
|
||||||
'%d Error(s)' => array('%d Error', '%d Errors'),
|
'%d Error(s)' => array('%d Error', '%d Errors'),
|
||||||
'%d Warning(s)' => array('%d Warning', '%d Warnings'),
|
'%d Warning(s)' => array('%d Warning', '%d Warnings'),
|
||||||
'%d Auto-Fix(es)' => array('%d Auto-Fix', '%d Auto-Fixes'),
|
'%d Auto-Fix(es)' => array('%d Auto-Fix', '%d Auto-Fixes'),
|
||||||
|
@ -32,12 +32,12 @@ abstract class PhabricatorBaseEnglishTranslation
|
||||||
'%d path(s)' => array('%d path', '%d paths'),
|
'%d path(s)' => array('%d path', '%d paths'),
|
||||||
'%d diff(s)' => array('%d diff', '%d diffs'),
|
'%d diff(s)' => array('%d diff', '%d diffs'),
|
||||||
|
|
||||||
'DIFF LINK(S)' => array('DIFF LINK', 'DIFF LINKS'),
|
'%s DIFF LINK(S)' => array('DIFF LINK', 'DIFF LINKS'),
|
||||||
'You successfully created %d diff(s).' => array(
|
'You successfully created %d diff(s).' => array(
|
||||||
'You successfully created %d diff.',
|
'You successfully created %d diff.',
|
||||||
'You successfully created %d diffs.',
|
'You successfully created %d diffs.',
|
||||||
),
|
),
|
||||||
'Diff creation failed; see body for error(s).' => array(
|
'Diff creation failed; see body for %s error(s).' => array(
|
||||||
'Diff creation failed; see body for error.',
|
'Diff creation failed; see body for error.',
|
||||||
'Diff creation failed; see body for errors.',
|
'Diff creation failed; see body for errors.',
|
||||||
),
|
),
|
||||||
|
@ -499,7 +499,7 @@ abstract class PhabricatorBaseEnglishTranslation
|
||||||
'here:',
|
'here:',
|
||||||
),
|
),
|
||||||
|
|
||||||
'PHP also loaded these configuration file(s):' => array(
|
'PHP also loaded these %s configuration file(s):' => array(
|
||||||
'PHP also loaded this configuration file:',
|
'PHP also loaded this configuration file:',
|
||||||
'PHP also loaded these configuration files:',
|
'PHP also loaded these configuration files:',
|
||||||
),
|
),
|
||||||
|
|
|
@ -37,7 +37,9 @@ final class PhabricatorRemarkupCowsayBlockInterpreter
|
||||||
if ($err) {
|
if ($err) {
|
||||||
return $this->markupError(
|
return $this->markupError(
|
||||||
pht(
|
pht(
|
||||||
'Execution of `cowsay` failed:', $stderr));
|
'Execution of `%s` failed: %s',
|
||||||
|
'cowsay',
|
||||||
|
$stderr));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue