@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Mark some strings for translation

Summary: Add some more `pht`izations.

Test Plan: Eyeball it.

Reviewers: epriestley, #blessed_reviewers

Reviewed By: epriestley, #blessed_reviewers

Subscribers: hach-que, Korvin, epriestley

Differential Revision: https://secure.phabricator.com/D13200

+181 -151
+11 -7
conf/__init_conf__.php
··· 1 1 <?php 2 2 3 3 function phabricator_read_config_file($original_config) { 4 - 5 4 $root = dirname(dirname(__FILE__)); 6 5 7 6 // Accept either "myconfig" (preferred) or "myconfig.conf.php". ··· 9 8 $full_config_path = $root.'/conf/'.$config.'.conf.php'; 10 9 11 10 if (!Filesystem::pathExists($full_config_path)) { 12 - 13 11 // These are very old configuration files which we used to ship with 14 12 // by default. File based configuration was de-emphasized once web-based 15 13 // configuration was built. The actual files were removed to reduce ··· 37 35 $file = trim($file, './'); 38 36 $files[$key] = preg_replace('/\.conf\.php$/', '', $file); 39 37 } 40 - $files = " ".implode("\n ", $files); 38 + $files = ' '.implode("\n ", $files); 41 39 42 40 throw new Exception( 43 - "CONFIGURATION ERROR\n". 44 - "Config file '{$original_config}' does not exist. Valid config files ". 45 - "are:\n\n".$files); 41 + pht( 42 + "CONFIGURATION ERROR\n". 43 + "Config file '%s' does not exist. Valid config files are:\n\n%s", 44 + $original_config, 45 + $files)); 46 46 } 47 47 48 48 // Make sure config file errors are reported. ··· 58 58 ini_set('display_errors', $old_display_errors); 59 59 60 60 if ($conf === false) { 61 - throw new Exception("Failed to read config file '{$config}': {$errors}"); 61 + throw new Exception( 62 + pht( 63 + "Failed to read config file '%s': %s", 64 + $config, 65 + $errors)); 62 66 } 63 67 64 68 return $conf;
+1 -1
resources/sql/patches/20130508.releephtransactionsmig.php
··· 5 5 // already migrated, so this was cleaned up when ReleephRequestEvent was 6 6 // removed. 7 7 8 - echo "(This migration is obsolete.)\n"; 8 + echo pht('(This migration is obsolete.)')."\n";
+3 -1
src/aphront/sink/__tests__/AphrontHTTPSinkTestCase.php
··· 75 75 $this->assertEqual( 76 76 'for (;;);{"x":"\u003ciframe\u003e"}', 77 77 $sink->getEmittedData(), 78 - 'JSONResponse should prevent content-sniffing attacks.'); 78 + pht( 79 + '%s should prevent content-sniffing attacks.', 80 + 'JSONResponse')); 79 81 } 80 82 81 83
+1 -1
src/applications/almanac/controller/AlmanacBindingEditController.php
··· 87 87 ->appendControl( 88 88 id(new AphrontFormTokenizerControl()) 89 89 ->setName('interfacePHIDs') 90 - ->setLabel('Interface') 90 + ->setLabel(pht('Interface')) 91 91 ->setLimit(1) 92 92 ->setDatasource(new AlmanacInterfaceDatasource()) 93 93 ->setValue($v_interface)
+1 -1
src/applications/almanac/controller/AlmanacConsoleController.php
··· 38 38 $crumbs->addTextCrumb(pht('Console')); 39 39 40 40 $box = id(new PHUIObjectBoxView()) 41 - ->setHeaderText('Console') 41 + ->setHeaderText(pht('Console')) 42 42 ->appendChild($menu); 43 43 44 44 return $this->buildApplicationPage(
+3 -1
src/applications/audit/editor/PhabricatorAuditCommentEditor.php
··· 44 44 45 45 return array( 46 46 'diffusion-audit-'.$commit->getPHID(), 47 - 'Commit r'.$repository->getCallsign().$commit->getCommitIdentifier(), 47 + pht( 48 + 'Commit %s', 49 + 'r'.$repository->getCallsign().$commit->getCommitIdentifier()), 48 50 ); 49 51 } 50 52
+1 -1
src/applications/conpherence/__tests__/ConpherenceRoomTestCase.php
··· 161 161 ->setNewValue(array('+' => $participant_phids)); 162 162 $xactions[] = id(new ConpherenceTransaction()) 163 163 ->setTransactionType(ConpherenceTransaction::TYPE_TITLE) 164 - ->setNewValue('Test'); 164 + ->setNewValue(pht('Test')); 165 165 166 166 id(new ConpherenceEditor()) 167 167 ->setActor($creator)
+2 -2
src/applications/conpherence/__tests__/ConpherenceThreadTestCase.php
··· 160 160 list($errors, $conpherence) = ConpherenceEditor::createThread( 161 161 $creator, 162 162 $participant_phids, 163 - 'Test', 164 - 'Test', 163 + pht('Test'), 164 + pht('Test'), 165 165 PhabricatorContentSource::newConsoleSource()); 166 166 return $conpherence; 167 167 }
+1 -1
src/applications/differential/storage/DifferentialTransaction.php
··· 8 8 const TYPE_UPDATE = 'differential:update'; 9 9 const TYPE_ACTION = 'differential:action'; 10 10 const TYPE_STATUS = 'differential:status'; 11 - 11 + 12 12 const MAILTAG_REVIEWERS = 'differential-reviewers'; 13 13 const MAILTAG_CLOSED = 'differential-committed'; 14 14 const MAILTAG_CC = 'differential-cc';
+1 -1
src/applications/differential/view/DifferentialChangesetListView.php
··· 190 190 } else { 191 191 $detail->setAutoload(isset($this->visibleChangesets[$key])); 192 192 if (isset($this->visibleChangesets[$key])) { 193 - $load = 'Loading...'; 193 + $load = pht('Loading...'); 194 194 } else { 195 195 $load = javelin_tag( 196 196 'a',
+1 -1
src/applications/differential/view/DifferentialResultsTableView.php
··· 78 78 'href' => '#', 79 79 'mustcapture' => true, 80 80 ), 81 - 'Hide'); 81 + pht('Hide')); 82 82 83 83 $rows[] = javelin_tag( 84 84 'tr',
+3 -4
src/applications/differential/view/DifferentialRevisionUpdateHistoryView.php
··· 36 36 } 37 37 38 38 public function render() { 39 - 40 39 $this->requireResource('differential-core-view-css'); 41 40 $this->requireResource('differential-revision-history-css'); 42 41 43 42 $data = array( 44 43 array( 45 - 'name' => 'Base', 44 + 'name' => pht('Base'), 46 45 'id' => null, 47 - 'desc' => 'Base', 46 + 'desc' => pht('Base'), 48 47 'age' => null, 49 48 'obj' => null, 50 49 ), ··· 53 52 $seq = 0; 54 53 foreach ($this->diffs as $diff) { 55 54 $data[] = array( 56 - 'name' => 'Diff '.(++$seq), 55 + 'name' => pht('Diff %d', ++$seq), 57 56 'id' => $diff->getID(), 58 57 'desc' => $diff->getDescription(), 59 58 'age' => $diff->getDateCreated(),
+1 -1
src/applications/diffusion/controller/DiffusionLintController.php
··· 116 116 ->setValue($owners)) 117 117 ->appendChild( 118 118 id(new AphrontFormSubmitControl()) 119 - ->setValue('Filter')); 119 + ->setValue(pht('Filter'))); 120 120 $content[] = id(new AphrontListFilterView())->appendChild($form); 121 121 } 122 122
+1 -1
src/applications/diffusion/controller/DiffusionRepositoryEditHostingController.php
··· 181 181 '%s: This repository is hosted elsewhere, so Phabricator can not '. 182 182 'perform writes. This mode will act like "Read Only" for '. 183 183 'repositories hosted elsewhere.', 184 - phutil_tag('strong', array(), 'WARNING')), 184 + phutil_tag('strong', array(), pht('WARNING'))), 185 185 ); 186 186 } 187 187
+1 -1
src/applications/diffusion/view/DiffusionHistoryTableView.php
··· 149 149 $summary = AphrontTableView::renderSingleDisplayLine( 150 150 $history->getSummary()); 151 151 } else { 152 - $summary = phutil_tag('em', array(), "Importing\xE2\x80\xA6"); 152 + $summary = phutil_tag('em', array(), pht("Importing\xE2\x80\xA6")); 153 153 } 154 154 155 155 $build = null;
+1 -2
src/applications/doorkeeper/engine/DoorkeeperObjectRef.php
··· 29 29 30 30 public function getExternalObject() { 31 31 if (!$this->externalObject) { 32 - throw new Exception( 33 - 'Call attachExternalObject() before getExternalObject()!'); 32 + throw new PhutilInvalidStateException('attachExternalObject'); 34 33 } 35 34 return $this->externalObject; 36 35 }
+1 -1
src/applications/drydock/blueprint/DrydockBlueprintImplementation.php
··· 155 155 $resource->endReadLocking(); 156 156 if ($allocated) { 157 157 $resource->saveTransaction(); 158 - $this->log('Allocated Lease'); 158 + $this->log(pht('Allocated Lease')); 159 159 } else { 160 160 $resource->killTransaction(); 161 161 $this->log(pht('Failed to Allocate Lease'));
+3 -1
src/applications/drydock/blueprint/DrydockWorkingCopyBlueprintImplementation.php
··· 80 80 $this->log(pht('Complete.')); 81 81 82 82 $resource = $this->newResourceTemplate( 83 - 'Working Copy ('.$repository->getCallsign().')'); 83 + pht( 84 + 'Working Copy (%s)', 85 + $repository->getCallsign())); 84 86 $resource->setStatus(DrydockResourceStatus::STATUS_OPEN); 85 87 $resource->setAttribute('lease.host', $host_lease->getID()); 86 88 $resource->setAttribute('path', $path);
+5 -5
src/applications/drydock/view/DrydockLogListView.php
··· 43 43 $table->setDeviceReadyTable(true); 44 44 $table->setHeaders( 45 45 array( 46 - 'Resource', 47 - 'Lease', 48 - 'Message', 49 - 'Date', 46 + pht('Resource'), 47 + pht('Lease'), 48 + pht('Message'), 49 + pht('Date'), 50 50 )); 51 51 $table->setShortHeaders( 52 52 array( 53 53 'R', 54 54 'L', 55 - 'Message', 55 + pht('Message'), 56 56 '', 57 57 )); 58 58 $table->setColumnClasses(
+1 -1
src/applications/fact/controller/PhabricatorFactHomeController.php
··· 109 109 ->setUser($user) 110 110 ->appendChild( 111 111 id(new AphrontFormSelectControl()) 112 - ->setLabel('Y-Axis') 112 + ->setLabel(pht('Y-Axis')) 113 113 ->setName('y1') 114 114 ->setOptions($options)) 115 115 ->appendChild(
+1 -1
src/applications/harbormaster/controller/HarbormasterPlanRunController.php
··· 82 82 $plan->getID())) 83 83 ->appendChild( 84 84 id(new AphrontFormTextControl()) 85 - ->setLabel('Buildable Name') 85 + ->setLabel(pht('Buildable Name')) 86 86 ->setName('buildablePHID') 87 87 ->setError($e_name) 88 88 ->setValue($v_name));
+3 -3
src/applications/herald/storage/transcript/HeraldTranscript.php
··· 183 183 184 184 public function getMetadataMap() { 185 185 return array( 186 - 'Run At Epoch' => date('F jS, g:i:s A', $this->time), 187 - 'Run On Host' => $this->host, 188 - 'Run Duration' => (int)(1000 * $this->duration).' ms', 186 + pht('Run At Epoch') => date('F jS, g:i:s A', $this->time), 187 + pht('Run On Host') => $this->host, 188 + pht('Run Duration') => (int)(1000 * $this->duration).' ms', 189 189 ); 190 190 } 191 191
+3 -3
src/applications/maniphest/config/PhabricatorManiphestConfigOptions.php
··· 212 212 213 213 $status_example = array( 214 214 'open' => array( 215 - 'name' => 'Open', 215 + 'name' => pht('Open'), 216 216 'special' => 'default', 217 217 ), 218 218 'closed' => array( 219 - 'name' => 'Closed', 219 + 'name' => pht('Closed'), 220 220 'special' => 'closed', 221 221 'closed' => true, 222 222 ), 223 223 'duplicate' => array( 224 - 'name' => 'Duplicate', 224 + 'name' => pht('Duplicate'), 225 225 'special' => 'duplicate', 226 226 'closed' => true, 227 227 ),
+5 -5
src/applications/maniphest/constants/__tests__/ManiphestTaskStatusTestCase.php
··· 34 34 35 35 $valid = array( 36 36 'open' => array( 37 - 'name' => 'Open', 37 + 'name' => pht('Open'), 38 38 'special' => 'default', 39 39 ), 40 40 'closed' => array( 41 - 'name' => 'Closed', 41 + 'name' => pht('Closed'), 42 42 'special' => 'closed', 43 43 'closed' => true, 44 44 ), 45 45 'duplicate' => array( 46 - 'name' => 'Duplicate', 46 + 'name' => pht('Duplicate'), 47 47 'special' => 'duplicate', 48 48 'closed' => true, 49 49 ), ··· 52 52 53 53 // We should raise on a bad key. 54 54 $bad_key = $valid; 55 - $bad_key['!'] = array('name' => 'Exclaim'); 55 + $bad_key['!'] = array('name' => pht('Exclaim')); 56 56 $this->assertConfigValid(false, pht('Bad Key'), $bad_key); 57 57 58 58 // We should raise on a value type. ··· 68 68 // We should raise on two statuses with the same special. 69 69 $double_close = $valid; 70 70 $double_close['finished'] = array( 71 - 'name' => 'Finished', 71 + 'name' => pht('Finished'), 72 72 'special' => 'closed', 73 73 'closed' => true, 74 74 );
+1 -1
src/applications/maniphest/controller/ManiphestReportController.php
··· 589 589 $cname[] = $label; 590 590 $cclass[] = 'n'; 591 591 } 592 - $cname[] = 'Total'; 592 + $cname[] = pht('Total'); 593 593 $cclass[] = 'n'; 594 594 $cname[] = javelin_tag( 595 595 'span',
+3 -3
src/applications/meta/controller/PhabricatorApplicationUninstallController.php
··· 53 53 if ($this->action == 'install') { 54 54 if ($selected->canUninstall()) { 55 55 $dialog 56 - ->setTitle('Confirmation') 56 + ->setTitle(pht('Confirmation')) 57 57 ->appendChild( 58 58 pht( 59 59 'Install %s application?', 60 60 $selected->getName())) 61 - ->addSubmitButton('Install'); 61 + ->addSubmitButton(pht('Install')); 62 62 63 63 } else { 64 64 $dialog 65 - ->setTitle('Information') 65 + ->setTitle(pht('Information')) 66 66 ->appendChild(pht('You cannot install an installed application.')); 67 67 } 68 68 } else {
+1 -1
src/applications/metamta/controller/PhabricatorMetaMTAMailgunReceiveController.php
··· 23 23 24 24 if (!$this->verifyMessage()) { 25 25 throw new Exception( 26 - 'Mail signature is not valid. Check your Mailgun API key.'); 26 + pht('Mail signature is not valid. Check your Mailgun API key.')); 27 27 } 28 28 29 29 $request = $this->getRequest();
+1 -1
src/applications/metamta/receiver/__tests__/PhabricatorMailReceiverTestCase.php
··· 18 18 foreach ($same as $address) { 19 19 $this->assertTrue( 20 20 PhabricatorMailReceiver::matchAddresses($base, $address), 21 - "Address {$address}"); 21 + pht('Address %s', $address)); 22 22 } 23 23 24 24 $diff = array(
+2 -2
src/applications/people/typeahead/PhabricatorPeopleDatasource.php
··· 72 72 } 73 73 74 74 if ($this->enrichResults) { 75 - $display_type = 'User'; 75 + $display_type = pht('User'); 76 76 if ($user->getIsAdmin()) { 77 - $display_type = 'Administrator'; 77 + $display_type = pht('Administrator'); 78 78 } 79 79 $result->setDisplayType($display_type); 80 80 $result->setImageURI($handles[$user->getPHID()]->getImageURI());
+1 -1
src/applications/phame/application/PhabricatorPhameApplication.php
··· 15 15 } 16 16 17 17 public function getShortDescription() { 18 - return 'Blog'; 18 + return pht('Blog'); 19 19 } 20 20 21 21 public function getTitleGlyph() {
+3 -3
src/applications/phame/storage/PhamePost.php
··· 167 167 168 168 if ($current == 'facebook' || 169 169 PhabricatorFacebookAuthProvider::getFacebookApplicationID()) { 170 - $options['facebook'] = 'Facebook'; 170 + $options['facebook'] = pht('Facebook'); 171 171 } 172 172 if ($current == 'disqus' || 173 173 PhabricatorEnv::getEnvConfig('disqus.shortname')) { 174 - $options['disqus'] = 'Disqus'; 174 + $options['disqus'] = pht('Disqus'); 175 175 } 176 - $options['none'] = 'None'; 176 + $options['none'] = pht('None'); 177 177 178 178 return $options; 179 179 }
+1 -1
src/applications/pholio/controller/PholioMockEditController.php
··· 93 93 $mock_xactions[$type_cc] = array('=' => $v_cc); 94 94 95 95 if (!strlen($request->getStr('name'))) { 96 - $e_name = 'Required'; 96 + $e_name = pht('Required'); 97 97 $errors[] = pht('You must give the mock a name.'); 98 98 } 99 99
+3 -1
src/applications/phortune/controller/PhortuneProductListController.php
··· 17 17 $title = pht('Product List'); 18 18 19 19 $crumbs = $this->buildApplicationCrumbs(); 20 - $crumbs->addTextCrumb('Products', $this->getApplicationURI('product/')); 20 + $crumbs->addTextCrumb( 21 + pht('Products'), 22 + $this->getApplicationURI('product/')); 21 23 $crumbs->addAction( 22 24 id(new PHUIListItemView()) 23 25 ->setName(pht('Create Product'))
+1 -3
src/applications/phortune/controller/PhortuneProviderActionController.php
··· 44 44 return $response; 45 45 } 46 46 47 - $title = 'Phortune'; 48 - 49 47 return $this->buildApplicationPage( 50 48 $response, 51 49 array( 52 - 'title' => $title, 50 + 'title' => pht('Phortune'), 53 51 )); 54 52 } 55 53
+1 -1
src/applications/phpast/controller/PhabricatorXHPASTViewRunController.php
··· 41 41 ->setHeight(AphrontFormTextAreaControl::HEIGHT_VERY_TALL)) 42 42 ->appendChild( 43 43 id(new AphrontFormSubmitControl()) 44 - ->setValue('Parse')); 44 + ->setValue(pht('Parse'))); 45 45 46 46 $form_box = id(new PHUIObjectBoxView()) 47 47 ->setHeaderText(pht('Generate XHP AST'))
+1 -1
src/applications/phragment/controller/PhragmentBrowseController.php
··· 78 78 $item->addAttribute(pht('Deleted')); 79 79 } 80 80 } else { 81 - $item->addAttribute('Directory'); 81 + $item->addAttribute(pht('Directory')); 82 82 } 83 83 $list->addItem($item); 84 84 }
+1 -1
src/applications/phragment/controller/PhragmentHistoryController.php
··· 67 67 68 68 if ($version->getFilePHID() === null) { 69 69 $item->setDisabled(true); 70 - $item->addAttribute('Deletion'); 70 + $item->addAttribute(pht('Deletion')); 71 71 } 72 72 73 73 if (!$first && $can_edit) {
+2 -2
src/applications/phragment/controller/PhragmentSnapshotCreateController.php
··· 89 89 'tr', 90 90 array(), 91 91 array( 92 - phutil_tag('th', array(), 'Fragment'), 93 - phutil_tag('th', array(), 'Version'), 92 + phutil_tag('th', array(), pht('Fragment')), 93 + phutil_tag('th', array(), pht('Version')), 94 94 )); 95 95 $rows[] = phutil_tag( 96 96 'tr',
+1 -1
src/applications/phragment/controller/PhragmentZIPController.php
··· 68 68 } 69 69 70 70 if (!$zip->open((string)$temp, ZipArchive::CREATE)) { 71 - throw new Exception('Unable to create ZIP archive!'); 71 + throw new Exception(pht('Unable to create ZIP archive!')); 72 72 } 73 73 74 74 $mappings = $this->getFragmentMappings($fragment, $fragment->getPath());
+2 -2
src/applications/project/editor/__tests__/PhabricatorProjectEditorTestCase.php
··· 227 227 228 228 private function createProject(PhabricatorUser $user) { 229 229 $project = PhabricatorProject::initializeNewProject($user); 230 - $project->setName('Test Project '.mt_rand()); 230 + $project->setName(pht('Test Project %d', mt_rand())); 231 231 $project->save(); 232 232 233 233 return $project; ··· 247 247 248 248 $user = new PhabricatorUser(); 249 249 $user->setUsername('unittestuser'.$rand); 250 - $user->setRealName('Unit Test User '.$rand); 250 + $user->setRealName(pht('Unit Test User %d', $rand)); 251 251 252 252 return $user; 253 253 }
+1 -1
src/applications/project/typeahead/PhabricatorProjectDatasource.php
··· 64 64 $proj_result = id(new PhabricatorTypeaheadResult()) 65 65 ->setName($all_strings) 66 66 ->setDisplayName($proj->getName()) 67 - ->setDisplayType('Project') 67 + ->setDisplayType(pht('Project')) 68 68 ->setURI('/tag/'.$proj->getPrimarySlug().'/') 69 69 ->setPHID($proj->getPHID()) 70 70 ->setIcon($proj->getIcon())
+1 -1
src/applications/releeph/controller/request/ReleephRequestEditController.php
··· 250 250 ->addHiddenInput('requestIdentifierRaw', 'D'.$diff_rev_id) 251 251 ->appendChild( 252 252 id(new AphrontFormStaticControl()) 253 - ->setLabel('Diff') 253 + ->setLabel(pht('Diff')) 254 254 ->setValue($title)); 255 255 } else { 256 256 $origin = $branch->getURI();
+2 -2
src/applications/releeph/differential/DifferentialReleephRequestFieldSpecification.php
··· 51 51 } 52 52 53 53 public function renderLabelForRevisionView() { 54 - return 'Releeph'; 54 + return pht('Releeph'); 55 55 } 56 56 57 57 public function getRequiredHandlePHIDs() { ··· 246 246 } 247 247 248 248 public function renderLabelForCommitMessage() { 249 - return 'Releeph'; 249 + return pht('Releeph'); 250 250 } 251 251 252 252 public function shouldAppearOnCommitMessageTemplate() {
+1 -1
src/applications/releeph/field/specification/ReleephAuthorFieldSpecification.php
··· 8 8 } 9 9 10 10 public function getName() { 11 - return 'Author'; 11 + return pht('Author'); 12 12 } 13 13 14 14 public function getRequiredHandlePHIDsForPropertyView() {
+1 -1
src/applications/releeph/field/specification/ReleephBranchCommitFieldSpecification.php
··· 8 8 } 9 9 10 10 public function getName() { 11 - return 'Commit'; 11 + return pht('Commit'); 12 12 } 13 13 14 14 public function getRequiredHandlePHIDsForPropertyView() {
+1 -1
src/applications/releeph/field/specification/ReleephDiffMessageFieldSpecification.php
··· 8 8 } 9 9 10 10 public function getName() { 11 - return 'Message'; 11 + return pht('Message'); 12 12 } 13 13 14 14 public function getStyleForPropertyView() {
+1 -1
src/applications/releeph/field/specification/ReleephIntentFieldSpecification.php
··· 8 8 } 9 9 10 10 public function getName() { 11 - return 'Intent'; 11 + return pht('Intent'); 12 12 } 13 13 14 14 public function getRequiredHandlePHIDsForPropertyView() {
+2 -2
src/applications/releeph/field/specification/ReleephLevelFieldSpecification.php
··· 37 37 } 38 38 39 39 $control = id(new AphrontFormRadioButtonControl()) 40 - ->setLabel('Level') 40 + ->setLabel(pht('Level')) 41 41 ->setName($control_name) 42 42 ->setValue($level); 43 43 ··· 75 75 76 76 public function validate($value) { 77 77 if ($value === null) { 78 - $this->error = 'Required'; 78 + $this->error = pht('Required'); 79 79 $label = $this->getName(); 80 80 throw new ReleephFieldParseException( 81 81 $this,
+1 -1
src/applications/releeph/field/specification/ReleephOriginalCommitFieldSpecification.php
··· 8 8 } 9 9 10 10 public function getName() { 11 - return 'Commit'; 11 + return pht('Commit'); 12 12 } 13 13 14 14 public function getRequiredHandlePHIDsForPropertyView() {
+3 -3
src/applications/releeph/field/specification/ReleephReasonFieldSpecification.php
··· 44 44 45 45 public function validate($reason) { 46 46 if (!$reason) { 47 - $this->error = 'Required'; 47 + $this->error = pht('Required'); 48 48 throw new ReleephFieldParseException( 49 49 $this, 50 50 pht('You must give a reason for your request.')); ··· 53 53 54 54 public function renderHelpForArcanist() { 55 55 $text = pht( 56 - "Fully explain why you are requesting this code be included ". 57 - "in the next release.\n"); 56 + 'Fully explain why you are requesting this code be included '. 57 + 'in the next release.')."\n"; 58 58 return phutil_console_wrap($text, 8); 59 59 } 60 60
+1 -1
src/applications/releeph/field/specification/ReleephSeverityFieldSpecification.php
··· 11 11 } 12 12 13 13 public function getName() { 14 - return 'Severity'; 14 + return pht('Severity'); 15 15 } 16 16 17 17 public function getStorageKey() {
+2 -2
src/applications/releeph/field/specification/ReleephSummaryFieldSpecification.php
··· 14 14 } 15 15 16 16 public function getName() { 17 - return 'Summary'; 17 + return pht('Summary'); 18 18 } 19 19 20 20 public function getStorageKey() { ··· 25 25 26 26 public function renderEditControl(array $handles) { 27 27 return id(new AphrontFormTextControl()) 28 - ->setLabel('Summary') 28 + ->setLabel(pht('Summary')) 29 29 ->setName('summary') 30 30 ->setError($this->error) 31 31 ->setValue($this->getValue())
+5 -5
src/applications/releeph/query/ReleephRequestSearchEngine.php
··· 157 157 if (ReleephDefaultFieldSelector::isFacebook()) { 158 158 return array( 159 159 '' => pht('(All Severities)'), 160 - 11 => 'HOTFIX', 161 - 12 => 'PIGGYBACK', 162 - 13 => 'RELEASE', 163 - 14 => 'DAILY', 164 - 15 => 'PARKING', 160 + 11 => pht('HOTFIX'), 161 + 12 => pht('PIGGYBACK'), 162 + 13 => pht('RELEASE'), 163 + 14 => pht('DAILY'), 164 + 15 => pht('PARKING'), 165 165 ); 166 166 } else { 167 167 return array(
+1 -1
src/applications/repository/constants/PhabricatorRepositoryType.php
··· 18 18 19 19 public static function getNameForRepositoryType($type) { 20 20 $map = self::getAllRepositoryTypes(); 21 - return idx($map, $type, 'Unknown'); 21 + return idx($map, $type, pht('Unknown')); 22 22 } 23 23 24 24 }
+4 -1
src/applications/repository/daemon/PhabricatorMercurialGraphStream.php
··· 100 100 } 101 101 102 102 throw new Exception( 103 - "No such {$until_type} '{$until_name}' in repository!"); 103 + pht( 104 + "No such %s '%s' in repository!", 105 + $until_type, 106 + $until_name)); 104 107 } 105 108 106 109
+4 -1
src/applications/repository/engine/PhabricatorRepositoryEngine.php
··· 68 68 $matches = null; 69 69 if (!preg_match('/^\s*Fetch URL:\s*(.*?)\s*$/m', $remotes, $matches)) { 70 70 throw new Exception( 71 - "Expected 'Fetch URL' in 'git remote show -n origin'."); 71 + pht( 72 + "Expected '%s' in '%s'.", 73 + 'Fetch URL', 74 + 'git remote show -n origin')); 72 75 } 73 76 74 77 $remote_uri = $matches[1];
+4 -4
src/applications/repository/management/PhabricatorRepositoryManagementImportingWorkflow.php
··· 60 60 $status = $row['importStatus']; 61 61 $need = array(); 62 62 if (!($status & PhabricatorRepositoryCommit::IMPORTED_MESSAGE)) { 63 - $need[] = 'Message'; 63 + $need[] = pht('Message'); 64 64 } 65 65 if (!($status & PhabricatorRepositoryCommit::IMPORTED_CHANGE)) { 66 - $need[] = 'Change'; 66 + $need[] = pht('Change'); 67 67 } 68 68 if (!($status & PhabricatorRepositoryCommit::IMPORTED_OWNERS)) { 69 - $need[] = 'Owners'; 69 + $need[] = pht('Owners'); 70 70 } 71 71 if (!($status & PhabricatorRepositoryCommit::IMPORTED_HERALD)) { 72 - $need[] = 'Herald'; 72 + $need[] = pht('Herald'); 73 73 } 74 74 75 75 $console->writeOut(' %s', implode(', ', $need));
+1 -1
src/applications/repository/storage/__tests__/PhabricatorRepositoryURITestCase.php
··· 27 27 28 28 $repo = PhabricatorRepository::initializeNewRepository($user) 29 29 ->setVersionControlSystem($svn) 30 - ->setName('Test Repo') 30 + ->setName(pht('Test Repo')) 31 31 ->setCallsign('TESTREPO') 32 32 ->setCredentialPHID($http_credential->getPHID()) 33 33 ->save();
+1 -1
src/applications/transactions/exception/PhabricatorApplicationTransactionNoEffectException.php
··· 15 15 $this->hasComment = $has_comment; 16 16 17 17 $message = array(); 18 - $message[] = 'Transactions have no effect:'; 18 + $message[] = pht('Transactions have no effect:'); 19 19 foreach ($this->transactions as $transaction) { 20 20 $message[] = ' - '.$transaction->getNoEffectDescription(); 21 21 }
+2 -2
src/applications/uiexample/examples/PHUITimelineExample.php
··· 96 96 $events[] = id(new PHUITimelineEventView()) 97 97 ->setUserHandle($handle) 98 98 ->setIcon('fa-tag') 99 - ->setTitle(str_repeat('Long Text Title ', 64)) 100 - ->appendChild(str_repeat('Long Text Body ', 64)) 99 + ->setTitle(str_repeat(pht('Long Text Title').' ', 64)) 100 + ->appendChild(str_repeat(pht('Long Text Body').' ', 64)) 101 101 ->setColor(PhabricatorTransactions::COLOR_ORANGE); 102 102 103 103 $events[] = id(new PHUITimelineEventView())
+4 -3
src/applications/uiexample/examples/PhabricatorAphrontBarUIExample.php
··· 53 53 } 54 54 55 55 return $this->wrap( 56 - 'Glyph bars in weird order', 56 + pht('Glyph bars in weird order'), 57 57 $views); 58 58 } 59 59 ··· 61 61 $bar = id(new AphrontGlyphBarView()) 62 62 ->setValue(50) 63 63 ->setMax(100) 64 - ->setCaption('Glyphs!') 64 + ->setCaption(pht('Glyphs!')) 65 65 ->setNumGlyphs(10) 66 66 ->setGlyph(hsprintf('%s', '*')); 67 67 68 68 return $this->wrap( 69 - 'Ascii star glyph bar', $bar); 69 + pht('ASCII star glyph bar'), 70 + $bar); 70 71 } 71 72 72 73 }
+4 -4
src/applications/uiexample/examples/PhabricatorPagedFormUIExample.php
··· 22 22 ->addControl( 23 23 id(new AphrontFormTextControl()) 24 24 ->setName('page1') 25 - ->setLabel('Page 1')); 25 + ->setLabel(pht('Page 1'))); 26 26 27 27 $page2 = id(new PHUIFormPageView()) 28 28 ->setPageName(pht('Page 2')) 29 29 ->addControl( 30 30 id(new AphrontFormTextControl()) 31 31 ->setName('page2') 32 - ->setLabel('Page 2')); 32 + ->setLabel(pht('Page 2'))); 33 33 34 34 $page3 = id(new PHUIFormPageView()) 35 35 ->setPageName(pht('Page 3')) 36 36 ->addControl( 37 37 id(new AphrontFormTextControl()) 38 38 ->setName('page3') 39 - ->setLabel('Page 3')); 39 + ->setLabel(pht('Page 3'))); 40 40 41 41 $page4 = id(new PHUIFormPageView()) 42 42 ->setPageName(pht('Page 4')) 43 43 ->addControl( 44 44 id(new AphrontFormTextControl()) 45 45 ->setName('page4') 46 - ->setLabel('Page 4')); 46 + ->setLabel(pht('Page 4'))); 47 47 48 48 $form = new PHUIPagedFormView(); 49 49 $form->setUser($user);
+1 -1
src/applications/uiexample/examples/PhabricatorPagerUIExample.php
··· 23 23 $rows = array(); 24 24 for ($ii = $offset; $ii < min($item_count, $offset + $page_size); $ii++) { 25 25 $rows[] = array( 26 - 'Item #'.($ii + 1), 26 + pht('Item #%d', $ii + 1), 27 27 ); 28 28 } 29 29
+4 -4
src/applications/uiexample/examples/PhabricatorSortTableUIExample.php
··· 18 18 'model' => 'Civic', 19 19 'year' => 2004, 20 20 'price' => 3199, 21 - 'color' => 'Blue', 21 + 'color' => pht('Blue'), 22 22 ), 23 23 array( 24 24 'make' => 'Ford', 25 25 'model' => 'Focus', 26 26 'year' => 2001, 27 27 'price' => 2549, 28 - 'color' => 'Red', 28 + 'color' => pht('Red'), 29 29 ), 30 30 array( 31 31 'make' => 'Toyota', 32 32 'model' => 'Camry', 33 33 'year' => 2009, 34 34 'price' => 4299, 35 - 'color' => 'Black', 35 + 'color' => pht('Black'), 36 36 ), 37 37 array( 38 38 'make' => 'NASA', 39 39 'model' => 'Shuttle', 40 40 'year' => 1998, 41 41 'price' => 1000000000, 42 - 'color' => 'White', 42 + 'color' => pht('White'), 43 43 ), 44 44 ); 45 45
+1 -1
src/applications/xhprof/controller/PhabricatorXHProfController.php
··· 5 5 public function buildStandardPageResponse($view, array $data) { 6 6 $page = $this->buildStandardPageView(); 7 7 8 - $page->setApplicationName('XHProf'); 8 + $page->setApplicationName(pht('XHProf')); 9 9 $page->setBaseURI('/xhprof/'); 10 10 $page->setTitle(idx($data, 'title')); 11 11 $page->setGlyph("\xE2\x98\x84");
+1 -1
src/infrastructure/PhabricatorEditor.php
··· 17 17 final public function requireActor() { 18 18 $actor = $this->getActor(); 19 19 if (!$actor) { 20 - throw new Exception('You must setActor()!'); 20 + throw new PhutilInvalidStateException('setActor'); 21 21 } 22 22 return $actor; 23 23 }
+7 -5
src/infrastructure/customfield/exception/PhabricatorCustomFieldImplementationIncompleteException.php
··· 15 15 $name = $field->getFieldName(); 16 16 } 17 17 18 - $class = get_class($field); 19 - 20 18 parent::__construct( 21 - "Custom field '{$name}' (with key '{$key}', of class '{$class}') is ". 22 - "incompletely implemented: it claims to support a feature, but does not ". 23 - "implement all of the required methods for that feature."); 19 + pht( 20 + "Custom field '%s' (with key '%s', of class '%s') is incompletely ". 21 + "implemented: it claims to support a feature, but does not ". 22 + "implement all of the required methods for that feature.", 23 + $name, 24 + $key, 25 + get_class($field))); 24 26 } 25 27 26 28 }
+11 -7
src/infrastructure/customfield/field/PhabricatorCustomField.php
··· 59 59 60 60 $spec = $object->getCustomFieldSpecificationForRole($role); 61 61 if (!is_array($spec)) { 62 - $obj_class = get_class($object); 63 62 throw new Exception( 64 - "Expected an array from getCustomFieldSpecificationForRole() for ". 65 - "object of class '{$obj_class}'."); 63 + pht( 64 + "Expected an array from %s for object of class '%s'.", 65 + 'getCustomFieldSpecificationForRole()', 66 + get_class($object))); 66 67 } 67 68 68 69 $fields = self::buildFieldList( ··· 128 129 foreach ($field_object->createFields($object) as $field) { 129 130 $key = $field->getFieldKey(); 130 131 if (isset($fields[$key])) { 131 - $original_class = $from_map[$key]; 132 132 throw new Exception( 133 - "Both '{$original_class}' and '{$current_class}' define a custom ". 134 - "field with field key '{$key}'. Field keys must be unique."); 133 + pht( 134 + "Both '%s' and '%s' define a custom field with ". 135 + "field key '%s'. Field keys must be unique.", 136 + $from_map[$key], 137 + $current_class, 138 + $key)); 135 139 } 136 140 $from_map[$key] = $current_class; 137 141 $fields[$key] = $field; ··· 290 294 case self::ROLE_DEFAULT: 291 295 return true; 292 296 default: 293 - throw new Exception("Unknown field role '{$role}'!"); 297 + throw new Exception(pht("Unknown field role '%s'!", $role)); 294 298 } 295 299 } 296 300
+3 -1
src/infrastructure/customfield/field/PhabricatorCustomFieldAttachment.php
··· 20 20 public function getCustomFieldList($role) { 21 21 if (empty($this->lists[$role])) { 22 22 throw new PhabricatorCustomFieldNotAttachedException( 23 - "Role list '{$role}' is not available!"); 23 + pht( 24 + "Role list '%s' is not available!", 25 + $role)); 24 26 } 25 27 return $this->lists[$role]; 26 28 }
+1 -1
src/infrastructure/daemon/bot/handler/PhabricatorBotObjectNameHandler.php
··· 114 114 'poll_id' => $vote_id, 115 115 )); 116 116 $output[$vote['phid']] = 'V'.$vote['id'].': '.$vote['question']. 117 - ' Come Vote '.$vote['uri']; 117 + ' '.pht('Come Vote').' '.$vote['uri']; 118 118 } 119 119 } 120 120
+1 -1
src/infrastructure/daemon/workers/PhabricatorTaskmasterDaemon.php
··· 29 29 } else if ($ex instanceof PhabricatorWorkerYieldException) { 30 30 $this->log(pht('Task %s yielded.', $id)); 31 31 } else { 32 - $this->log("Task {$id} failed!"); 32 + $this->log(pht('Task %d failed!', $id)); 33 33 throw new PhutilProxyException( 34 34 pht('Error while executing Task ID %d.', $id), 35 35 $ex);
+5 -4
src/infrastructure/daemon/workers/management/PhabricatorWorkerManagementExecuteWorkflow.php
··· 42 42 $task->getDataID()); 43 43 $task->setData($task_data->getData()); 44 44 45 - $id = $task->getID(); 46 - $class = $task->getTaskClass(); 47 - 48 - $console->writeOut("Executing task {$id} ({$class})..."); 45 + $console->writeOut( 46 + pht( 47 + 'Executing task %d (%s)...', 48 + $task->getID(), 49 + $task->getTaskClass())); 49 50 50 51 $task = $task->executeTask(); 51 52 $ex = $task->getExecutionException();
+1 -1
src/infrastructure/storage/management/PhabricatorStorageManagementAPI.php
··· 191 191 $this->applyPatchPHP($name); 192 192 break; 193 193 default: 194 - throw new Exception("Unable to apply patch of type '{$type}'."); 194 + throw new Exception(pht("Unable to apply patch of type '%s'.", $type)); 195 195 } 196 196 } 197 197
+5 -4
src/infrastructure/storage/management/workflow/PhabricatorStorageManagementUpgradeWorkflow.php
··· 200 200 if (!$applied_something) { 201 201 if (count($patches)) { 202 202 throw new Exception( 203 - 'Some patches could not be applied: '. 204 - implode(', ', array_keys($patches))); 203 + pht( 204 + 'Some patches could not be applied: %s', 205 + implode(', ', array_keys($patches)))); 205 206 } else if (!$is_dry && !$apply_only) { 206 207 echo pht( 207 - "Storage is up to date. Use '%s' for details.\n", 208 - 'storage status'); 208 + "Storage is up to date. Use '%s' for details.", 209 + 'storage status')."\n"; 209 210 } 210 211 break; 211 212 }
+6 -4
src/infrastructure/testing/PhabricatorTestCase.php
··· 184 184 $seed = $this->getNextObjectSeed(); 185 185 186 186 $user = id(new PhabricatorUser()) 187 - ->setRealName("Test User {$seed}}") 187 + ->setRealName(pht('Test User %s', $seed)) 188 188 ->setUserName("test{$seed}") 189 189 ->setIsApproved(1); 190 190 ··· 211 211 if (!self::$testsAreRunning) { 212 212 throw new Exception( 213 213 pht( 214 - 'Executing test code outside of test execution! This code path can '. 215 - 'only be run during unit tests.')); 214 + 'Executing test code outside of test execution! '. 215 + 'This code path can only be run during unit tests.')); 216 216 } 217 217 } 218 218 219 219 protected function requireBinaryForTest($binary) { 220 220 if (!Filesystem::binaryExists($binary)) { 221 221 $this->assertSkipped( 222 - pht('No binary "%s" found on this system, skipping test.', $binary)); 222 + pht( 223 + 'No binary "%s" found on this system, skipping test.', 224 + $binary)); 223 225 } 224 226 } 225 227
+4 -1
src/view/AphrontDialogView.php
··· 234 234 case self::WIDTH_DEFAULT: 235 235 break; 236 236 default: 237 - throw new Exception("Unknown dialog width '{$this->width}'!"); 237 + throw new Exception( 238 + pht( 239 + "Unknown dialog width '%s'!", 240 + $this->width)); 238 241 } 239 242 240 243 if ($this->isStandalone) {
+1 -1
src/view/form/control/AphrontFormDateControl.php
··· 61 61 $this->valueTime = $time; 62 62 63 63 // Assume invalid. 64 - $err = 'Invalid'; 64 + $err = pht('Invalid'); 65 65 66 66 $zone = $this->getTimezone(); 67 67
+2 -2
src/view/layout/__tests__/PHUIListViewTestCase.php
··· 110 110 return id(new PHUIListItemView()) 111 111 ->setKey($key) 112 112 ->setHref('#') 113 - ->setName('Link'); 113 + ->setName(pht('Link')); 114 114 } 115 115 116 116 private function newLabel($key) { 117 117 return id(new PHUIListItemView()) 118 118 ->setType(PHUIListItemView::TYPE_LABEL) 119 119 ->setKey($key) 120 - ->setName('Label'); 120 + ->setName(pht('Label')); 121 121 } 122 122 123 123 private function newABCMenu() {