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

Mark some strings for translation

Summary: Add some more `pht`izations.

Test Plan: Eyeball it.

Reviewers: epriestley, #blessed_reviewers

Reviewed By: epriestley, #blessed_reviewers

Subscribers: hach-que, Korvin, epriestley

Differential Revision: https://secure.phabricator.com/D13200
This commit is contained in:
Joshua Spence 2015-06-09 23:06:52 +10:00
parent 5397779ee2
commit f47e69c015
78 changed files with 181 additions and 151 deletions

View file

@ -1,7 +1,6 @@
<?php <?php
function phabricator_read_config_file($original_config) { function phabricator_read_config_file($original_config) {
$root = dirname(dirname(__FILE__)); $root = dirname(dirname(__FILE__));
// Accept either "myconfig" (preferred) or "myconfig.conf.php". // Accept either "myconfig" (preferred) or "myconfig.conf.php".
@ -9,7 +8,6 @@ function phabricator_read_config_file($original_config) {
$full_config_path = $root.'/conf/'.$config.'.conf.php'; $full_config_path = $root.'/conf/'.$config.'.conf.php';
if (!Filesystem::pathExists($full_config_path)) { if (!Filesystem::pathExists($full_config_path)) {
// These are very old configuration files which we used to ship with // These are very old configuration files which we used to ship with
// by default. File based configuration was de-emphasized once web-based // by default. File based configuration was de-emphasized once web-based
// configuration was built. The actual files were removed to reduce // configuration was built. The actual files were removed to reduce
@ -37,12 +35,14 @@ function phabricator_read_config_file($original_config) {
$file = trim($file, './'); $file = trim($file, './');
$files[$key] = preg_replace('/\.conf\.php$/', '', $file); $files[$key] = preg_replace('/\.conf\.php$/', '', $file);
} }
$files = " ".implode("\n ", $files); $files = ' '.implode("\n ", $files);
throw new Exception( throw new Exception(
"CONFIGURATION ERROR\n". pht(
"Config file '{$original_config}' does not exist. Valid config files ". "CONFIGURATION ERROR\n".
"are:\n\n".$files); "Config file '%s' does not exist. Valid config files are:\n\n%s",
$original_config,
$files));
} }
// Make sure config file errors are reported. // Make sure config file errors are reported.
@ -58,7 +58,11 @@ function phabricator_read_config_file($original_config) {
ini_set('display_errors', $old_display_errors); ini_set('display_errors', $old_display_errors);
if ($conf === false) { if ($conf === false) {
throw new Exception("Failed to read config file '{$config}': {$errors}"); throw new Exception(
pht(
"Failed to read config file '%s': %s",
$config,
$errors));
} }
return $conf; return $conf;

View file

@ -5,4 +5,4 @@
// already migrated, so this was cleaned up when ReleephRequestEvent was // already migrated, so this was cleaned up when ReleephRequestEvent was
// removed. // removed.
echo "(This migration is obsolete.)\n"; echo pht('(This migration is obsolete.)')."\n";

View file

@ -75,7 +75,9 @@ final class AphrontHTTPSinkTestCase extends PhabricatorTestCase {
$this->assertEqual( $this->assertEqual(
'for (;;);{"x":"\u003ciframe\u003e"}', 'for (;;);{"x":"\u003ciframe\u003e"}',
$sink->getEmittedData(), $sink->getEmittedData(),
'JSONResponse should prevent content-sniffing attacks.'); pht(
'%s should prevent content-sniffing attacks.',
'JSONResponse'));
} }

View file

@ -87,7 +87,7 @@ final class AlmanacBindingEditController
->appendControl( ->appendControl(
id(new AphrontFormTokenizerControl()) id(new AphrontFormTokenizerControl())
->setName('interfacePHIDs') ->setName('interfacePHIDs')
->setLabel('Interface') ->setLabel(pht('Interface'))
->setLimit(1) ->setLimit(1)
->setDatasource(new AlmanacInterfaceDatasource()) ->setDatasource(new AlmanacInterfaceDatasource())
->setValue($v_interface) ->setValue($v_interface)

View file

@ -38,7 +38,7 @@ final class AlmanacConsoleController extends AlmanacController {
$crumbs->addTextCrumb(pht('Console')); $crumbs->addTextCrumb(pht('Console'));
$box = id(new PHUIObjectBoxView()) $box = id(new PHUIObjectBoxView())
->setHeaderText('Console') ->setHeaderText(pht('Console'))
->appendChild($menu); ->appendChild($menu);
return $this->buildApplicationPage( return $this->buildApplicationPage(

View file

@ -44,7 +44,9 @@ final class PhabricatorAuditCommentEditor extends PhabricatorEditor {
return array( return array(
'diffusion-audit-'.$commit->getPHID(), 'diffusion-audit-'.$commit->getPHID(),
'Commit r'.$repository->getCallsign().$commit->getCommitIdentifier(), pht(
'Commit %s',
'r'.$repository->getCallsign().$commit->getCommitIdentifier()),
); );
} }

View file

@ -161,7 +161,7 @@ final class ConpherenceRoomTestCase extends ConpherenceTestCase {
->setNewValue(array('+' => $participant_phids)); ->setNewValue(array('+' => $participant_phids));
$xactions[] = id(new ConpherenceTransaction()) $xactions[] = id(new ConpherenceTransaction())
->setTransactionType(ConpherenceTransaction::TYPE_TITLE) ->setTransactionType(ConpherenceTransaction::TYPE_TITLE)
->setNewValue('Test'); ->setNewValue(pht('Test'));
id(new ConpherenceEditor()) id(new ConpherenceEditor())
->setActor($creator) ->setActor($creator)

View file

@ -160,8 +160,8 @@ final class ConpherenceThreadTestCase extends ConpherenceTestCase {
list($errors, $conpherence) = ConpherenceEditor::createThread( list($errors, $conpherence) = ConpherenceEditor::createThread(
$creator, $creator,
$participant_phids, $participant_phids,
'Test', pht('Test'),
'Test', pht('Test'),
PhabricatorContentSource::newConsoleSource()); PhabricatorContentSource::newConsoleSource());
return $conpherence; return $conpherence;
} }

View file

@ -190,7 +190,7 @@ final class DifferentialChangesetListView extends AphrontView {
} else { } else {
$detail->setAutoload(isset($this->visibleChangesets[$key])); $detail->setAutoload(isset($this->visibleChangesets[$key]));
if (isset($this->visibleChangesets[$key])) { if (isset($this->visibleChangesets[$key])) {
$load = 'Loading...'; $load = pht('Loading...');
} else { } else {
$load = javelin_tag( $load = javelin_tag(
'a', 'a',

View file

@ -78,7 +78,7 @@ final class DifferentialResultsTableView extends AphrontView {
'href' => '#', 'href' => '#',
'mustcapture' => true, 'mustcapture' => true,
), ),
'Hide'); pht('Hide'));
$rows[] = javelin_tag( $rows[] = javelin_tag(
'tr', 'tr',

View file

@ -36,15 +36,14 @@ final class DifferentialRevisionUpdateHistoryView extends AphrontView {
} }
public function render() { public function render() {
$this->requireResource('differential-core-view-css'); $this->requireResource('differential-core-view-css');
$this->requireResource('differential-revision-history-css'); $this->requireResource('differential-revision-history-css');
$data = array( $data = array(
array( array(
'name' => 'Base', 'name' => pht('Base'),
'id' => null, 'id' => null,
'desc' => 'Base', 'desc' => pht('Base'),
'age' => null, 'age' => null,
'obj' => null, 'obj' => null,
), ),
@ -53,7 +52,7 @@ final class DifferentialRevisionUpdateHistoryView extends AphrontView {
$seq = 0; $seq = 0;
foreach ($this->diffs as $diff) { foreach ($this->diffs as $diff) {
$data[] = array( $data[] = array(
'name' => 'Diff '.(++$seq), 'name' => pht('Diff %d', ++$seq),
'id' => $diff->getID(), 'id' => $diff->getID(),
'desc' => $diff->getDescription(), 'desc' => $diff->getDescription(),
'age' => $diff->getDateCreated(), 'age' => $diff->getDateCreated(),

View file

@ -116,7 +116,7 @@ final class DiffusionLintController extends DiffusionController {
->setValue($owners)) ->setValue($owners))
->appendChild( ->appendChild(
id(new AphrontFormSubmitControl()) id(new AphrontFormSubmitControl())
->setValue('Filter')); ->setValue(pht('Filter')));
$content[] = id(new AphrontListFilterView())->appendChild($form); $content[] = id(new AphrontListFilterView())->appendChild($form);
} }

View file

@ -181,7 +181,7 @@ final class DiffusionRepositoryEditHostingController
'%s: This repository is hosted elsewhere, so Phabricator can not '. '%s: This repository is hosted elsewhere, so Phabricator can not '.
'perform writes. This mode will act like "Read Only" for '. 'perform writes. This mode will act like "Read Only" for '.
'repositories hosted elsewhere.', 'repositories hosted elsewhere.',
phutil_tag('strong', array(), 'WARNING')), phutil_tag('strong', array(), pht('WARNING'))),
); );
} }

View file

@ -149,7 +149,7 @@ final class DiffusionHistoryTableView extends DiffusionView {
$summary = AphrontTableView::renderSingleDisplayLine( $summary = AphrontTableView::renderSingleDisplayLine(
$history->getSummary()); $history->getSummary());
} else { } else {
$summary = phutil_tag('em', array(), "Importing\xE2\x80\xA6"); $summary = phutil_tag('em', array(), pht("Importing\xE2\x80\xA6"));
} }
$build = null; $build = null;

View file

@ -29,8 +29,7 @@ final class DoorkeeperObjectRef extends Phobject {
public function getExternalObject() { public function getExternalObject() {
if (!$this->externalObject) { if (!$this->externalObject) {
throw new Exception( throw new PhutilInvalidStateException('attachExternalObject');
'Call attachExternalObject() before getExternalObject()!');
} }
return $this->externalObject; return $this->externalObject;
} }

View file

@ -155,7 +155,7 @@ abstract class DrydockBlueprintImplementation {
$resource->endReadLocking(); $resource->endReadLocking();
if ($allocated) { if ($allocated) {
$resource->saveTransaction(); $resource->saveTransaction();
$this->log('Allocated Lease'); $this->log(pht('Allocated Lease'));
} else { } else {
$resource->killTransaction(); $resource->killTransaction();
$this->log(pht('Failed to Allocate Lease')); $this->log(pht('Failed to Allocate Lease'));

View file

@ -80,7 +80,9 @@ final class DrydockWorkingCopyBlueprintImplementation
$this->log(pht('Complete.')); $this->log(pht('Complete.'));
$resource = $this->newResourceTemplate( $resource = $this->newResourceTemplate(
'Working Copy ('.$repository->getCallsign().')'); pht(
'Working Copy (%s)',
$repository->getCallsign()));
$resource->setStatus(DrydockResourceStatus::STATUS_OPEN); $resource->setStatus(DrydockResourceStatus::STATUS_OPEN);
$resource->setAttribute('lease.host', $host_lease->getID()); $resource->setAttribute('lease.host', $host_lease->getID());
$resource->setAttribute('path', $path); $resource->setAttribute('path', $path);

View file

@ -43,16 +43,16 @@ final class DrydockLogListView extends AphrontView {
$table->setDeviceReadyTable(true); $table->setDeviceReadyTable(true);
$table->setHeaders( $table->setHeaders(
array( array(
'Resource', pht('Resource'),
'Lease', pht('Lease'),
'Message', pht('Message'),
'Date', pht('Date'),
)); ));
$table->setShortHeaders( $table->setShortHeaders(
array( array(
'R', 'R',
'L', 'L',
'Message', pht('Message'),
'', '',
)); ));
$table->setColumnClasses( $table->setColumnClasses(

View file

@ -109,7 +109,7 @@ final class PhabricatorFactHomeController extends PhabricatorFactController {
->setUser($user) ->setUser($user)
->appendChild( ->appendChild(
id(new AphrontFormSelectControl()) id(new AphrontFormSelectControl())
->setLabel('Y-Axis') ->setLabel(pht('Y-Axis'))
->setName('y1') ->setName('y1')
->setOptions($options)) ->setOptions($options))
->appendChild( ->appendChild(

View file

@ -82,7 +82,7 @@ final class HarbormasterPlanRunController extends HarbormasterController {
$plan->getID())) $plan->getID()))
->appendChild( ->appendChild(
id(new AphrontFormTextControl()) id(new AphrontFormTextControl())
->setLabel('Buildable Name') ->setLabel(pht('Buildable Name'))
->setName('buildablePHID') ->setName('buildablePHID')
->setError($e_name) ->setError($e_name)
->setValue($v_name)); ->setValue($v_name));

View file

@ -183,9 +183,9 @@ final class HeraldTranscript extends HeraldDAO
public function getMetadataMap() { public function getMetadataMap() {
return array( return array(
'Run At Epoch' => date('F jS, g:i:s A', $this->time), pht('Run At Epoch') => date('F jS, g:i:s A', $this->time),
'Run On Host' => $this->host, pht('Run On Host') => $this->host,
'Run Duration' => (int)(1000 * $this->duration).' ms', pht('Run Duration') => (int)(1000 * $this->duration).' ms',
); );
} }

View file

@ -212,16 +212,16 @@ EOTEXT
$status_example = array( $status_example = array(
'open' => array( 'open' => array(
'name' => 'Open', 'name' => pht('Open'),
'special' => 'default', 'special' => 'default',
), ),
'closed' => array( 'closed' => array(
'name' => 'Closed', 'name' => pht('Closed'),
'special' => 'closed', 'special' => 'closed',
'closed' => true, 'closed' => true,
), ),
'duplicate' => array( 'duplicate' => array(
'name' => 'Duplicate', 'name' => pht('Duplicate'),
'special' => 'duplicate', 'special' => 'duplicate',
'closed' => true, 'closed' => true,
), ),

View file

@ -34,16 +34,16 @@ final class ManiphestTaskStatusTestCase extends PhabricatorTestCase {
$valid = array( $valid = array(
'open' => array( 'open' => array(
'name' => 'Open', 'name' => pht('Open'),
'special' => 'default', 'special' => 'default',
), ),
'closed' => array( 'closed' => array(
'name' => 'Closed', 'name' => pht('Closed'),
'special' => 'closed', 'special' => 'closed',
'closed' => true, 'closed' => true,
), ),
'duplicate' => array( 'duplicate' => array(
'name' => 'Duplicate', 'name' => pht('Duplicate'),
'special' => 'duplicate', 'special' => 'duplicate',
'closed' => true, 'closed' => true,
), ),
@ -52,7 +52,7 @@ final class ManiphestTaskStatusTestCase extends PhabricatorTestCase {
// We should raise on a bad key. // We should raise on a bad key.
$bad_key = $valid; $bad_key = $valid;
$bad_key['!'] = array('name' => 'Exclaim'); $bad_key['!'] = array('name' => pht('Exclaim'));
$this->assertConfigValid(false, pht('Bad Key'), $bad_key); $this->assertConfigValid(false, pht('Bad Key'), $bad_key);
// We should raise on a value type. // We should raise on a value type.
@ -68,7 +68,7 @@ final class ManiphestTaskStatusTestCase extends PhabricatorTestCase {
// We should raise on two statuses with the same special. // We should raise on two statuses with the same special.
$double_close = $valid; $double_close = $valid;
$double_close['finished'] = array( $double_close['finished'] = array(
'name' => 'Finished', 'name' => pht('Finished'),
'special' => 'closed', 'special' => 'closed',
'closed' => true, 'closed' => true,
); );

View file

@ -589,7 +589,7 @@ final class ManiphestReportController extends ManiphestController {
$cname[] = $label; $cname[] = $label;
$cclass[] = 'n'; $cclass[] = 'n';
} }
$cname[] = 'Total'; $cname[] = pht('Total');
$cclass[] = 'n'; $cclass[] = 'n';
$cname[] = javelin_tag( $cname[] = javelin_tag(
'span', 'span',

View file

@ -53,16 +53,16 @@ final class PhabricatorApplicationUninstallController
if ($this->action == 'install') { if ($this->action == 'install') {
if ($selected->canUninstall()) { if ($selected->canUninstall()) {
$dialog $dialog
->setTitle('Confirmation') ->setTitle(pht('Confirmation'))
->appendChild( ->appendChild(
pht( pht(
'Install %s application?', 'Install %s application?',
$selected->getName())) $selected->getName()))
->addSubmitButton('Install'); ->addSubmitButton(pht('Install'));
} else { } else {
$dialog $dialog
->setTitle('Information') ->setTitle(pht('Information'))
->appendChild(pht('You cannot install an installed application.')); ->appendChild(pht('You cannot install an installed application.'));
} }
} else { } else {

View file

@ -23,7 +23,7 @@ final class PhabricatorMetaMTAMailgunReceiveController
if (!$this->verifyMessage()) { if (!$this->verifyMessage()) {
throw new Exception( throw new Exception(
'Mail signature is not valid. Check your Mailgun API key.'); pht('Mail signature is not valid. Check your Mailgun API key.'));
} }
$request = $this->getRequest(); $request = $this->getRequest();

View file

@ -18,7 +18,7 @@ final class PhabricatorMailReceiverTestCase extends PhabricatorTestCase {
foreach ($same as $address) { foreach ($same as $address) {
$this->assertTrue( $this->assertTrue(
PhabricatorMailReceiver::matchAddresses($base, $address), PhabricatorMailReceiver::matchAddresses($base, $address),
"Address {$address}"); pht('Address %s', $address));
} }
$diff = array( $diff = array(

View file

@ -72,9 +72,9 @@ final class PhabricatorPeopleDatasource
} }
if ($this->enrichResults) { if ($this->enrichResults) {
$display_type = 'User'; $display_type = pht('User');
if ($user->getIsAdmin()) { if ($user->getIsAdmin()) {
$display_type = 'Administrator'; $display_type = pht('Administrator');
} }
$result->setDisplayType($display_type); $result->setDisplayType($display_type);
$result->setImageURI($handles[$user->getPHID()]->getImageURI()); $result->setImageURI($handles[$user->getPHID()]->getImageURI());

View file

@ -15,7 +15,7 @@ final class PhabricatorPhameApplication extends PhabricatorApplication {
} }
public function getShortDescription() { public function getShortDescription() {
return 'Blog'; return pht('Blog');
} }
public function getTitleGlyph() { public function getTitleGlyph() {

View file

@ -167,13 +167,13 @@ final class PhamePost extends PhameDAO
if ($current == 'facebook' || if ($current == 'facebook' ||
PhabricatorFacebookAuthProvider::getFacebookApplicationID()) { PhabricatorFacebookAuthProvider::getFacebookApplicationID()) {
$options['facebook'] = 'Facebook'; $options['facebook'] = pht('Facebook');
} }
if ($current == 'disqus' || if ($current == 'disqus' ||
PhabricatorEnv::getEnvConfig('disqus.shortname')) { PhabricatorEnv::getEnvConfig('disqus.shortname')) {
$options['disqus'] = 'Disqus'; $options['disqus'] = pht('Disqus');
} }
$options['none'] = 'None'; $options['none'] = pht('None');
return $options; return $options;
} }

View file

@ -93,7 +93,7 @@ final class PholioMockEditController extends PholioController {
$mock_xactions[$type_cc] = array('=' => $v_cc); $mock_xactions[$type_cc] = array('=' => $v_cc);
if (!strlen($request->getStr('name'))) { if (!strlen($request->getStr('name'))) {
$e_name = 'Required'; $e_name = pht('Required');
$errors[] = pht('You must give the mock a name.'); $errors[] = pht('You must give the mock a name.');
} }

View file

@ -17,7 +17,9 @@ final class PhortuneProductListController extends PhabricatorController {
$title = pht('Product List'); $title = pht('Product List');
$crumbs = $this->buildApplicationCrumbs(); $crumbs = $this->buildApplicationCrumbs();
$crumbs->addTextCrumb('Products', $this->getApplicationURI('product/')); $crumbs->addTextCrumb(
pht('Products'),
$this->getApplicationURI('product/'));
$crumbs->addAction( $crumbs->addAction(
id(new PHUIListItemView()) id(new PHUIListItemView())
->setName(pht('Create Product')) ->setName(pht('Create Product'))

View file

@ -44,12 +44,10 @@ final class PhortuneProviderActionController
return $response; return $response;
} }
$title = 'Phortune';
return $this->buildApplicationPage( return $this->buildApplicationPage(
$response, $response,
array( array(
'title' => $title, 'title' => pht('Phortune'),
)); ));
} }

View file

@ -41,7 +41,7 @@ final class PhabricatorXHPASTViewRunController
->setHeight(AphrontFormTextAreaControl::HEIGHT_VERY_TALL)) ->setHeight(AphrontFormTextAreaControl::HEIGHT_VERY_TALL))
->appendChild( ->appendChild(
id(new AphrontFormSubmitControl()) id(new AphrontFormSubmitControl())
->setValue('Parse')); ->setValue(pht('Parse')));
$form_box = id(new PHUIObjectBoxView()) $form_box = id(new PHUIObjectBoxView())
->setHeaderText(pht('Generate XHP AST')) ->setHeaderText(pht('Generate XHP AST'))

View file

@ -78,7 +78,7 @@ final class PhragmentBrowseController extends PhragmentController {
$item->addAttribute(pht('Deleted')); $item->addAttribute(pht('Deleted'));
} }
} else { } else {
$item->addAttribute('Directory'); $item->addAttribute(pht('Directory'));
} }
$list->addItem($item); $list->addItem($item);
} }

View file

@ -67,7 +67,7 @@ final class PhragmentHistoryController extends PhragmentController {
if ($version->getFilePHID() === null) { if ($version->getFilePHID() === null) {
$item->setDisabled(true); $item->setDisabled(true);
$item->addAttribute('Deletion'); $item->addAttribute(pht('Deletion'));
} }
if (!$first && $can_edit) { if (!$first && $can_edit) {

View file

@ -89,8 +89,8 @@ final class PhragmentSnapshotCreateController extends PhragmentController {
'tr', 'tr',
array(), array(),
array( array(
phutil_tag('th', array(), 'Fragment'), phutil_tag('th', array(), pht('Fragment')),
phutil_tag('th', array(), 'Version'), phutil_tag('th', array(), pht('Version')),
)); ));
$rows[] = phutil_tag( $rows[] = phutil_tag(
'tr', 'tr',

View file

@ -68,7 +68,7 @@ final class PhragmentZIPController extends PhragmentController {
} }
if (!$zip->open((string)$temp, ZipArchive::CREATE)) { if (!$zip->open((string)$temp, ZipArchive::CREATE)) {
throw new Exception('Unable to create ZIP archive!'); throw new Exception(pht('Unable to create ZIP archive!'));
} }
$mappings = $this->getFragmentMappings($fragment, $fragment->getPath()); $mappings = $this->getFragmentMappings($fragment, $fragment->getPath());

View file

@ -227,7 +227,7 @@ final class PhabricatorProjectEditorTestCase extends PhabricatorTestCase {
private function createProject(PhabricatorUser $user) { private function createProject(PhabricatorUser $user) {
$project = PhabricatorProject::initializeNewProject($user); $project = PhabricatorProject::initializeNewProject($user);
$project->setName('Test Project '.mt_rand()); $project->setName(pht('Test Project %d', mt_rand()));
$project->save(); $project->save();
return $project; return $project;
@ -247,7 +247,7 @@ final class PhabricatorProjectEditorTestCase extends PhabricatorTestCase {
$user = new PhabricatorUser(); $user = new PhabricatorUser();
$user->setUsername('unittestuser'.$rand); $user->setUsername('unittestuser'.$rand);
$user->setRealName('Unit Test User '.$rand); $user->setRealName(pht('Unit Test User %d', $rand));
return $user; return $user;
} }

View file

@ -64,7 +64,7 @@ final class PhabricatorProjectDatasource
$proj_result = id(new PhabricatorTypeaheadResult()) $proj_result = id(new PhabricatorTypeaheadResult())
->setName($all_strings) ->setName($all_strings)
->setDisplayName($proj->getName()) ->setDisplayName($proj->getName())
->setDisplayType('Project') ->setDisplayType(pht('Project'))
->setURI('/tag/'.$proj->getPrimarySlug().'/') ->setURI('/tag/'.$proj->getPrimarySlug().'/')
->setPHID($proj->getPHID()) ->setPHID($proj->getPHID())
->setIcon($proj->getIcon()) ->setIcon($proj->getIcon())

View file

@ -250,7 +250,7 @@ final class ReleephRequestEditController extends ReleephBranchController {
->addHiddenInput('requestIdentifierRaw', 'D'.$diff_rev_id) ->addHiddenInput('requestIdentifierRaw', 'D'.$diff_rev_id)
->appendChild( ->appendChild(
id(new AphrontFormStaticControl()) id(new AphrontFormStaticControl())
->setLabel('Diff') ->setLabel(pht('Diff'))
->setValue($title)); ->setValue($title));
} else { } else {
$origin = $branch->getURI(); $origin = $branch->getURI();

View file

@ -51,7 +51,7 @@ final class DifferentialReleephRequestFieldSpecification {
} }
public function renderLabelForRevisionView() { public function renderLabelForRevisionView() {
return 'Releeph'; return pht('Releeph');
} }
public function getRequiredHandlePHIDs() { public function getRequiredHandlePHIDs() {
@ -246,7 +246,7 @@ final class DifferentialReleephRequestFieldSpecification {
} }
public function renderLabelForCommitMessage() { public function renderLabelForCommitMessage() {
return 'Releeph'; return pht('Releeph');
} }
public function shouldAppearOnCommitMessageTemplate() { public function shouldAppearOnCommitMessageTemplate() {

View file

@ -8,7 +8,7 @@ final class ReleephAuthorFieldSpecification
} }
public function getName() { public function getName() {
return 'Author'; return pht('Author');
} }
public function getRequiredHandlePHIDsForPropertyView() { public function getRequiredHandlePHIDsForPropertyView() {

View file

@ -8,7 +8,7 @@ final class ReleephBranchCommitFieldSpecification
} }
public function getName() { public function getName() {
return 'Commit'; return pht('Commit');
} }
public function getRequiredHandlePHIDsForPropertyView() { public function getRequiredHandlePHIDsForPropertyView() {

View file

@ -8,7 +8,7 @@ final class ReleephDiffMessageFieldSpecification
} }
public function getName() { public function getName() {
return 'Message'; return pht('Message');
} }
public function getStyleForPropertyView() { public function getStyleForPropertyView() {

View file

@ -8,7 +8,7 @@ final class ReleephIntentFieldSpecification
} }
public function getName() { public function getName() {
return 'Intent'; return pht('Intent');
} }
public function getRequiredHandlePHIDsForPropertyView() { public function getRequiredHandlePHIDsForPropertyView() {

View file

@ -37,7 +37,7 @@ abstract class ReleephLevelFieldSpecification
} }
$control = id(new AphrontFormRadioButtonControl()) $control = id(new AphrontFormRadioButtonControl())
->setLabel('Level') ->setLabel(pht('Level'))
->setName($control_name) ->setName($control_name)
->setValue($level); ->setValue($level);
@ -75,7 +75,7 @@ abstract class ReleephLevelFieldSpecification
public function validate($value) { public function validate($value) {
if ($value === null) { if ($value === null) {
$this->error = 'Required'; $this->error = pht('Required');
$label = $this->getName(); $label = $this->getName();
throw new ReleephFieldParseException( throw new ReleephFieldParseException(
$this, $this,

View file

@ -8,7 +8,7 @@ final class ReleephOriginalCommitFieldSpecification
} }
public function getName() { public function getName() {
return 'Commit'; return pht('Commit');
} }
public function getRequiredHandlePHIDsForPropertyView() { public function getRequiredHandlePHIDsForPropertyView() {

View file

@ -44,7 +44,7 @@ final class ReleephReasonFieldSpecification
public function validate($reason) { public function validate($reason) {
if (!$reason) { if (!$reason) {
$this->error = 'Required'; $this->error = pht('Required');
throw new ReleephFieldParseException( throw new ReleephFieldParseException(
$this, $this,
pht('You must give a reason for your request.')); pht('You must give a reason for your request.'));
@ -53,8 +53,8 @@ final class ReleephReasonFieldSpecification
public function renderHelpForArcanist() { public function renderHelpForArcanist() {
$text = pht( $text = pht(
"Fully explain why you are requesting this code be included ". 'Fully explain why you are requesting this code be included '.
"in the next release.\n"); 'in the next release.')."\n";
return phutil_console_wrap($text, 8); return phutil_console_wrap($text, 8);
} }

View file

@ -11,7 +11,7 @@ final class ReleephSeverityFieldSpecification
} }
public function getName() { public function getName() {
return 'Severity'; return pht('Severity');
} }
public function getStorageKey() { public function getStorageKey() {

View file

@ -14,7 +14,7 @@ final class ReleephSummaryFieldSpecification
} }
public function getName() { public function getName() {
return 'Summary'; return pht('Summary');
} }
public function getStorageKey() { public function getStorageKey() {
@ -25,7 +25,7 @@ final class ReleephSummaryFieldSpecification
public function renderEditControl(array $handles) { public function renderEditControl(array $handles) {
return id(new AphrontFormTextControl()) return id(new AphrontFormTextControl())
->setLabel('Summary') ->setLabel(pht('Summary'))
->setName('summary') ->setName('summary')
->setError($this->error) ->setError($this->error)
->setValue($this->getValue()) ->setValue($this->getValue())

View file

@ -157,11 +157,11 @@ final class ReleephRequestSearchEngine
if (ReleephDefaultFieldSelector::isFacebook()) { if (ReleephDefaultFieldSelector::isFacebook()) {
return array( return array(
'' => pht('(All Severities)'), '' => pht('(All Severities)'),
11 => 'HOTFIX', 11 => pht('HOTFIX'),
12 => 'PIGGYBACK', 12 => pht('PIGGYBACK'),
13 => 'RELEASE', 13 => pht('RELEASE'),
14 => 'DAILY', 14 => pht('DAILY'),
15 => 'PARKING', 15 => pht('PARKING'),
); );
} else { } else {
return array( return array(

View file

@ -18,7 +18,7 @@ final class PhabricatorRepositoryType {
public static function getNameForRepositoryType($type) { public static function getNameForRepositoryType($type) {
$map = self::getAllRepositoryTypes(); $map = self::getAllRepositoryTypes();
return idx($map, $type, 'Unknown'); return idx($map, $type, pht('Unknown'));
} }
} }

View file

@ -100,7 +100,10 @@ final class PhabricatorMercurialGraphStream
} }
throw new Exception( throw new Exception(
"No such {$until_type} '{$until_name}' in repository!"); pht(
"No such %s '%s' in repository!",
$until_type,
$until_name));
} }

View file

@ -68,7 +68,10 @@ abstract class PhabricatorRepositoryEngine {
$matches = null; $matches = null;
if (!preg_match('/^\s*Fetch URL:\s*(.*?)\s*$/m', $remotes, $matches)) { if (!preg_match('/^\s*Fetch URL:\s*(.*?)\s*$/m', $remotes, $matches)) {
throw new Exception( throw new Exception(
"Expected 'Fetch URL' in 'git remote show -n origin'."); pht(
"Expected '%s' in '%s'.",
'Fetch URL',
'git remote show -n origin'));
} }
$remote_uri = $matches[1]; $remote_uri = $matches[1];

View file

@ -60,16 +60,16 @@ final class PhabricatorRepositoryManagementImportingWorkflow
$status = $row['importStatus']; $status = $row['importStatus'];
$need = array(); $need = array();
if (!($status & PhabricatorRepositoryCommit::IMPORTED_MESSAGE)) { if (!($status & PhabricatorRepositoryCommit::IMPORTED_MESSAGE)) {
$need[] = 'Message'; $need[] = pht('Message');
} }
if (!($status & PhabricatorRepositoryCommit::IMPORTED_CHANGE)) { if (!($status & PhabricatorRepositoryCommit::IMPORTED_CHANGE)) {
$need[] = 'Change'; $need[] = pht('Change');
} }
if (!($status & PhabricatorRepositoryCommit::IMPORTED_OWNERS)) { if (!($status & PhabricatorRepositoryCommit::IMPORTED_OWNERS)) {
$need[] = 'Owners'; $need[] = pht('Owners');
} }
if (!($status & PhabricatorRepositoryCommit::IMPORTED_HERALD)) { if (!($status & PhabricatorRepositoryCommit::IMPORTED_HERALD)) {
$need[] = 'Herald'; $need[] = pht('Herald');
} }
$console->writeOut(' %s', implode(', ', $need)); $console->writeOut(' %s', implode(', ', $need));

View file

@ -27,7 +27,7 @@ final class PhabricatorRepositoryURITestCase
$repo = PhabricatorRepository::initializeNewRepository($user) $repo = PhabricatorRepository::initializeNewRepository($user)
->setVersionControlSystem($svn) ->setVersionControlSystem($svn)
->setName('Test Repo') ->setName(pht('Test Repo'))
->setCallsign('TESTREPO') ->setCallsign('TESTREPO')
->setCredentialPHID($http_credential->getPHID()) ->setCredentialPHID($http_credential->getPHID())
->save(); ->save();

View file

@ -15,7 +15,7 @@ final class PhabricatorApplicationTransactionNoEffectException
$this->hasComment = $has_comment; $this->hasComment = $has_comment;
$message = array(); $message = array();
$message[] = 'Transactions have no effect:'; $message[] = pht('Transactions have no effect:');
foreach ($this->transactions as $transaction) { foreach ($this->transactions as $transaction) {
$message[] = ' - '.$transaction->getNoEffectDescription(); $message[] = ' - '.$transaction->getNoEffectDescription();
} }

View file

@ -96,8 +96,8 @@ final class PHUITimelineExample extends PhabricatorUIExample {
$events[] = id(new PHUITimelineEventView()) $events[] = id(new PHUITimelineEventView())
->setUserHandle($handle) ->setUserHandle($handle)
->setIcon('fa-tag') ->setIcon('fa-tag')
->setTitle(str_repeat('Long Text Title ', 64)) ->setTitle(str_repeat(pht('Long Text Title').' ', 64))
->appendChild(str_repeat('Long Text Body ', 64)) ->appendChild(str_repeat(pht('Long Text Body').' ', 64))
->setColor(PhabricatorTransactions::COLOR_ORANGE); ->setColor(PhabricatorTransactions::COLOR_ORANGE);
$events[] = id(new PHUITimelineEventView()) $events[] = id(new PHUITimelineEventView())

View file

@ -53,7 +53,7 @@ final class PhabricatorAphrontBarUIExample extends PhabricatorUIExample {
} }
return $this->wrap( return $this->wrap(
'Glyph bars in weird order', pht('Glyph bars in weird order'),
$views); $views);
} }
@ -61,12 +61,13 @@ final class PhabricatorAphrontBarUIExample extends PhabricatorUIExample {
$bar = id(new AphrontGlyphBarView()) $bar = id(new AphrontGlyphBarView())
->setValue(50) ->setValue(50)
->setMax(100) ->setMax(100)
->setCaption('Glyphs!') ->setCaption(pht('Glyphs!'))
->setNumGlyphs(10) ->setNumGlyphs(10)
->setGlyph(hsprintf('%s', '*')); ->setGlyph(hsprintf('%s', '*'));
return $this->wrap( return $this->wrap(
'Ascii star glyph bar', $bar); pht('ASCII star glyph bar'),
$bar);
} }
} }

View file

@ -22,28 +22,28 @@ final class PhabricatorPagedFormUIExample extends PhabricatorUIExample {
->addControl( ->addControl(
id(new AphrontFormTextControl()) id(new AphrontFormTextControl())
->setName('page1') ->setName('page1')
->setLabel('Page 1')); ->setLabel(pht('Page 1')));
$page2 = id(new PHUIFormPageView()) $page2 = id(new PHUIFormPageView())
->setPageName(pht('Page 2')) ->setPageName(pht('Page 2'))
->addControl( ->addControl(
id(new AphrontFormTextControl()) id(new AphrontFormTextControl())
->setName('page2') ->setName('page2')
->setLabel('Page 2')); ->setLabel(pht('Page 2')));
$page3 = id(new PHUIFormPageView()) $page3 = id(new PHUIFormPageView())
->setPageName(pht('Page 3')) ->setPageName(pht('Page 3'))
->addControl( ->addControl(
id(new AphrontFormTextControl()) id(new AphrontFormTextControl())
->setName('page3') ->setName('page3')
->setLabel('Page 3')); ->setLabel(pht('Page 3')));
$page4 = id(new PHUIFormPageView()) $page4 = id(new PHUIFormPageView())
->setPageName(pht('Page 4')) ->setPageName(pht('Page 4'))
->addControl( ->addControl(
id(new AphrontFormTextControl()) id(new AphrontFormTextControl())
->setName('page4') ->setName('page4')
->setLabel('Page 4')); ->setLabel(pht('Page 4')));
$form = new PHUIPagedFormView(); $form = new PHUIPagedFormView();
$form->setUser($user); $form->setUser($user);

View file

@ -23,7 +23,7 @@ final class PhabricatorPagerUIExample extends PhabricatorUIExample {
$rows = array(); $rows = array();
for ($ii = $offset; $ii < min($item_count, $offset + $page_size); $ii++) { for ($ii = $offset; $ii < min($item_count, $offset + $page_size); $ii++) {
$rows[] = array( $rows[] = array(
'Item #'.($ii + 1), pht('Item #%d', $ii + 1),
); );
} }

View file

@ -18,28 +18,28 @@ final class PhabricatorSortTableUIExample extends PhabricatorUIExample {
'model' => 'Civic', 'model' => 'Civic',
'year' => 2004, 'year' => 2004,
'price' => 3199, 'price' => 3199,
'color' => 'Blue', 'color' => pht('Blue'),
), ),
array( array(
'make' => 'Ford', 'make' => 'Ford',
'model' => 'Focus', 'model' => 'Focus',
'year' => 2001, 'year' => 2001,
'price' => 2549, 'price' => 2549,
'color' => 'Red', 'color' => pht('Red'),
), ),
array( array(
'make' => 'Toyota', 'make' => 'Toyota',
'model' => 'Camry', 'model' => 'Camry',
'year' => 2009, 'year' => 2009,
'price' => 4299, 'price' => 4299,
'color' => 'Black', 'color' => pht('Black'),
), ),
array( array(
'make' => 'NASA', 'make' => 'NASA',
'model' => 'Shuttle', 'model' => 'Shuttle',
'year' => 1998, 'year' => 1998,
'price' => 1000000000, 'price' => 1000000000,
'color' => 'White', 'color' => pht('White'),
), ),
); );

View file

@ -5,7 +5,7 @@ abstract class PhabricatorXHProfController extends PhabricatorController {
public function buildStandardPageResponse($view, array $data) { public function buildStandardPageResponse($view, array $data) {
$page = $this->buildStandardPageView(); $page = $this->buildStandardPageView();
$page->setApplicationName('XHProf'); $page->setApplicationName(pht('XHProf'));
$page->setBaseURI('/xhprof/'); $page->setBaseURI('/xhprof/');
$page->setTitle(idx($data, 'title')); $page->setTitle(idx($data, 'title'));
$page->setGlyph("\xE2\x98\x84"); $page->setGlyph("\xE2\x98\x84");

View file

@ -17,7 +17,7 @@ abstract class PhabricatorEditor extends Phobject {
final public function requireActor() { final public function requireActor() {
$actor = $this->getActor(); $actor = $this->getActor();
if (!$actor) { if (!$actor) {
throw new Exception('You must setActor()!'); throw new PhutilInvalidStateException('setActor');
} }
return $actor; return $actor;
} }

View file

@ -15,12 +15,14 @@ final class PhabricatorCustomFieldImplementationIncompleteException
$name = $field->getFieldName(); $name = $field->getFieldName();
} }
$class = get_class($field);
parent::__construct( parent::__construct(
"Custom field '{$name}' (with key '{$key}', of class '{$class}') is ". pht(
"incompletely implemented: it claims to support a feature, but does not ". "Custom field '%s' (with key '%s', of class '%s') is incompletely ".
"implement all of the required methods for that feature."); "implemented: it claims to support a feature, but does not ".
"implement all of the required methods for that feature.",
$name,
$key,
get_class($field)));
} }
} }

View file

@ -59,10 +59,11 @@ abstract class PhabricatorCustomField {
$spec = $object->getCustomFieldSpecificationForRole($role); $spec = $object->getCustomFieldSpecificationForRole($role);
if (!is_array($spec)) { if (!is_array($spec)) {
$obj_class = get_class($object);
throw new Exception( throw new Exception(
"Expected an array from getCustomFieldSpecificationForRole() for ". pht(
"object of class '{$obj_class}'."); "Expected an array from %s for object of class '%s'.",
'getCustomFieldSpecificationForRole()',
get_class($object)));
} }
$fields = self::buildFieldList( $fields = self::buildFieldList(
@ -128,10 +129,13 @@ abstract class PhabricatorCustomField {
foreach ($field_object->createFields($object) as $field) { foreach ($field_object->createFields($object) as $field) {
$key = $field->getFieldKey(); $key = $field->getFieldKey();
if (isset($fields[$key])) { if (isset($fields[$key])) {
$original_class = $from_map[$key];
throw new Exception( throw new Exception(
"Both '{$original_class}' and '{$current_class}' define a custom ". pht(
"field with field key '{$key}'. Field keys must be unique."); "Both '%s' and '%s' define a custom field with ".
"field key '%s'. Field keys must be unique.",
$from_map[$key],
$current_class,
$key));
} }
$from_map[$key] = $current_class; $from_map[$key] = $current_class;
$fields[$key] = $field; $fields[$key] = $field;
@ -290,7 +294,7 @@ abstract class PhabricatorCustomField {
case self::ROLE_DEFAULT: case self::ROLE_DEFAULT:
return true; return true;
default: default:
throw new Exception("Unknown field role '{$role}'!"); throw new Exception(pht("Unknown field role '%s'!", $role));
} }
} }

View file

@ -20,7 +20,9 @@ final class PhabricatorCustomFieldAttachment {
public function getCustomFieldList($role) { public function getCustomFieldList($role) {
if (empty($this->lists[$role])) { if (empty($this->lists[$role])) {
throw new PhabricatorCustomFieldNotAttachedException( throw new PhabricatorCustomFieldNotAttachedException(
"Role list '{$role}' is not available!"); pht(
"Role list '%s' is not available!",
$role));
} }
return $this->lists[$role]; return $this->lists[$role];
} }

View file

@ -114,7 +114,7 @@ final class PhabricatorBotObjectNameHandler extends PhabricatorBotHandler {
'poll_id' => $vote_id, 'poll_id' => $vote_id,
)); ));
$output[$vote['phid']] = 'V'.$vote['id'].': '.$vote['question']. $output[$vote['phid']] = 'V'.$vote['id'].': '.$vote['question'].
' Come Vote '.$vote['uri']; ' '.pht('Come Vote').' '.$vote['uri'];
} }
} }

View file

@ -29,7 +29,7 @@ final class PhabricatorTaskmasterDaemon extends PhabricatorDaemon {
} else if ($ex instanceof PhabricatorWorkerYieldException) { } else if ($ex instanceof PhabricatorWorkerYieldException) {
$this->log(pht('Task %s yielded.', $id)); $this->log(pht('Task %s yielded.', $id));
} else { } else {
$this->log("Task {$id} failed!"); $this->log(pht('Task %d failed!', $id));
throw new PhutilProxyException( throw new PhutilProxyException(
pht('Error while executing Task ID %d.', $id), pht('Error while executing Task ID %d.', $id),
$ex); $ex);

View file

@ -42,10 +42,11 @@ final class PhabricatorWorkerManagementExecuteWorkflow
$task->getDataID()); $task->getDataID());
$task->setData($task_data->getData()); $task->setData($task_data->getData());
$id = $task->getID(); $console->writeOut(
$class = $task->getTaskClass(); pht(
'Executing task %d (%s)...',
$console->writeOut("Executing task {$id} ({$class})..."); $task->getID(),
$task->getTaskClass()));
$task = $task->executeTask(); $task = $task->executeTask();
$ex = $task->getExecutionException(); $ex = $task->getExecutionException();

View file

@ -191,7 +191,7 @@ final class PhabricatorStorageManagementAPI {
$this->applyPatchPHP($name); $this->applyPatchPHP($name);
break; break;
default: default:
throw new Exception("Unable to apply patch of type '{$type}'."); throw new Exception(pht("Unable to apply patch of type '%s'.", $type));
} }
} }

View file

@ -200,12 +200,13 @@ final class PhabricatorStorageManagementUpgradeWorkflow
if (!$applied_something) { if (!$applied_something) {
if (count($patches)) { if (count($patches)) {
throw new Exception( throw new Exception(
'Some patches could not be applied: '. pht(
implode(', ', array_keys($patches))); 'Some patches could not be applied: %s',
implode(', ', array_keys($patches))));
} else if (!$is_dry && !$apply_only) { } else if (!$is_dry && !$apply_only) {
echo pht( echo pht(
"Storage is up to date. Use '%s' for details.\n", "Storage is up to date. Use '%s' for details.",
'storage status'); 'storage status')."\n";
} }
break; break;
} }

View file

@ -184,7 +184,7 @@ abstract class PhabricatorTestCase extends PhutilTestCase {
$seed = $this->getNextObjectSeed(); $seed = $this->getNextObjectSeed();
$user = id(new PhabricatorUser()) $user = id(new PhabricatorUser())
->setRealName("Test User {$seed}}") ->setRealName(pht('Test User %s', $seed))
->setUserName("test{$seed}") ->setUserName("test{$seed}")
->setIsApproved(1); ->setIsApproved(1);
@ -211,15 +211,17 @@ abstract class PhabricatorTestCase extends PhutilTestCase {
if (!self::$testsAreRunning) { if (!self::$testsAreRunning) {
throw new Exception( throw new Exception(
pht( pht(
'Executing test code outside of test execution! This code path can '. 'Executing test code outside of test execution! '.
'only be run during unit tests.')); 'This code path can only be run during unit tests.'));
} }
} }
protected function requireBinaryForTest($binary) { protected function requireBinaryForTest($binary) {
if (!Filesystem::binaryExists($binary)) { if (!Filesystem::binaryExists($binary)) {
$this->assertSkipped( $this->assertSkipped(
pht('No binary "%s" found on this system, skipping test.', $binary)); pht(
'No binary "%s" found on this system, skipping test.',
$binary));
} }
} }

View file

@ -234,7 +234,10 @@ final class AphrontDialogView extends AphrontView {
case self::WIDTH_DEFAULT: case self::WIDTH_DEFAULT:
break; break;
default: default:
throw new Exception("Unknown dialog width '{$this->width}'!"); throw new Exception(
pht(
"Unknown dialog width '%s'!",
$this->width));
} }
if ($this->isStandalone) { if ($this->isStandalone) {

View file

@ -61,7 +61,7 @@ final class AphrontFormDateControl extends AphrontFormControl {
$this->valueTime = $time; $this->valueTime = $time;
// Assume invalid. // Assume invalid.
$err = 'Invalid'; $err = pht('Invalid');
$zone = $this->getTimezone(); $zone = $this->getTimezone();

View file

@ -110,14 +110,14 @@ final class PHUIListViewTestCase extends PhabricatorTestCase {
return id(new PHUIListItemView()) return id(new PHUIListItemView())
->setKey($key) ->setKey($key)
->setHref('#') ->setHref('#')
->setName('Link'); ->setName(pht('Link'));
} }
private function newLabel($key) { private function newLabel($key) {
return id(new PHUIListItemView()) return id(new PHUIListItemView())
->setType(PHUIListItemView::TYPE_LABEL) ->setType(PHUIListItemView::TYPE_LABEL)
->setKey($key) ->setKey($key)
->setName('Label'); ->setName(pht('Label'));
} }
private function newABCMenu() { private function newABCMenu() {