Page MenuHomePhabricator

D13200.diff
No OneTemporary

D13200.diff

diff --git a/conf/__init_conf__.php b/conf/__init_conf__.php
--- a/conf/__init_conf__.php
+++ b/conf/__init_conf__.php
@@ -1,7 +1,6 @@
<?php
function phabricator_read_config_file($original_config) {
-
$root = dirname(dirname(__FILE__));
// Accept either "myconfig" (preferred) or "myconfig.conf.php".
@@ -9,7 +8,6 @@
$full_config_path = $root.'/conf/'.$config.'.conf.php';
if (!Filesystem::pathExists($full_config_path)) {
-
// These are very old configuration files which we used to ship with
// by default. File based configuration was de-emphasized once web-based
// configuration was built. The actual files were removed to reduce
@@ -37,12 +35,14 @@
$file = trim($file, './');
$files[$key] = preg_replace('/\.conf\.php$/', '', $file);
}
- $files = " ".implode("\n ", $files);
+ $files = ' '.implode("\n ", $files);
throw new Exception(
- "CONFIGURATION ERROR\n".
- "Config file '{$original_config}' does not exist. Valid config files ".
- "are:\n\n".$files);
+ pht(
+ "CONFIGURATION ERROR\n".
+ "Config file '%s' does not exist. Valid config files are:\n\n%s",
+ $original_config,
+ $files));
}
// Make sure config file errors are reported.
@@ -58,7 +58,11 @@
ini_set('display_errors', $old_display_errors);
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;
diff --git a/resources/sql/patches/20130508.releephtransactionsmig.php b/resources/sql/patches/20130508.releephtransactionsmig.php
--- a/resources/sql/patches/20130508.releephtransactionsmig.php
+++ b/resources/sql/patches/20130508.releephtransactionsmig.php
@@ -5,4 +5,4 @@
// already migrated, so this was cleaned up when ReleephRequestEvent was
// removed.
-echo "(This migration is obsolete.)\n";
+echo pht('(This migration is obsolete.)')."\n";
diff --git a/src/aphront/sink/__tests__/AphrontHTTPSinkTestCase.php b/src/aphront/sink/__tests__/AphrontHTTPSinkTestCase.php
--- a/src/aphront/sink/__tests__/AphrontHTTPSinkTestCase.php
+++ b/src/aphront/sink/__tests__/AphrontHTTPSinkTestCase.php
@@ -75,7 +75,9 @@
$this->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
--- a/src/applications/almanac/controller/AlmanacBindingEditController.php
+++ b/src/applications/almanac/controller/AlmanacBindingEditController.php
@@ -87,7 +87,7 @@
->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
--- a/src/applications/almanac/controller/AlmanacConsoleController.php
+++ b/src/applications/almanac/controller/AlmanacConsoleController.php
@@ -38,7 +38,7 @@
$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
--- a/src/applications/audit/editor/PhabricatorAuditCommentEditor.php
+++ b/src/applications/audit/editor/PhabricatorAuditCommentEditor.php
@@ -44,7 +44,9 @@
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
--- a/src/applications/conpherence/__tests__/ConpherenceRoomTestCase.php
+++ b/src/applications/conpherence/__tests__/ConpherenceRoomTestCase.php
@@ -161,7 +161,7 @@
->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
--- a/src/applications/conpherence/__tests__/ConpherenceThreadTestCase.php
+++ b/src/applications/conpherence/__tests__/ConpherenceThreadTestCase.php
@@ -160,8 +160,8 @@
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
--- a/src/applications/differential/storage/DifferentialTransaction.php
+++ b/src/applications/differential/storage/DifferentialTransaction.php
@@ -8,7 +8,7 @@
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
--- a/src/applications/differential/view/DifferentialChangesetListView.php
+++ b/src/applications/differential/view/DifferentialChangesetListView.php
@@ -190,7 +190,7 @@
} 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
--- a/src/applications/differential/view/DifferentialResultsTableView.php
+++ b/src/applications/differential/view/DifferentialResultsTableView.php
@@ -78,7 +78,7 @@
'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
--- a/src/applications/differential/view/DifferentialRevisionUpdateHistoryView.php
+++ b/src/applications/differential/view/DifferentialRevisionUpdateHistoryView.php
@@ -36,15 +36,14 @@
}
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 @@
$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
--- a/src/applications/diffusion/controller/DiffusionLintController.php
+++ b/src/applications/diffusion/controller/DiffusionLintController.php
@@ -116,7 +116,7 @@
->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
--- a/src/applications/diffusion/controller/DiffusionRepositoryEditHostingController.php
+++ b/src/applications/diffusion/controller/DiffusionRepositoryEditHostingController.php
@@ -181,7 +181,7 @@
'%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
--- a/src/applications/diffusion/view/DiffusionHistoryTableView.php
+++ b/src/applications/diffusion/view/DiffusionHistoryTableView.php
@@ -149,7 +149,7 @@
$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
--- a/src/applications/doorkeeper/engine/DoorkeeperObjectRef.php
+++ b/src/applications/doorkeeper/engine/DoorkeeperObjectRef.php
@@ -29,8 +29,7 @@
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
--- a/src/applications/drydock/blueprint/DrydockBlueprintImplementation.php
+++ b/src/applications/drydock/blueprint/DrydockBlueprintImplementation.php
@@ -155,7 +155,7 @@
$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
--- a/src/applications/drydock/blueprint/DrydockWorkingCopyBlueprintImplementation.php
+++ b/src/applications/drydock/blueprint/DrydockWorkingCopyBlueprintImplementation.php
@@ -80,7 +80,9 @@
$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
--- a/src/applications/drydock/view/DrydockLogListView.php
+++ b/src/applications/drydock/view/DrydockLogListView.php
@@ -43,16 +43,16 @@
$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
--- a/src/applications/fact/controller/PhabricatorFactHomeController.php
+++ b/src/applications/fact/controller/PhabricatorFactHomeController.php
@@ -109,7 +109,7 @@
->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
--- a/src/applications/harbormaster/controller/HarbormasterPlanRunController.php
+++ b/src/applications/harbormaster/controller/HarbormasterPlanRunController.php
@@ -82,7 +82,7 @@
$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
--- a/src/applications/herald/storage/transcript/HeraldTranscript.php
+++ b/src/applications/herald/storage/transcript/HeraldTranscript.php
@@ -183,9 +183,9 @@
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
--- a/src/applications/maniphest/config/PhabricatorManiphestConfigOptions.php
+++ b/src/applications/maniphest/config/PhabricatorManiphestConfigOptions.php
@@ -212,16 +212,16 @@
$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
--- a/src/applications/maniphest/constants/__tests__/ManiphestTaskStatusTestCase.php
+++ b/src/applications/maniphest/constants/__tests__/ManiphestTaskStatusTestCase.php
@@ -34,16 +34,16 @@
$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 @@
// 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 @@
// 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
--- a/src/applications/maniphest/controller/ManiphestReportController.php
+++ b/src/applications/maniphest/controller/ManiphestReportController.php
@@ -589,7 +589,7 @@
$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
--- a/src/applications/meta/controller/PhabricatorApplicationUninstallController.php
+++ b/src/applications/meta/controller/PhabricatorApplicationUninstallController.php
@@ -53,16 +53,16 @@
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
--- a/src/applications/metamta/controller/PhabricatorMetaMTAMailgunReceiveController.php
+++ b/src/applications/metamta/controller/PhabricatorMetaMTAMailgunReceiveController.php
@@ -23,7 +23,7 @@
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
--- a/src/applications/metamta/receiver/__tests__/PhabricatorMailReceiverTestCase.php
+++ b/src/applications/metamta/receiver/__tests__/PhabricatorMailReceiverTestCase.php
@@ -18,7 +18,7 @@
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
--- a/src/applications/people/typeahead/PhabricatorPeopleDatasource.php
+++ b/src/applications/people/typeahead/PhabricatorPeopleDatasource.php
@@ -72,9 +72,9 @@
}
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
--- a/src/applications/phame/application/PhabricatorPhameApplication.php
+++ b/src/applications/phame/application/PhabricatorPhameApplication.php
@@ -15,7 +15,7 @@
}
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
--- a/src/applications/phame/storage/PhamePost.php
+++ b/src/applications/phame/storage/PhamePost.php
@@ -167,13 +167,13 @@
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
--- a/src/applications/pholio/controller/PholioMockEditController.php
+++ b/src/applications/pholio/controller/PholioMockEditController.php
@@ -93,7 +93,7 @@
$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
--- a/src/applications/phortune/controller/PhortuneProductListController.php
+++ b/src/applications/phortune/controller/PhortuneProductListController.php
@@ -17,7 +17,9 @@
$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
--- a/src/applications/phortune/controller/PhortuneProviderActionController.php
+++ b/src/applications/phortune/controller/PhortuneProviderActionController.php
@@ -44,12 +44,10 @@
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
--- a/src/applications/phpast/controller/PhabricatorXHPASTViewRunController.php
+++ b/src/applications/phpast/controller/PhabricatorXHPASTViewRunController.php
@@ -41,7 +41,7 @@
->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
--- a/src/applications/phragment/controller/PhragmentBrowseController.php
+++ b/src/applications/phragment/controller/PhragmentBrowseController.php
@@ -78,7 +78,7 @@
$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
--- a/src/applications/phragment/controller/PhragmentHistoryController.php
+++ b/src/applications/phragment/controller/PhragmentHistoryController.php
@@ -67,7 +67,7 @@
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
--- a/src/applications/phragment/controller/PhragmentSnapshotCreateController.php
+++ b/src/applications/phragment/controller/PhragmentSnapshotCreateController.php
@@ -89,8 +89,8 @@
'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
--- a/src/applications/phragment/controller/PhragmentZIPController.php
+++ b/src/applications/phragment/controller/PhragmentZIPController.php
@@ -68,7 +68,7 @@
}
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
--- a/src/applications/project/editor/__tests__/PhabricatorProjectEditorTestCase.php
+++ b/src/applications/project/editor/__tests__/PhabricatorProjectEditorTestCase.php
@@ -227,7 +227,7 @@
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 @@
$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
--- a/src/applications/project/typeahead/PhabricatorProjectDatasource.php
+++ b/src/applications/project/typeahead/PhabricatorProjectDatasource.php
@@ -64,7 +64,7 @@
$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
--- a/src/applications/releeph/controller/request/ReleephRequestEditController.php
+++ b/src/applications/releeph/controller/request/ReleephRequestEditController.php
@@ -250,7 +250,7 @@
->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
--- a/src/applications/releeph/differential/DifferentialReleephRequestFieldSpecification.php
+++ b/src/applications/releeph/differential/DifferentialReleephRequestFieldSpecification.php
@@ -51,7 +51,7 @@
}
public function renderLabelForRevisionView() {
- return 'Releeph';
+ return pht('Releeph');
}
public function getRequiredHandlePHIDs() {
@@ -246,7 +246,7 @@
}
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
--- a/src/applications/releeph/field/specification/ReleephAuthorFieldSpecification.php
+++ b/src/applications/releeph/field/specification/ReleephAuthorFieldSpecification.php
@@ -8,7 +8,7 @@
}
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
--- a/src/applications/releeph/field/specification/ReleephBranchCommitFieldSpecification.php
+++ b/src/applications/releeph/field/specification/ReleephBranchCommitFieldSpecification.php
@@ -8,7 +8,7 @@
}
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
--- a/src/applications/releeph/field/specification/ReleephDiffMessageFieldSpecification.php
+++ b/src/applications/releeph/field/specification/ReleephDiffMessageFieldSpecification.php
@@ -8,7 +8,7 @@
}
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
--- a/src/applications/releeph/field/specification/ReleephIntentFieldSpecification.php
+++ b/src/applications/releeph/field/specification/ReleephIntentFieldSpecification.php
@@ -8,7 +8,7 @@
}
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
--- a/src/applications/releeph/field/specification/ReleephLevelFieldSpecification.php
+++ b/src/applications/releeph/field/specification/ReleephLevelFieldSpecification.php
@@ -37,7 +37,7 @@
}
$control = id(new AphrontFormRadioButtonControl())
- ->setLabel('Level')
+ ->setLabel(pht('Level'))
->setName($control_name)
->setValue($level);
@@ -75,7 +75,7 @@
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
--- a/src/applications/releeph/field/specification/ReleephOriginalCommitFieldSpecification.php
+++ b/src/applications/releeph/field/specification/ReleephOriginalCommitFieldSpecification.php
@@ -8,7 +8,7 @@
}
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
--- a/src/applications/releeph/field/specification/ReleephReasonFieldSpecification.php
+++ b/src/applications/releeph/field/specification/ReleephReasonFieldSpecification.php
@@ -44,7 +44,7 @@
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 @@
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
--- a/src/applications/releeph/field/specification/ReleephSeverityFieldSpecification.php
+++ b/src/applications/releeph/field/specification/ReleephSeverityFieldSpecification.php
@@ -11,7 +11,7 @@
}
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
--- a/src/applications/releeph/field/specification/ReleephSummaryFieldSpecification.php
+++ b/src/applications/releeph/field/specification/ReleephSummaryFieldSpecification.php
@@ -14,7 +14,7 @@
}
public function getName() {
- return 'Summary';
+ return pht('Summary');
}
public function getStorageKey() {
@@ -25,7 +25,7 @@
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
--- a/src/applications/releeph/query/ReleephRequestSearchEngine.php
+++ b/src/applications/releeph/query/ReleephRequestSearchEngine.php
@@ -157,11 +157,11 @@
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
--- a/src/applications/repository/constants/PhabricatorRepositoryType.php
+++ b/src/applications/repository/constants/PhabricatorRepositoryType.php
@@ -18,7 +18,7 @@
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
--- a/src/applications/repository/daemon/PhabricatorMercurialGraphStream.php
+++ b/src/applications/repository/daemon/PhabricatorMercurialGraphStream.php
@@ -100,7 +100,10 @@
}
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
--- a/src/applications/repository/engine/PhabricatorRepositoryEngine.php
+++ b/src/applications/repository/engine/PhabricatorRepositoryEngine.php
@@ -68,7 +68,10 @@
$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
--- a/src/applications/repository/management/PhabricatorRepositoryManagementImportingWorkflow.php
+++ b/src/applications/repository/management/PhabricatorRepositoryManagementImportingWorkflow.php
@@ -60,16 +60,16 @@
$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
--- a/src/applications/repository/storage/__tests__/PhabricatorRepositoryURITestCase.php
+++ b/src/applications/repository/storage/__tests__/PhabricatorRepositoryURITestCase.php
@@ -27,7 +27,7 @@
$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
--- a/src/applications/transactions/exception/PhabricatorApplicationTransactionNoEffectException.php
+++ b/src/applications/transactions/exception/PhabricatorApplicationTransactionNoEffectException.php
@@ -15,7 +15,7 @@
$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
--- a/src/applications/uiexample/examples/PHUITimelineExample.php
+++ b/src/applications/uiexample/examples/PHUITimelineExample.php
@@ -96,8 +96,8 @@
$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
--- a/src/applications/uiexample/examples/PhabricatorAphrontBarUIExample.php
+++ b/src/applications/uiexample/examples/PhabricatorAphrontBarUIExample.php
@@ -53,7 +53,7 @@
}
return $this->wrap(
- 'Glyph bars in weird order',
+ pht('Glyph bars in weird order'),
$views);
}
@@ -61,12 +61,13 @@
$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
--- a/src/applications/uiexample/examples/PhabricatorPagedFormUIExample.php
+++ b/src/applications/uiexample/examples/PhabricatorPagedFormUIExample.php
@@ -22,28 +22,28 @@
->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
--- a/src/applications/uiexample/examples/PhabricatorPagerUIExample.php
+++ b/src/applications/uiexample/examples/PhabricatorPagerUIExample.php
@@ -23,7 +23,7 @@
$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
--- a/src/applications/uiexample/examples/PhabricatorSortTableUIExample.php
+++ b/src/applications/uiexample/examples/PhabricatorSortTableUIExample.php
@@ -18,28 +18,28 @@
'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
--- a/src/applications/xhprof/controller/PhabricatorXHProfController.php
+++ b/src/applications/xhprof/controller/PhabricatorXHProfController.php
@@ -5,7 +5,7 @@
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
--- a/src/infrastructure/PhabricatorEditor.php
+++ b/src/infrastructure/PhabricatorEditor.php
@@ -17,7 +17,7 @@
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
--- a/src/infrastructure/customfield/exception/PhabricatorCustomFieldImplementationIncompleteException.php
+++ b/src/infrastructure/customfield/exception/PhabricatorCustomFieldImplementationIncompleteException.php
@@ -15,12 +15,14 @@
$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
--- a/src/infrastructure/customfield/field/PhabricatorCustomField.php
+++ b/src/infrastructure/customfield/field/PhabricatorCustomField.php
@@ -59,10 +59,11 @@
$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 @@
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 @@
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
--- a/src/infrastructure/customfield/field/PhabricatorCustomFieldAttachment.php
+++ b/src/infrastructure/customfield/field/PhabricatorCustomFieldAttachment.php
@@ -20,7 +20,9 @@
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
--- a/src/infrastructure/daemon/bot/handler/PhabricatorBotObjectNameHandler.php
+++ b/src/infrastructure/daemon/bot/handler/PhabricatorBotObjectNameHandler.php
@@ -114,7 +114,7 @@
'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
--- a/src/infrastructure/daemon/workers/PhabricatorTaskmasterDaemon.php
+++ b/src/infrastructure/daemon/workers/PhabricatorTaskmasterDaemon.php
@@ -29,7 +29,7 @@
} 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
--- a/src/infrastructure/daemon/workers/management/PhabricatorWorkerManagementExecuteWorkflow.php
+++ b/src/infrastructure/daemon/workers/management/PhabricatorWorkerManagementExecuteWorkflow.php
@@ -42,10 +42,11 @@
$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
--- a/src/infrastructure/storage/management/PhabricatorStorageManagementAPI.php
+++ b/src/infrastructure/storage/management/PhabricatorStorageManagementAPI.php
@@ -191,7 +191,7 @@
$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
--- a/src/infrastructure/storage/management/workflow/PhabricatorStorageManagementUpgradeWorkflow.php
+++ b/src/infrastructure/storage/management/workflow/PhabricatorStorageManagementUpgradeWorkflow.php
@@ -200,12 +200,13 @@
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
--- a/src/infrastructure/testing/PhabricatorTestCase.php
+++ b/src/infrastructure/testing/PhabricatorTestCase.php
@@ -184,7 +184,7 @@
$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 @@
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
--- a/src/view/AphrontDialogView.php
+++ b/src/view/AphrontDialogView.php
@@ -234,7 +234,10 @@
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
--- a/src/view/form/control/AphrontFormDateControl.php
+++ b/src/view/form/control/AphrontFormDateControl.php
@@ -61,7 +61,7 @@
$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
--- a/src/view/layout/__tests__/PHUIListViewTestCase.php
+++ b/src/view/layout/__tests__/PHUIListViewTestCase.php
@@ -110,14 +110,14 @@
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() {

File Metadata

Mime Type
text/plain
Expires
Thu, Nov 7, 4:50 PM (5 d, 5 h ago)
Storage Engine
amazon-s3
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
phabricator/secure/t3/pe/4b2pzgesi3vehryk
Default Alt Text
D13200.diff (54 KB)

Event Timeline