diff --git a/conf/__init_conf__.php b/conf/__init_conf__.php index 941efd1b09..3dd66b2ddd 100644 --- a/conf/__init_conf__.php +++ b/conf/__init_conf__.php @@ -1,7 +1,6 @@ assertEqual( 'for (;;);{"x":"\u003ciframe\u003e"}', $sink->getEmittedData(), - 'JSONResponse should prevent content-sniffing attacks.'); + pht( + '%s should prevent content-sniffing attacks.', + 'JSONResponse')); } diff --git a/src/applications/almanac/controller/AlmanacBindingEditController.php b/src/applications/almanac/controller/AlmanacBindingEditController.php index ad6936fa70..7fc5abc395 100644 --- a/src/applications/almanac/controller/AlmanacBindingEditController.php +++ b/src/applications/almanac/controller/AlmanacBindingEditController.php @@ -87,7 +87,7 @@ final class AlmanacBindingEditController ->appendControl( id(new AphrontFormTokenizerControl()) ->setName('interfacePHIDs') - ->setLabel('Interface') + ->setLabel(pht('Interface')) ->setLimit(1) ->setDatasource(new AlmanacInterfaceDatasource()) ->setValue($v_interface) diff --git a/src/applications/almanac/controller/AlmanacConsoleController.php b/src/applications/almanac/controller/AlmanacConsoleController.php index 156bd14b78..faebc51567 100644 --- a/src/applications/almanac/controller/AlmanacConsoleController.php +++ b/src/applications/almanac/controller/AlmanacConsoleController.php @@ -38,7 +38,7 @@ final class AlmanacConsoleController extends AlmanacController { $crumbs->addTextCrumb(pht('Console')); $box = id(new PHUIObjectBoxView()) - ->setHeaderText('Console') + ->setHeaderText(pht('Console')) ->appendChild($menu); return $this->buildApplicationPage( diff --git a/src/applications/audit/editor/PhabricatorAuditCommentEditor.php b/src/applications/audit/editor/PhabricatorAuditCommentEditor.php index 904592f7fa..9f4bd42f29 100644 --- a/src/applications/audit/editor/PhabricatorAuditCommentEditor.php +++ b/src/applications/audit/editor/PhabricatorAuditCommentEditor.php @@ -44,7 +44,9 @@ final class PhabricatorAuditCommentEditor extends PhabricatorEditor { return array( 'diffusion-audit-'.$commit->getPHID(), - 'Commit r'.$repository->getCallsign().$commit->getCommitIdentifier(), + pht( + 'Commit %s', + 'r'.$repository->getCallsign().$commit->getCommitIdentifier()), ); } diff --git a/src/applications/conpherence/__tests__/ConpherenceRoomTestCase.php b/src/applications/conpherence/__tests__/ConpherenceRoomTestCase.php index e463c7cf37..4c66a48348 100644 --- a/src/applications/conpherence/__tests__/ConpherenceRoomTestCase.php +++ b/src/applications/conpherence/__tests__/ConpherenceRoomTestCase.php @@ -161,7 +161,7 @@ final class ConpherenceRoomTestCase extends ConpherenceTestCase { ->setNewValue(array('+' => $participant_phids)); $xactions[] = id(new ConpherenceTransaction()) ->setTransactionType(ConpherenceTransaction::TYPE_TITLE) - ->setNewValue('Test'); + ->setNewValue(pht('Test')); id(new ConpherenceEditor()) ->setActor($creator) diff --git a/src/applications/conpherence/__tests__/ConpherenceThreadTestCase.php b/src/applications/conpherence/__tests__/ConpherenceThreadTestCase.php index 1f60f1e149..3013e998fa 100644 --- a/src/applications/conpherence/__tests__/ConpherenceThreadTestCase.php +++ b/src/applications/conpherence/__tests__/ConpherenceThreadTestCase.php @@ -160,8 +160,8 @@ final class ConpherenceThreadTestCase extends ConpherenceTestCase { list($errors, $conpherence) = ConpherenceEditor::createThread( $creator, $participant_phids, - 'Test', - 'Test', + pht('Test'), + pht('Test'), PhabricatorContentSource::newConsoleSource()); return $conpherence; } diff --git a/src/applications/differential/storage/DifferentialTransaction.php b/src/applications/differential/storage/DifferentialTransaction.php index 54f9f560a9..bc52227590 100644 --- a/src/applications/differential/storage/DifferentialTransaction.php +++ b/src/applications/differential/storage/DifferentialTransaction.php @@ -8,7 +8,7 @@ final class DifferentialTransaction extends PhabricatorApplicationTransaction { const TYPE_UPDATE = 'differential:update'; const TYPE_ACTION = 'differential:action'; const TYPE_STATUS = 'differential:status'; - + const MAILTAG_REVIEWERS = 'differential-reviewers'; const MAILTAG_CLOSED = 'differential-committed'; const MAILTAG_CC = 'differential-cc'; diff --git a/src/applications/differential/view/DifferentialChangesetListView.php b/src/applications/differential/view/DifferentialChangesetListView.php index 0dd40f39c3..dac2c118dc 100644 --- a/src/applications/differential/view/DifferentialChangesetListView.php +++ b/src/applications/differential/view/DifferentialChangesetListView.php @@ -190,7 +190,7 @@ final class DifferentialChangesetListView extends AphrontView { } else { $detail->setAutoload(isset($this->visibleChangesets[$key])); if (isset($this->visibleChangesets[$key])) { - $load = 'Loading...'; + $load = pht('Loading...'); } else { $load = javelin_tag( 'a', diff --git a/src/applications/differential/view/DifferentialResultsTableView.php b/src/applications/differential/view/DifferentialResultsTableView.php index 226c68484c..f05b24216b 100644 --- a/src/applications/differential/view/DifferentialResultsTableView.php +++ b/src/applications/differential/view/DifferentialResultsTableView.php @@ -78,7 +78,7 @@ final class DifferentialResultsTableView extends AphrontView { 'href' => '#', 'mustcapture' => true, ), - 'Hide'); + pht('Hide')); $rows[] = javelin_tag( 'tr', diff --git a/src/applications/differential/view/DifferentialRevisionUpdateHistoryView.php b/src/applications/differential/view/DifferentialRevisionUpdateHistoryView.php index 6f8ee6db93..301774dd18 100644 --- a/src/applications/differential/view/DifferentialRevisionUpdateHistoryView.php +++ b/src/applications/differential/view/DifferentialRevisionUpdateHistoryView.php @@ -36,15 +36,14 @@ final class DifferentialRevisionUpdateHistoryView extends AphrontView { } public function render() { - $this->requireResource('differential-core-view-css'); $this->requireResource('differential-revision-history-css'); $data = array( array( - 'name' => 'Base', + 'name' => pht('Base'), 'id' => null, - 'desc' => 'Base', + 'desc' => pht('Base'), 'age' => null, 'obj' => null, ), @@ -53,7 +52,7 @@ final class DifferentialRevisionUpdateHistoryView extends AphrontView { $seq = 0; foreach ($this->diffs as $diff) { $data[] = array( - 'name' => 'Diff '.(++$seq), + 'name' => pht('Diff %d', ++$seq), 'id' => $diff->getID(), 'desc' => $diff->getDescription(), 'age' => $diff->getDateCreated(), diff --git a/src/applications/diffusion/controller/DiffusionLintController.php b/src/applications/diffusion/controller/DiffusionLintController.php index 43dfdedaee..4939ac63fc 100644 --- a/src/applications/diffusion/controller/DiffusionLintController.php +++ b/src/applications/diffusion/controller/DiffusionLintController.php @@ -116,7 +116,7 @@ final class DiffusionLintController extends DiffusionController { ->setValue($owners)) ->appendChild( id(new AphrontFormSubmitControl()) - ->setValue('Filter')); + ->setValue(pht('Filter'))); $content[] = id(new AphrontListFilterView())->appendChild($form); } diff --git a/src/applications/diffusion/controller/DiffusionRepositoryEditHostingController.php b/src/applications/diffusion/controller/DiffusionRepositoryEditHostingController.php index 2aece855e9..1fcf366967 100644 --- a/src/applications/diffusion/controller/DiffusionRepositoryEditHostingController.php +++ b/src/applications/diffusion/controller/DiffusionRepositoryEditHostingController.php @@ -181,7 +181,7 @@ final class DiffusionRepositoryEditHostingController '%s: This repository is hosted elsewhere, so Phabricator can not '. 'perform writes. This mode will act like "Read Only" for '. 'repositories hosted elsewhere.', - phutil_tag('strong', array(), 'WARNING')), + phutil_tag('strong', array(), pht('WARNING'))), ); } diff --git a/src/applications/diffusion/view/DiffusionHistoryTableView.php b/src/applications/diffusion/view/DiffusionHistoryTableView.php index 80220f7c21..ce1a693696 100644 --- a/src/applications/diffusion/view/DiffusionHistoryTableView.php +++ b/src/applications/diffusion/view/DiffusionHistoryTableView.php @@ -149,7 +149,7 @@ final class DiffusionHistoryTableView extends DiffusionView { $summary = AphrontTableView::renderSingleDisplayLine( $history->getSummary()); } else { - $summary = phutil_tag('em', array(), "Importing\xE2\x80\xA6"); + $summary = phutil_tag('em', array(), pht("Importing\xE2\x80\xA6")); } $build = null; diff --git a/src/applications/doorkeeper/engine/DoorkeeperObjectRef.php b/src/applications/doorkeeper/engine/DoorkeeperObjectRef.php index 0244532bcc..3cf2a8dbe2 100644 --- a/src/applications/doorkeeper/engine/DoorkeeperObjectRef.php +++ b/src/applications/doorkeeper/engine/DoorkeeperObjectRef.php @@ -29,8 +29,7 @@ final class DoorkeeperObjectRef extends Phobject { public function getExternalObject() { if (!$this->externalObject) { - throw new Exception( - 'Call attachExternalObject() before getExternalObject()!'); + throw new PhutilInvalidStateException('attachExternalObject'); } return $this->externalObject; } diff --git a/src/applications/drydock/blueprint/DrydockBlueprintImplementation.php b/src/applications/drydock/blueprint/DrydockBlueprintImplementation.php index 226815a642..d98d33a5e3 100644 --- a/src/applications/drydock/blueprint/DrydockBlueprintImplementation.php +++ b/src/applications/drydock/blueprint/DrydockBlueprintImplementation.php @@ -155,7 +155,7 @@ abstract class DrydockBlueprintImplementation { $resource->endReadLocking(); if ($allocated) { $resource->saveTransaction(); - $this->log('Allocated Lease'); + $this->log(pht('Allocated Lease')); } else { $resource->killTransaction(); $this->log(pht('Failed to Allocate Lease')); diff --git a/src/applications/drydock/blueprint/DrydockWorkingCopyBlueprintImplementation.php b/src/applications/drydock/blueprint/DrydockWorkingCopyBlueprintImplementation.php index 54d2b3b0f0..264394f8ac 100644 --- a/src/applications/drydock/blueprint/DrydockWorkingCopyBlueprintImplementation.php +++ b/src/applications/drydock/blueprint/DrydockWorkingCopyBlueprintImplementation.php @@ -80,7 +80,9 @@ final class DrydockWorkingCopyBlueprintImplementation $this->log(pht('Complete.')); $resource = $this->newResourceTemplate( - 'Working Copy ('.$repository->getCallsign().')'); + pht( + 'Working Copy (%s)', + $repository->getCallsign())); $resource->setStatus(DrydockResourceStatus::STATUS_OPEN); $resource->setAttribute('lease.host', $host_lease->getID()); $resource->setAttribute('path', $path); diff --git a/src/applications/drydock/view/DrydockLogListView.php b/src/applications/drydock/view/DrydockLogListView.php index aba883ed65..69c5c5bc3e 100644 --- a/src/applications/drydock/view/DrydockLogListView.php +++ b/src/applications/drydock/view/DrydockLogListView.php @@ -43,16 +43,16 @@ final class DrydockLogListView extends AphrontView { $table->setDeviceReadyTable(true); $table->setHeaders( array( - 'Resource', - 'Lease', - 'Message', - 'Date', + pht('Resource'), + pht('Lease'), + pht('Message'), + pht('Date'), )); $table->setShortHeaders( array( 'R', 'L', - 'Message', + pht('Message'), '', )); $table->setColumnClasses( diff --git a/src/applications/fact/controller/PhabricatorFactHomeController.php b/src/applications/fact/controller/PhabricatorFactHomeController.php index 85f8a084df..ededabc044 100644 --- a/src/applications/fact/controller/PhabricatorFactHomeController.php +++ b/src/applications/fact/controller/PhabricatorFactHomeController.php @@ -109,7 +109,7 @@ final class PhabricatorFactHomeController extends PhabricatorFactController { ->setUser($user) ->appendChild( id(new AphrontFormSelectControl()) - ->setLabel('Y-Axis') + ->setLabel(pht('Y-Axis')) ->setName('y1') ->setOptions($options)) ->appendChild( diff --git a/src/applications/harbormaster/controller/HarbormasterPlanRunController.php b/src/applications/harbormaster/controller/HarbormasterPlanRunController.php index cb6a90d626..e4f94e05d1 100644 --- a/src/applications/harbormaster/controller/HarbormasterPlanRunController.php +++ b/src/applications/harbormaster/controller/HarbormasterPlanRunController.php @@ -82,7 +82,7 @@ final class HarbormasterPlanRunController extends HarbormasterController { $plan->getID())) ->appendChild( id(new AphrontFormTextControl()) - ->setLabel('Buildable Name') + ->setLabel(pht('Buildable Name')) ->setName('buildablePHID') ->setError($e_name) ->setValue($v_name)); diff --git a/src/applications/herald/storage/transcript/HeraldTranscript.php b/src/applications/herald/storage/transcript/HeraldTranscript.php index 749bbf633a..8b458c93ff 100644 --- a/src/applications/herald/storage/transcript/HeraldTranscript.php +++ b/src/applications/herald/storage/transcript/HeraldTranscript.php @@ -183,9 +183,9 @@ final class HeraldTranscript extends HeraldDAO public function getMetadataMap() { return array( - 'Run At Epoch' => date('F jS, g:i:s A', $this->time), - 'Run On Host' => $this->host, - 'Run Duration' => (int)(1000 * $this->duration).' ms', + pht('Run At Epoch') => date('F jS, g:i:s A', $this->time), + pht('Run On Host') => $this->host, + pht('Run Duration') => (int)(1000 * $this->duration).' ms', ); } diff --git a/src/applications/maniphest/config/PhabricatorManiphestConfigOptions.php b/src/applications/maniphest/config/PhabricatorManiphestConfigOptions.php index a52b84dcbb..c669e2f858 100644 --- a/src/applications/maniphest/config/PhabricatorManiphestConfigOptions.php +++ b/src/applications/maniphest/config/PhabricatorManiphestConfigOptions.php @@ -212,16 +212,16 @@ EOTEXT $status_example = array( 'open' => array( - 'name' => 'Open', + 'name' => pht('Open'), 'special' => 'default', ), 'closed' => array( - 'name' => 'Closed', + 'name' => pht('Closed'), 'special' => 'closed', 'closed' => true, ), 'duplicate' => array( - 'name' => 'Duplicate', + 'name' => pht('Duplicate'), 'special' => 'duplicate', 'closed' => true, ), diff --git a/src/applications/maniphest/constants/__tests__/ManiphestTaskStatusTestCase.php b/src/applications/maniphest/constants/__tests__/ManiphestTaskStatusTestCase.php index 6548e5700f..20f4c438a7 100644 --- a/src/applications/maniphest/constants/__tests__/ManiphestTaskStatusTestCase.php +++ b/src/applications/maniphest/constants/__tests__/ManiphestTaskStatusTestCase.php @@ -34,16 +34,16 @@ final class ManiphestTaskStatusTestCase extends PhabricatorTestCase { $valid = array( 'open' => array( - 'name' => 'Open', + 'name' => pht('Open'), 'special' => 'default', ), 'closed' => array( - 'name' => 'Closed', + 'name' => pht('Closed'), 'special' => 'closed', 'closed' => true, ), 'duplicate' => array( - 'name' => 'Duplicate', + 'name' => pht('Duplicate'), 'special' => 'duplicate', 'closed' => true, ), @@ -52,7 +52,7 @@ final class ManiphestTaskStatusTestCase extends PhabricatorTestCase { // We should raise on a bad key. $bad_key = $valid; - $bad_key['!'] = array('name' => 'Exclaim'); + $bad_key['!'] = array('name' => pht('Exclaim')); $this->assertConfigValid(false, pht('Bad Key'), $bad_key); // 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. $double_close = $valid; $double_close['finished'] = array( - 'name' => 'Finished', + 'name' => pht('Finished'), 'special' => 'closed', 'closed' => true, ); diff --git a/src/applications/maniphest/controller/ManiphestReportController.php b/src/applications/maniphest/controller/ManiphestReportController.php index b03caed542..aa9c435691 100644 --- a/src/applications/maniphest/controller/ManiphestReportController.php +++ b/src/applications/maniphest/controller/ManiphestReportController.php @@ -589,7 +589,7 @@ final class ManiphestReportController extends ManiphestController { $cname[] = $label; $cclass[] = 'n'; } - $cname[] = 'Total'; + $cname[] = pht('Total'); $cclass[] = 'n'; $cname[] = javelin_tag( 'span', diff --git a/src/applications/meta/controller/PhabricatorApplicationUninstallController.php b/src/applications/meta/controller/PhabricatorApplicationUninstallController.php index eaedb3a069..b43c728257 100644 --- a/src/applications/meta/controller/PhabricatorApplicationUninstallController.php +++ b/src/applications/meta/controller/PhabricatorApplicationUninstallController.php @@ -53,16 +53,16 @@ final class PhabricatorApplicationUninstallController if ($this->action == 'install') { if ($selected->canUninstall()) { $dialog - ->setTitle('Confirmation') + ->setTitle(pht('Confirmation')) ->appendChild( pht( 'Install %s application?', $selected->getName())) - ->addSubmitButton('Install'); + ->addSubmitButton(pht('Install')); } else { $dialog - ->setTitle('Information') + ->setTitle(pht('Information')) ->appendChild(pht('You cannot install an installed application.')); } } else { diff --git a/src/applications/metamta/controller/PhabricatorMetaMTAMailgunReceiveController.php b/src/applications/metamta/controller/PhabricatorMetaMTAMailgunReceiveController.php index ce27366da3..104fb128a8 100644 --- a/src/applications/metamta/controller/PhabricatorMetaMTAMailgunReceiveController.php +++ b/src/applications/metamta/controller/PhabricatorMetaMTAMailgunReceiveController.php @@ -23,7 +23,7 @@ final class PhabricatorMetaMTAMailgunReceiveController if (!$this->verifyMessage()) { 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(); diff --git a/src/applications/metamta/receiver/__tests__/PhabricatorMailReceiverTestCase.php b/src/applications/metamta/receiver/__tests__/PhabricatorMailReceiverTestCase.php index f5b6ab578a..37eb757616 100644 --- a/src/applications/metamta/receiver/__tests__/PhabricatorMailReceiverTestCase.php +++ b/src/applications/metamta/receiver/__tests__/PhabricatorMailReceiverTestCase.php @@ -18,7 +18,7 @@ final class PhabricatorMailReceiverTestCase extends PhabricatorTestCase { foreach ($same as $address) { $this->assertTrue( PhabricatorMailReceiver::matchAddresses($base, $address), - "Address {$address}"); + pht('Address %s', $address)); } $diff = array( diff --git a/src/applications/people/typeahead/PhabricatorPeopleDatasource.php b/src/applications/people/typeahead/PhabricatorPeopleDatasource.php index f359197500..cdd68988a9 100644 --- a/src/applications/people/typeahead/PhabricatorPeopleDatasource.php +++ b/src/applications/people/typeahead/PhabricatorPeopleDatasource.php @@ -72,9 +72,9 @@ final class PhabricatorPeopleDatasource } if ($this->enrichResults) { - $display_type = 'User'; + $display_type = pht('User'); if ($user->getIsAdmin()) { - $display_type = 'Administrator'; + $display_type = pht('Administrator'); } $result->setDisplayType($display_type); $result->setImageURI($handles[$user->getPHID()]->getImageURI()); diff --git a/src/applications/phame/application/PhabricatorPhameApplication.php b/src/applications/phame/application/PhabricatorPhameApplication.php index 4d8cebffa0..75c68852d0 100644 --- a/src/applications/phame/application/PhabricatorPhameApplication.php +++ b/src/applications/phame/application/PhabricatorPhameApplication.php @@ -15,7 +15,7 @@ final class PhabricatorPhameApplication extends PhabricatorApplication { } public function getShortDescription() { - return 'Blog'; + return pht('Blog'); } public function getTitleGlyph() { diff --git a/src/applications/phame/storage/PhamePost.php b/src/applications/phame/storage/PhamePost.php index e44e9615d3..1ea48a618a 100644 --- a/src/applications/phame/storage/PhamePost.php +++ b/src/applications/phame/storage/PhamePost.php @@ -167,13 +167,13 @@ final class PhamePost extends PhameDAO if ($current == 'facebook' || PhabricatorFacebookAuthProvider::getFacebookApplicationID()) { - $options['facebook'] = 'Facebook'; + $options['facebook'] = pht('Facebook'); } if ($current == 'disqus' || PhabricatorEnv::getEnvConfig('disqus.shortname')) { - $options['disqus'] = 'Disqus'; + $options['disqus'] = pht('Disqus'); } - $options['none'] = 'None'; + $options['none'] = pht('None'); return $options; } diff --git a/src/applications/pholio/controller/PholioMockEditController.php b/src/applications/pholio/controller/PholioMockEditController.php index 9d18fa32f1..3ed2cc0779 100644 --- a/src/applications/pholio/controller/PholioMockEditController.php +++ b/src/applications/pholio/controller/PholioMockEditController.php @@ -93,7 +93,7 @@ final class PholioMockEditController extends PholioController { $mock_xactions[$type_cc] = array('=' => $v_cc); if (!strlen($request->getStr('name'))) { - $e_name = 'Required'; + $e_name = pht('Required'); $errors[] = pht('You must give the mock a name.'); } diff --git a/src/applications/phortune/controller/PhortuneProductListController.php b/src/applications/phortune/controller/PhortuneProductListController.php index 8e219630d4..8a1181b33e 100644 --- a/src/applications/phortune/controller/PhortuneProductListController.php +++ b/src/applications/phortune/controller/PhortuneProductListController.php @@ -17,7 +17,9 @@ final class PhortuneProductListController extends PhabricatorController { $title = pht('Product List'); $crumbs = $this->buildApplicationCrumbs(); - $crumbs->addTextCrumb('Products', $this->getApplicationURI('product/')); + $crumbs->addTextCrumb( + pht('Products'), + $this->getApplicationURI('product/')); $crumbs->addAction( id(new PHUIListItemView()) ->setName(pht('Create Product')) diff --git a/src/applications/phortune/controller/PhortuneProviderActionController.php b/src/applications/phortune/controller/PhortuneProviderActionController.php index dcb171911f..b856b67d97 100644 --- a/src/applications/phortune/controller/PhortuneProviderActionController.php +++ b/src/applications/phortune/controller/PhortuneProviderActionController.php @@ -44,12 +44,10 @@ final class PhortuneProviderActionController return $response; } - $title = 'Phortune'; - return $this->buildApplicationPage( $response, array( - 'title' => $title, + 'title' => pht('Phortune'), )); } diff --git a/src/applications/phpast/controller/PhabricatorXHPASTViewRunController.php b/src/applications/phpast/controller/PhabricatorXHPASTViewRunController.php index b235f5b842..f5a79a4b28 100644 --- a/src/applications/phpast/controller/PhabricatorXHPASTViewRunController.php +++ b/src/applications/phpast/controller/PhabricatorXHPASTViewRunController.php @@ -41,7 +41,7 @@ final class PhabricatorXHPASTViewRunController ->setHeight(AphrontFormTextAreaControl::HEIGHT_VERY_TALL)) ->appendChild( id(new AphrontFormSubmitControl()) - ->setValue('Parse')); + ->setValue(pht('Parse'))); $form_box = id(new PHUIObjectBoxView()) ->setHeaderText(pht('Generate XHP AST')) diff --git a/src/applications/phragment/controller/PhragmentBrowseController.php b/src/applications/phragment/controller/PhragmentBrowseController.php index d41ff4442a..7b0a16cc52 100644 --- a/src/applications/phragment/controller/PhragmentBrowseController.php +++ b/src/applications/phragment/controller/PhragmentBrowseController.php @@ -78,7 +78,7 @@ final class PhragmentBrowseController extends PhragmentController { $item->addAttribute(pht('Deleted')); } } else { - $item->addAttribute('Directory'); + $item->addAttribute(pht('Directory')); } $list->addItem($item); } diff --git a/src/applications/phragment/controller/PhragmentHistoryController.php b/src/applications/phragment/controller/PhragmentHistoryController.php index cb84fd819f..72e0000b80 100644 --- a/src/applications/phragment/controller/PhragmentHistoryController.php +++ b/src/applications/phragment/controller/PhragmentHistoryController.php @@ -67,7 +67,7 @@ final class PhragmentHistoryController extends PhragmentController { if ($version->getFilePHID() === null) { $item->setDisabled(true); - $item->addAttribute('Deletion'); + $item->addAttribute(pht('Deletion')); } if (!$first && $can_edit) { diff --git a/src/applications/phragment/controller/PhragmentSnapshotCreateController.php b/src/applications/phragment/controller/PhragmentSnapshotCreateController.php index 2cdea8528a..e135819280 100644 --- a/src/applications/phragment/controller/PhragmentSnapshotCreateController.php +++ b/src/applications/phragment/controller/PhragmentSnapshotCreateController.php @@ -89,8 +89,8 @@ final class PhragmentSnapshotCreateController extends PhragmentController { 'tr', array(), array( - phutil_tag('th', array(), 'Fragment'), - phutil_tag('th', array(), 'Version'), + phutil_tag('th', array(), pht('Fragment')), + phutil_tag('th', array(), pht('Version')), )); $rows[] = phutil_tag( 'tr', diff --git a/src/applications/phragment/controller/PhragmentZIPController.php b/src/applications/phragment/controller/PhragmentZIPController.php index 574090eede..0de9f4d344 100644 --- a/src/applications/phragment/controller/PhragmentZIPController.php +++ b/src/applications/phragment/controller/PhragmentZIPController.php @@ -68,7 +68,7 @@ final class PhragmentZIPController extends PhragmentController { } 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()); diff --git a/src/applications/project/editor/__tests__/PhabricatorProjectEditorTestCase.php b/src/applications/project/editor/__tests__/PhabricatorProjectEditorTestCase.php index 876ed9d0d7..4d19812fe3 100644 --- a/src/applications/project/editor/__tests__/PhabricatorProjectEditorTestCase.php +++ b/src/applications/project/editor/__tests__/PhabricatorProjectEditorTestCase.php @@ -227,7 +227,7 @@ final class PhabricatorProjectEditorTestCase extends PhabricatorTestCase { private function createProject(PhabricatorUser $user) { $project = PhabricatorProject::initializeNewProject($user); - $project->setName('Test Project '.mt_rand()); + $project->setName(pht('Test Project %d', mt_rand())); $project->save(); return $project; @@ -247,7 +247,7 @@ final class PhabricatorProjectEditorTestCase extends PhabricatorTestCase { $user = new PhabricatorUser(); $user->setUsername('unittestuser'.$rand); - $user->setRealName('Unit Test User '.$rand); + $user->setRealName(pht('Unit Test User %d', $rand)); return $user; } diff --git a/src/applications/project/typeahead/PhabricatorProjectDatasource.php b/src/applications/project/typeahead/PhabricatorProjectDatasource.php index d38f6fc5b3..bb8f02cfd4 100644 --- a/src/applications/project/typeahead/PhabricatorProjectDatasource.php +++ b/src/applications/project/typeahead/PhabricatorProjectDatasource.php @@ -64,7 +64,7 @@ final class PhabricatorProjectDatasource $proj_result = id(new PhabricatorTypeaheadResult()) ->setName($all_strings) ->setDisplayName($proj->getName()) - ->setDisplayType('Project') + ->setDisplayType(pht('Project')) ->setURI('/tag/'.$proj->getPrimarySlug().'/') ->setPHID($proj->getPHID()) ->setIcon($proj->getIcon()) diff --git a/src/applications/releeph/controller/request/ReleephRequestEditController.php b/src/applications/releeph/controller/request/ReleephRequestEditController.php index 8888a01070..279fee4bd6 100644 --- a/src/applications/releeph/controller/request/ReleephRequestEditController.php +++ b/src/applications/releeph/controller/request/ReleephRequestEditController.php @@ -250,7 +250,7 @@ final class ReleephRequestEditController extends ReleephBranchController { ->addHiddenInput('requestIdentifierRaw', 'D'.$diff_rev_id) ->appendChild( id(new AphrontFormStaticControl()) - ->setLabel('Diff') + ->setLabel(pht('Diff')) ->setValue($title)); } else { $origin = $branch->getURI(); diff --git a/src/applications/releeph/differential/DifferentialReleephRequestFieldSpecification.php b/src/applications/releeph/differential/DifferentialReleephRequestFieldSpecification.php index 33ae0acc96..3db133a3e0 100644 --- a/src/applications/releeph/differential/DifferentialReleephRequestFieldSpecification.php +++ b/src/applications/releeph/differential/DifferentialReleephRequestFieldSpecification.php @@ -51,7 +51,7 @@ final class DifferentialReleephRequestFieldSpecification { } public function renderLabelForRevisionView() { - return 'Releeph'; + return pht('Releeph'); } public function getRequiredHandlePHIDs() { @@ -246,7 +246,7 @@ final class DifferentialReleephRequestFieldSpecification { } public function renderLabelForCommitMessage() { - return 'Releeph'; + return pht('Releeph'); } public function shouldAppearOnCommitMessageTemplate() { diff --git a/src/applications/releeph/field/specification/ReleephAuthorFieldSpecification.php b/src/applications/releeph/field/specification/ReleephAuthorFieldSpecification.php index b917b63ce6..577280fddb 100644 --- a/src/applications/releeph/field/specification/ReleephAuthorFieldSpecification.php +++ b/src/applications/releeph/field/specification/ReleephAuthorFieldSpecification.php @@ -8,7 +8,7 @@ final class ReleephAuthorFieldSpecification } public function getName() { - return 'Author'; + return pht('Author'); } public function getRequiredHandlePHIDsForPropertyView() { diff --git a/src/applications/releeph/field/specification/ReleephBranchCommitFieldSpecification.php b/src/applications/releeph/field/specification/ReleephBranchCommitFieldSpecification.php index ea9c334bf9..74f747238d 100644 --- a/src/applications/releeph/field/specification/ReleephBranchCommitFieldSpecification.php +++ b/src/applications/releeph/field/specification/ReleephBranchCommitFieldSpecification.php @@ -8,7 +8,7 @@ final class ReleephBranchCommitFieldSpecification } public function getName() { - return 'Commit'; + return pht('Commit'); } public function getRequiredHandlePHIDsForPropertyView() { diff --git a/src/applications/releeph/field/specification/ReleephDiffMessageFieldSpecification.php b/src/applications/releeph/field/specification/ReleephDiffMessageFieldSpecification.php index 98c578361c..cde4ab95dd 100644 --- a/src/applications/releeph/field/specification/ReleephDiffMessageFieldSpecification.php +++ b/src/applications/releeph/field/specification/ReleephDiffMessageFieldSpecification.php @@ -8,7 +8,7 @@ final class ReleephDiffMessageFieldSpecification } public function getName() { - return 'Message'; + return pht('Message'); } public function getStyleForPropertyView() { diff --git a/src/applications/releeph/field/specification/ReleephIntentFieldSpecification.php b/src/applications/releeph/field/specification/ReleephIntentFieldSpecification.php index 4d199f26cc..833dce0b39 100644 --- a/src/applications/releeph/field/specification/ReleephIntentFieldSpecification.php +++ b/src/applications/releeph/field/specification/ReleephIntentFieldSpecification.php @@ -8,7 +8,7 @@ final class ReleephIntentFieldSpecification } public function getName() { - return 'Intent'; + return pht('Intent'); } public function getRequiredHandlePHIDsForPropertyView() { diff --git a/src/applications/releeph/field/specification/ReleephLevelFieldSpecification.php b/src/applications/releeph/field/specification/ReleephLevelFieldSpecification.php index a686eb15c4..7306067dc4 100644 --- a/src/applications/releeph/field/specification/ReleephLevelFieldSpecification.php +++ b/src/applications/releeph/field/specification/ReleephLevelFieldSpecification.php @@ -37,7 +37,7 @@ abstract class ReleephLevelFieldSpecification } $control = id(new AphrontFormRadioButtonControl()) - ->setLabel('Level') + ->setLabel(pht('Level')) ->setName($control_name) ->setValue($level); @@ -75,7 +75,7 @@ abstract class ReleephLevelFieldSpecification public function validate($value) { if ($value === null) { - $this->error = 'Required'; + $this->error = pht('Required'); $label = $this->getName(); throw new ReleephFieldParseException( $this, diff --git a/src/applications/releeph/field/specification/ReleephOriginalCommitFieldSpecification.php b/src/applications/releeph/field/specification/ReleephOriginalCommitFieldSpecification.php index 0d34c34eb7..57c4209ca7 100644 --- a/src/applications/releeph/field/specification/ReleephOriginalCommitFieldSpecification.php +++ b/src/applications/releeph/field/specification/ReleephOriginalCommitFieldSpecification.php @@ -8,7 +8,7 @@ final class ReleephOriginalCommitFieldSpecification } public function getName() { - return 'Commit'; + return pht('Commit'); } public function getRequiredHandlePHIDsForPropertyView() { diff --git a/src/applications/releeph/field/specification/ReleephReasonFieldSpecification.php b/src/applications/releeph/field/specification/ReleephReasonFieldSpecification.php index 831e1d60a3..023ea081a1 100644 --- a/src/applications/releeph/field/specification/ReleephReasonFieldSpecification.php +++ b/src/applications/releeph/field/specification/ReleephReasonFieldSpecification.php @@ -44,7 +44,7 @@ final class ReleephReasonFieldSpecification public function validate($reason) { if (!$reason) { - $this->error = 'Required'; + $this->error = pht('Required'); throw new ReleephFieldParseException( $this, pht('You must give a reason for your request.')); @@ -53,8 +53,8 @@ final class ReleephReasonFieldSpecification public function renderHelpForArcanist() { $text = pht( - "Fully explain why you are requesting this code be included ". - "in the next release.\n"); + 'Fully explain why you are requesting this code be included '. + 'in the next release.')."\n"; return phutil_console_wrap($text, 8); } diff --git a/src/applications/releeph/field/specification/ReleephSeverityFieldSpecification.php b/src/applications/releeph/field/specification/ReleephSeverityFieldSpecification.php index 18beb35a10..c73a17e149 100644 --- a/src/applications/releeph/field/specification/ReleephSeverityFieldSpecification.php +++ b/src/applications/releeph/field/specification/ReleephSeverityFieldSpecification.php @@ -11,7 +11,7 @@ final class ReleephSeverityFieldSpecification } public function getName() { - return 'Severity'; + return pht('Severity'); } public function getStorageKey() { diff --git a/src/applications/releeph/field/specification/ReleephSummaryFieldSpecification.php b/src/applications/releeph/field/specification/ReleephSummaryFieldSpecification.php index 95063d2947..2341b0d2b5 100644 --- a/src/applications/releeph/field/specification/ReleephSummaryFieldSpecification.php +++ b/src/applications/releeph/field/specification/ReleephSummaryFieldSpecification.php @@ -14,7 +14,7 @@ final class ReleephSummaryFieldSpecification } public function getName() { - return 'Summary'; + return pht('Summary'); } public function getStorageKey() { @@ -25,7 +25,7 @@ final class ReleephSummaryFieldSpecification public function renderEditControl(array $handles) { return id(new AphrontFormTextControl()) - ->setLabel('Summary') + ->setLabel(pht('Summary')) ->setName('summary') ->setError($this->error) ->setValue($this->getValue()) diff --git a/src/applications/releeph/query/ReleephRequestSearchEngine.php b/src/applications/releeph/query/ReleephRequestSearchEngine.php index 07e5b06dfb..1a07ec478d 100644 --- a/src/applications/releeph/query/ReleephRequestSearchEngine.php +++ b/src/applications/releeph/query/ReleephRequestSearchEngine.php @@ -157,11 +157,11 @@ final class ReleephRequestSearchEngine if (ReleephDefaultFieldSelector::isFacebook()) { return array( '' => pht('(All Severities)'), - 11 => 'HOTFIX', - 12 => 'PIGGYBACK', - 13 => 'RELEASE', - 14 => 'DAILY', - 15 => 'PARKING', + 11 => pht('HOTFIX'), + 12 => pht('PIGGYBACK'), + 13 => pht('RELEASE'), + 14 => pht('DAILY'), + 15 => pht('PARKING'), ); } else { return array( diff --git a/src/applications/repository/constants/PhabricatorRepositoryType.php b/src/applications/repository/constants/PhabricatorRepositoryType.php index 78e3a7e8ec..a99c76d889 100644 --- a/src/applications/repository/constants/PhabricatorRepositoryType.php +++ b/src/applications/repository/constants/PhabricatorRepositoryType.php @@ -18,7 +18,7 @@ final class PhabricatorRepositoryType { public static function getNameForRepositoryType($type) { $map = self::getAllRepositoryTypes(); - return idx($map, $type, 'Unknown'); + return idx($map, $type, pht('Unknown')); } } diff --git a/src/applications/repository/daemon/PhabricatorMercurialGraphStream.php b/src/applications/repository/daemon/PhabricatorMercurialGraphStream.php index 4d70d3b9e5..33f947e2f8 100644 --- a/src/applications/repository/daemon/PhabricatorMercurialGraphStream.php +++ b/src/applications/repository/daemon/PhabricatorMercurialGraphStream.php @@ -100,7 +100,10 @@ final class PhabricatorMercurialGraphStream } throw new Exception( - "No such {$until_type} '{$until_name}' in repository!"); + pht( + "No such %s '%s' in repository!", + $until_type, + $until_name)); } diff --git a/src/applications/repository/engine/PhabricatorRepositoryEngine.php b/src/applications/repository/engine/PhabricatorRepositoryEngine.php index 8d858a3d89..d5982473c5 100644 --- a/src/applications/repository/engine/PhabricatorRepositoryEngine.php +++ b/src/applications/repository/engine/PhabricatorRepositoryEngine.php @@ -68,7 +68,10 @@ abstract class PhabricatorRepositoryEngine { $matches = null; if (!preg_match('/^\s*Fetch URL:\s*(.*?)\s*$/m', $remotes, $matches)) { 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]; diff --git a/src/applications/repository/management/PhabricatorRepositoryManagementImportingWorkflow.php b/src/applications/repository/management/PhabricatorRepositoryManagementImportingWorkflow.php index 7fabffe7bd..4da1e03c9b 100644 --- a/src/applications/repository/management/PhabricatorRepositoryManagementImportingWorkflow.php +++ b/src/applications/repository/management/PhabricatorRepositoryManagementImportingWorkflow.php @@ -60,16 +60,16 @@ final class PhabricatorRepositoryManagementImportingWorkflow $status = $row['importStatus']; $need = array(); if (!($status & PhabricatorRepositoryCommit::IMPORTED_MESSAGE)) { - $need[] = 'Message'; + $need[] = pht('Message'); } if (!($status & PhabricatorRepositoryCommit::IMPORTED_CHANGE)) { - $need[] = 'Change'; + $need[] = pht('Change'); } if (!($status & PhabricatorRepositoryCommit::IMPORTED_OWNERS)) { - $need[] = 'Owners'; + $need[] = pht('Owners'); } if (!($status & PhabricatorRepositoryCommit::IMPORTED_HERALD)) { - $need[] = 'Herald'; + $need[] = pht('Herald'); } $console->writeOut(' %s', implode(', ', $need)); diff --git a/src/applications/repository/storage/__tests__/PhabricatorRepositoryURITestCase.php b/src/applications/repository/storage/__tests__/PhabricatorRepositoryURITestCase.php index 4d0384fe93..d3535102de 100644 --- a/src/applications/repository/storage/__tests__/PhabricatorRepositoryURITestCase.php +++ b/src/applications/repository/storage/__tests__/PhabricatorRepositoryURITestCase.php @@ -27,7 +27,7 @@ final class PhabricatorRepositoryURITestCase $repo = PhabricatorRepository::initializeNewRepository($user) ->setVersionControlSystem($svn) - ->setName('Test Repo') + ->setName(pht('Test Repo')) ->setCallsign('TESTREPO') ->setCredentialPHID($http_credential->getPHID()) ->save(); diff --git a/src/applications/transactions/exception/PhabricatorApplicationTransactionNoEffectException.php b/src/applications/transactions/exception/PhabricatorApplicationTransactionNoEffectException.php index 48c3b85f52..c1bf00c111 100644 --- a/src/applications/transactions/exception/PhabricatorApplicationTransactionNoEffectException.php +++ b/src/applications/transactions/exception/PhabricatorApplicationTransactionNoEffectException.php @@ -15,7 +15,7 @@ final class PhabricatorApplicationTransactionNoEffectException $this->hasComment = $has_comment; $message = array(); - $message[] = 'Transactions have no effect:'; + $message[] = pht('Transactions have no effect:'); foreach ($this->transactions as $transaction) { $message[] = ' - '.$transaction->getNoEffectDescription(); } diff --git a/src/applications/uiexample/examples/PHUITimelineExample.php b/src/applications/uiexample/examples/PHUITimelineExample.php index 33b4fe9752..18cd180fd8 100644 --- a/src/applications/uiexample/examples/PHUITimelineExample.php +++ b/src/applications/uiexample/examples/PHUITimelineExample.php @@ -96,8 +96,8 @@ final class PHUITimelineExample extends PhabricatorUIExample { $events[] = id(new PHUITimelineEventView()) ->setUserHandle($handle) ->setIcon('fa-tag') - ->setTitle(str_repeat('Long Text Title ', 64)) - ->appendChild(str_repeat('Long Text Body ', 64)) + ->setTitle(str_repeat(pht('Long Text Title').' ', 64)) + ->appendChild(str_repeat(pht('Long Text Body').' ', 64)) ->setColor(PhabricatorTransactions::COLOR_ORANGE); $events[] = id(new PHUITimelineEventView()) diff --git a/src/applications/uiexample/examples/PhabricatorAphrontBarUIExample.php b/src/applications/uiexample/examples/PhabricatorAphrontBarUIExample.php index d28d145ec6..f66c5c1618 100644 --- a/src/applications/uiexample/examples/PhabricatorAphrontBarUIExample.php +++ b/src/applications/uiexample/examples/PhabricatorAphrontBarUIExample.php @@ -53,7 +53,7 @@ final class PhabricatorAphrontBarUIExample extends PhabricatorUIExample { } return $this->wrap( - 'Glyph bars in weird order', + pht('Glyph bars in weird order'), $views); } @@ -61,12 +61,13 @@ final class PhabricatorAphrontBarUIExample extends PhabricatorUIExample { $bar = id(new AphrontGlyphBarView()) ->setValue(50) ->setMax(100) - ->setCaption('Glyphs!') + ->setCaption(pht('Glyphs!')) ->setNumGlyphs(10) ->setGlyph(hsprintf('%s', '*')); return $this->wrap( - 'Ascii star glyph bar', $bar); + pht('ASCII star glyph bar'), + $bar); } } diff --git a/src/applications/uiexample/examples/PhabricatorPagedFormUIExample.php b/src/applications/uiexample/examples/PhabricatorPagedFormUIExample.php index fb0f7a6362..3f42be9ce1 100644 --- a/src/applications/uiexample/examples/PhabricatorPagedFormUIExample.php +++ b/src/applications/uiexample/examples/PhabricatorPagedFormUIExample.php @@ -22,28 +22,28 @@ final class PhabricatorPagedFormUIExample extends PhabricatorUIExample { ->addControl( id(new AphrontFormTextControl()) ->setName('page1') - ->setLabel('Page 1')); + ->setLabel(pht('Page 1'))); $page2 = id(new PHUIFormPageView()) ->setPageName(pht('Page 2')) ->addControl( id(new AphrontFormTextControl()) ->setName('page2') - ->setLabel('Page 2')); + ->setLabel(pht('Page 2'))); $page3 = id(new PHUIFormPageView()) ->setPageName(pht('Page 3')) ->addControl( id(new AphrontFormTextControl()) ->setName('page3') - ->setLabel('Page 3')); + ->setLabel(pht('Page 3'))); $page4 = id(new PHUIFormPageView()) ->setPageName(pht('Page 4')) ->addControl( id(new AphrontFormTextControl()) ->setName('page4') - ->setLabel('Page 4')); + ->setLabel(pht('Page 4'))); $form = new PHUIPagedFormView(); $form->setUser($user); diff --git a/src/applications/uiexample/examples/PhabricatorPagerUIExample.php b/src/applications/uiexample/examples/PhabricatorPagerUIExample.php index e2e938a302..26b47728c5 100644 --- a/src/applications/uiexample/examples/PhabricatorPagerUIExample.php +++ b/src/applications/uiexample/examples/PhabricatorPagerUIExample.php @@ -23,7 +23,7 @@ final class PhabricatorPagerUIExample extends PhabricatorUIExample { $rows = array(); for ($ii = $offset; $ii < min($item_count, $offset + $page_size); $ii++) { $rows[] = array( - 'Item #'.($ii + 1), + pht('Item #%d', $ii + 1), ); } diff --git a/src/applications/uiexample/examples/PhabricatorSortTableUIExample.php b/src/applications/uiexample/examples/PhabricatorSortTableUIExample.php index 7911710815..b784306403 100644 --- a/src/applications/uiexample/examples/PhabricatorSortTableUIExample.php +++ b/src/applications/uiexample/examples/PhabricatorSortTableUIExample.php @@ -18,28 +18,28 @@ final class PhabricatorSortTableUIExample extends PhabricatorUIExample { 'model' => 'Civic', 'year' => 2004, 'price' => 3199, - 'color' => 'Blue', + 'color' => pht('Blue'), ), array( 'make' => 'Ford', 'model' => 'Focus', 'year' => 2001, 'price' => 2549, - 'color' => 'Red', + 'color' => pht('Red'), ), array( 'make' => 'Toyota', 'model' => 'Camry', 'year' => 2009, 'price' => 4299, - 'color' => 'Black', + 'color' => pht('Black'), ), array( 'make' => 'NASA', 'model' => 'Shuttle', 'year' => 1998, 'price' => 1000000000, - 'color' => 'White', + 'color' => pht('White'), ), ); diff --git a/src/applications/xhprof/controller/PhabricatorXHProfController.php b/src/applications/xhprof/controller/PhabricatorXHProfController.php index 6c595d1455..6dda92560c 100644 --- a/src/applications/xhprof/controller/PhabricatorXHProfController.php +++ b/src/applications/xhprof/controller/PhabricatorXHProfController.php @@ -5,7 +5,7 @@ abstract class PhabricatorXHProfController extends PhabricatorController { public function buildStandardPageResponse($view, array $data) { $page = $this->buildStandardPageView(); - $page->setApplicationName('XHProf'); + $page->setApplicationName(pht('XHProf')); $page->setBaseURI('/xhprof/'); $page->setTitle(idx($data, 'title')); $page->setGlyph("\xE2\x98\x84"); diff --git a/src/infrastructure/PhabricatorEditor.php b/src/infrastructure/PhabricatorEditor.php index 745ce3c156..eee718a23e 100644 --- a/src/infrastructure/PhabricatorEditor.php +++ b/src/infrastructure/PhabricatorEditor.php @@ -17,7 +17,7 @@ abstract class PhabricatorEditor extends Phobject { final public function requireActor() { $actor = $this->getActor(); if (!$actor) { - throw new Exception('You must setActor()!'); + throw new PhutilInvalidStateException('setActor'); } return $actor; } diff --git a/src/infrastructure/customfield/exception/PhabricatorCustomFieldImplementationIncompleteException.php b/src/infrastructure/customfield/exception/PhabricatorCustomFieldImplementationIncompleteException.php index 55640f8ed4..3ab7046e95 100644 --- a/src/infrastructure/customfield/exception/PhabricatorCustomFieldImplementationIncompleteException.php +++ b/src/infrastructure/customfield/exception/PhabricatorCustomFieldImplementationIncompleteException.php @@ -15,12 +15,14 @@ final class PhabricatorCustomFieldImplementationIncompleteException $name = $field->getFieldName(); } - $class = get_class($field); - parent::__construct( - "Custom field '{$name}' (with key '{$key}', of class '{$class}') is ". - "incompletely implemented: it claims to support a feature, but does not ". - "implement all of the required methods for that feature."); + pht( + "Custom field '%s' (with key '%s', of class '%s') is incompletely ". + "implemented: it claims to support a feature, but does not ". + "implement all of the required methods for that feature.", + $name, + $key, + get_class($field))); } } diff --git a/src/infrastructure/customfield/field/PhabricatorCustomField.php b/src/infrastructure/customfield/field/PhabricatorCustomField.php index 18c112516b..4b0f68e93a 100644 --- a/src/infrastructure/customfield/field/PhabricatorCustomField.php +++ b/src/infrastructure/customfield/field/PhabricatorCustomField.php @@ -59,10 +59,11 @@ abstract class PhabricatorCustomField { $spec = $object->getCustomFieldSpecificationForRole($role); if (!is_array($spec)) { - $obj_class = get_class($object); throw new Exception( - "Expected an array from getCustomFieldSpecificationForRole() for ". - "object of class '{$obj_class}'."); + pht( + "Expected an array from %s for object of class '%s'.", + 'getCustomFieldSpecificationForRole()', + get_class($object))); } $fields = self::buildFieldList( @@ -128,10 +129,13 @@ abstract class PhabricatorCustomField { foreach ($field_object->createFields($object) as $field) { $key = $field->getFieldKey(); if (isset($fields[$key])) { - $original_class = $from_map[$key]; throw new Exception( - "Both '{$original_class}' and '{$current_class}' define a custom ". - "field with field key '{$key}'. Field keys must be unique."); + pht( + "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; $fields[$key] = $field; @@ -290,7 +294,7 @@ abstract class PhabricatorCustomField { case self::ROLE_DEFAULT: return true; default: - throw new Exception("Unknown field role '{$role}'!"); + throw new Exception(pht("Unknown field role '%s'!", $role)); } } diff --git a/src/infrastructure/customfield/field/PhabricatorCustomFieldAttachment.php b/src/infrastructure/customfield/field/PhabricatorCustomFieldAttachment.php index 36a8a5bd8b..068763527b 100644 --- a/src/infrastructure/customfield/field/PhabricatorCustomFieldAttachment.php +++ b/src/infrastructure/customfield/field/PhabricatorCustomFieldAttachment.php @@ -20,7 +20,9 @@ final class PhabricatorCustomFieldAttachment { public function getCustomFieldList($role) { if (empty($this->lists[$role])) { throw new PhabricatorCustomFieldNotAttachedException( - "Role list '{$role}' is not available!"); + pht( + "Role list '%s' is not available!", + $role)); } return $this->lists[$role]; } diff --git a/src/infrastructure/daemon/bot/handler/PhabricatorBotObjectNameHandler.php b/src/infrastructure/daemon/bot/handler/PhabricatorBotObjectNameHandler.php index f226d0ad76..804e5b27bb 100644 --- a/src/infrastructure/daemon/bot/handler/PhabricatorBotObjectNameHandler.php +++ b/src/infrastructure/daemon/bot/handler/PhabricatorBotObjectNameHandler.php @@ -114,7 +114,7 @@ final class PhabricatorBotObjectNameHandler extends PhabricatorBotHandler { 'poll_id' => $vote_id, )); $output[$vote['phid']] = 'V'.$vote['id'].': '.$vote['question']. - ' Come Vote '.$vote['uri']; + ' '.pht('Come Vote').' '.$vote['uri']; } } diff --git a/src/infrastructure/daemon/workers/PhabricatorTaskmasterDaemon.php b/src/infrastructure/daemon/workers/PhabricatorTaskmasterDaemon.php index 88cc4808cc..2b54b9ab51 100644 --- a/src/infrastructure/daemon/workers/PhabricatorTaskmasterDaemon.php +++ b/src/infrastructure/daemon/workers/PhabricatorTaskmasterDaemon.php @@ -29,7 +29,7 @@ final class PhabricatorTaskmasterDaemon extends PhabricatorDaemon { } else if ($ex instanceof PhabricatorWorkerYieldException) { $this->log(pht('Task %s yielded.', $id)); } else { - $this->log("Task {$id} failed!"); + $this->log(pht('Task %d failed!', $id)); throw new PhutilProxyException( pht('Error while executing Task ID %d.', $id), $ex); diff --git a/src/infrastructure/daemon/workers/management/PhabricatorWorkerManagementExecuteWorkflow.php b/src/infrastructure/daemon/workers/management/PhabricatorWorkerManagementExecuteWorkflow.php index 45f5832124..3826075276 100644 --- a/src/infrastructure/daemon/workers/management/PhabricatorWorkerManagementExecuteWorkflow.php +++ b/src/infrastructure/daemon/workers/management/PhabricatorWorkerManagementExecuteWorkflow.php @@ -42,10 +42,11 @@ final class PhabricatorWorkerManagementExecuteWorkflow $task->getDataID()); $task->setData($task_data->getData()); - $id = $task->getID(); - $class = $task->getTaskClass(); - - $console->writeOut("Executing task {$id} ({$class})..."); + $console->writeOut( + pht( + 'Executing task %d (%s)...', + $task->getID(), + $task->getTaskClass())); $task = $task->executeTask(); $ex = $task->getExecutionException(); diff --git a/src/infrastructure/storage/management/PhabricatorStorageManagementAPI.php b/src/infrastructure/storage/management/PhabricatorStorageManagementAPI.php index 8d4a10c853..bff0331c02 100644 --- a/src/infrastructure/storage/management/PhabricatorStorageManagementAPI.php +++ b/src/infrastructure/storage/management/PhabricatorStorageManagementAPI.php @@ -191,7 +191,7 @@ final class PhabricatorStorageManagementAPI { $this->applyPatchPHP($name); break; default: - throw new Exception("Unable to apply patch of type '{$type}'."); + throw new Exception(pht("Unable to apply patch of type '%s'.", $type)); } } diff --git a/src/infrastructure/storage/management/workflow/PhabricatorStorageManagementUpgradeWorkflow.php b/src/infrastructure/storage/management/workflow/PhabricatorStorageManagementUpgradeWorkflow.php index f6cf6ad473..55cf3b223e 100644 --- a/src/infrastructure/storage/management/workflow/PhabricatorStorageManagementUpgradeWorkflow.php +++ b/src/infrastructure/storage/management/workflow/PhabricatorStorageManagementUpgradeWorkflow.php @@ -200,12 +200,13 @@ final class PhabricatorStorageManagementUpgradeWorkflow if (!$applied_something) { if (count($patches)) { throw new Exception( - 'Some patches could not be applied: '. - implode(', ', array_keys($patches))); + pht( + 'Some patches could not be applied: %s', + implode(', ', array_keys($patches)))); } else if (!$is_dry && !$apply_only) { echo pht( - "Storage is up to date. Use '%s' for details.\n", - 'storage status'); + "Storage is up to date. Use '%s' for details.", + 'storage status')."\n"; } break; } diff --git a/src/infrastructure/testing/PhabricatorTestCase.php b/src/infrastructure/testing/PhabricatorTestCase.php index ad88ca360f..32fe4f3bee 100644 --- a/src/infrastructure/testing/PhabricatorTestCase.php +++ b/src/infrastructure/testing/PhabricatorTestCase.php @@ -184,7 +184,7 @@ abstract class PhabricatorTestCase extends PhutilTestCase { $seed = $this->getNextObjectSeed(); $user = id(new PhabricatorUser()) - ->setRealName("Test User {$seed}}") + ->setRealName(pht('Test User %s', $seed)) ->setUserName("test{$seed}") ->setIsApproved(1); @@ -211,15 +211,17 @@ abstract class PhabricatorTestCase extends PhutilTestCase { if (!self::$testsAreRunning) { throw new Exception( pht( - 'Executing test code outside of test execution! This code path can '. - 'only be run during unit tests.')); + 'Executing test code outside of test execution! '. + 'This code path can only be run during unit tests.')); } } protected function requireBinaryForTest($binary) { if (!Filesystem::binaryExists($binary)) { $this->assertSkipped( - pht('No binary "%s" found on this system, skipping test.', $binary)); + pht( + 'No binary "%s" found on this system, skipping test.', + $binary)); } } diff --git a/src/view/AphrontDialogView.php b/src/view/AphrontDialogView.php index b551c14f35..b2811717db 100644 --- a/src/view/AphrontDialogView.php +++ b/src/view/AphrontDialogView.php @@ -234,7 +234,10 @@ final class AphrontDialogView extends AphrontView { case self::WIDTH_DEFAULT: break; default: - throw new Exception("Unknown dialog width '{$this->width}'!"); + throw new Exception( + pht( + "Unknown dialog width '%s'!", + $this->width)); } if ($this->isStandalone) { diff --git a/src/view/form/control/AphrontFormDateControl.php b/src/view/form/control/AphrontFormDateControl.php index 7a742efaf1..6f826cf830 100644 --- a/src/view/form/control/AphrontFormDateControl.php +++ b/src/view/form/control/AphrontFormDateControl.php @@ -61,7 +61,7 @@ final class AphrontFormDateControl extends AphrontFormControl { $this->valueTime = $time; // Assume invalid. - $err = 'Invalid'; + $err = pht('Invalid'); $zone = $this->getTimezone(); diff --git a/src/view/layout/__tests__/PHUIListViewTestCase.php b/src/view/layout/__tests__/PHUIListViewTestCase.php index 78e1e6ea54..cfaf64a574 100644 --- a/src/view/layout/__tests__/PHUIListViewTestCase.php +++ b/src/view/layout/__tests__/PHUIListViewTestCase.php @@ -110,14 +110,14 @@ final class PHUIListViewTestCase extends PhabricatorTestCase { return id(new PHUIListItemView()) ->setKey($key) ->setHref('#') - ->setName('Link'); + ->setName(pht('Link')); } private function newLabel($key) { return id(new PHUIListItemView()) ->setType(PHUIListItemView::TYPE_LABEL) ->setKey($key) - ->setName('Label'); + ->setName(pht('Label')); } private function newABCMenu() {