From c35b564f4d329f912ba9666047e051826ae6d2cd Mon Sep 17 00:00:00 2001 From: Joshua Spence Date: Tue, 3 Nov 2015 06:54:38 +1100 Subject: [PATCH] Various translation improvements Summary: Depends on D14070. Test Plan: Eyeball it. Reviewers: epriestley, #blessed_reviewers Reviewed By: epriestley, #blessed_reviewers Subscribers: Korvin, hach-que Differential Revision: https://secure.phabricator.com/D14073 --- scripts/symbols/import_repository_symbols.php | 2 +- .../config/PhabricatorAuthListController.php | 2 +- ...abricatorAuthManagementRefreshWorkflow.php | 2 +- .../CelerityManagementMapWorkflow.php | 2 +- .../check/PhabricatorDaemonsSetupCheck.php | 2 +- .../check/PhabricatorPathSetupCheck.php | 2 +- .../config/view/PhabricatorSetupIssueView.php | 2 +- ...onpherenceUpdateThreadConduitAPIMethod.php | 7 +- .../ConpherenceUpdateController.php | 12 +-- .../storage/ConpherenceTransaction.php | 8 +- .../PhabricatorDaemonManagementWorkflow.php | 9 +- .../DifferentialJIRAIssuesField.php | 8 +- .../customfield/DifferentialUnitField.php | 2 +- .../DifferentialReviewersHeraldAction.php | 4 +- .../mail/DifferentialCreateMailReceiver.php | 6 +- .../herald/DiffusionAuditorsHeraldAction.php | 2 +- .../diviner/atomizer/DivinerPHPAtomizer.php | 4 +- .../diviner/publisher/DivinerPublisher.php | 4 +- .../workflow/DivinerGenerateWorkflow.php | 16 ++-- .../option/PhabricatorAsanaConfigOptions.php | 7 +- .../files/storage/PhabricatorFile.php | 2 +- ...arbormasterSendMessageConduitAPIMethod.php | 4 +- .../HarbormasterBuildViewController.php | 2 +- .../HarbormasterStepEditController.php | 5 +- .../HarbormasterRunBuildPlansHeraldAction.php | 2 +- .../herald/action/HeraldAction.php | 8 +- .../LegalpadRequireSignatureHeraldAction.php | 4 +- .../storage/ManiphestTransaction.php | 18 ++-- .../view/ManiphestTaskResultListView.php | 2 +- .../PhabricatorMetaMTAEmailHeraldAction.php | 4 +- .../controller/MultimeterSampleController.php | 2 +- .../PhabricatorPeopleDeleteController.php | 6 +- .../pholio/view/PholioMockThumbGridView.php | 2 +- .../controller/PhragmentController.php | 4 +- .../PonderQuestionViewController.php | 4 +- .../query/PonderQuestionSearchEngine.php | 10 ++- .../herald/PhabricatorProjectHeraldAction.php | 4 +- .../product/ReleephProductEditController.php | 2 +- .../ReleephDiffChurnFieldSpecification.php | 7 +- .../ReleephDiffSizeFieldSpecification.php | 2 +- .../query/ReleephBranchSearchEngine.php | 4 +- .../PhabricatorRepositoryPullLocalDaemon.php | 2 +- ...torRepositoryManagementParentsWorkflow.php | 2 +- ...torRepositoryManagementReparseWorkflow.php | 11 +-- .../PhabricatorSubscriptionsHeraldAction.php | 8 +- ...PhabricatorSystemRemoveDestroyWorkflow.php | 6 +- ...ApplicationTransactionNoEffectResponse.php | 12 +-- .../PhabricatorApplicationTransaction.php | 16 ++-- .../PhabricatorStandardCustomFieldPHIDs.php | 12 +-- ...tionalizationManagementExtractWorkflow.php | 2 +- .../PhabricatorUSEnglishTranslation.php | 83 ++++++++++++++++--- .../PhabricatorStorageManagementWorkflow.php | 2 +- src/view/phui/PHUIHeaderView.php | 2 +- 53 files changed, 217 insertions(+), 142 deletions(-) diff --git a/scripts/symbols/import_repository_symbols.php b/scripts/symbols/import_repository_symbols.php index 2ac2b3c8a9..c8dabc8508 100755 --- a/scripts/symbols/import_repository_symbols.php +++ b/scripts/symbols/import_repository_symbols.php @@ -102,7 +102,7 @@ function commit_symbols( $repository->getPHID()); } - echo pht('Loading %s symbols...', new PhutilNumber(count($sql))), "\n"; + echo pht('Loading %s symbols...', phutil_count($sql)), "\n"; foreach (array_chunk($sql, 128) as $chunk) { queryfx( $conn_w, diff --git a/src/applications/auth/controller/config/PhabricatorAuthListController.php b/src/applications/auth/controller/config/PhabricatorAuthListController.php index 5be803b895..71aac9e185 100644 --- a/src/applications/auth/controller/config/PhabricatorAuthListController.php +++ b/src/applications/auth/controller/config/PhabricatorAuthListController.php @@ -109,7 +109,7 @@ final class PhabricatorAuthListController 'only users with a verified email address at one of these %s '. 'allowed domain(s) will be able to register an account: %s', $domains_link, - new PhutilNumber(count($domains_value)), + phutil_count($domains_value), phutil_tag('strong', array(), implode(', ', $domains_value))); } else { $issues[] = pht( diff --git a/src/applications/auth/management/PhabricatorAuthManagementRefreshWorkflow.php b/src/applications/auth/management/PhabricatorAuthManagementRefreshWorkflow.php index 23c0a109cb..fb82d55439 100644 --- a/src/applications/auth/management/PhabricatorAuthManagementRefreshWorkflow.php +++ b/src/applications/auth/management/PhabricatorAuthManagementRefreshWorkflow.php @@ -78,7 +78,7 @@ final class PhabricatorAuthManagementRefreshWorkflow "%s\n", pht( 'Found %s account(s) to refresh.', - new PhutilNumber(count($accounts)))); + phutil_count($accounts))); } $providers = PhabricatorAuthProvider::getAllEnabledProviders(); diff --git a/src/applications/celerity/management/CelerityManagementMapWorkflow.php b/src/applications/celerity/management/CelerityManagementMapWorkflow.php index 525a079f53..e838de58f4 100644 --- a/src/applications/celerity/management/CelerityManagementMapWorkflow.php +++ b/src/applications/celerity/management/CelerityManagementMapWorkflow.php @@ -18,7 +18,7 @@ final class CelerityManagementMapWorkflow $this->log( pht( 'Rebuilding %d resource source(s).', - new PhutilNumber(count($resources_map)))); + phutil_count($resources_map))); foreach ($resources_map as $name => $resources) { $this->rebuildResources($resources); diff --git a/src/applications/config/check/PhabricatorDaemonsSetupCheck.php b/src/applications/config/check/PhabricatorDaemonsSetupCheck.php index 3b4b335134..a89590cc18 100644 --- a/src/applications/config/check/PhabricatorDaemonsSetupCheck.php +++ b/src/applications/config/check/PhabricatorDaemonsSetupCheck.php @@ -115,7 +115,7 @@ final class PhabricatorDaemonsSetupCheck extends PhabricatorSetupCheck { $list_section = array( pht( 'The configurations differ in the following %s way(s):', - new PhutilNumber(count($issues))), + phutil_count($issues)), phutil_tag( 'ul', array(), diff --git a/src/applications/config/check/PhabricatorPathSetupCheck.php b/src/applications/config/check/PhabricatorPathSetupCheck.php index 618c81abb9..9f5502e215 100644 --- a/src/applications/config/check/PhabricatorPathSetupCheck.php +++ b/src/applications/config/check/PhabricatorPathSetupCheck.php @@ -111,7 +111,7 @@ final class PhabricatorPathSetupCheck extends PhabricatorSetupCheck { $this ->newIssue('config.PATH.'.$digest) - ->setName(pht('$PATH Component Unusable')) + ->setName(pht('%s Component Unusable', '$PATH')) ->setSummary( pht( 'A component of the configured PATH can not be used by '. diff --git a/src/applications/config/view/PhabricatorSetupIssueView.php b/src/applications/config/view/PhabricatorSetupIssueView.php index 7ece4f865c..cb8859bb86 100644 --- a/src/applications/config/view/PhabricatorSetupIssueView.php +++ b/src/applications/config/view/PhabricatorSetupIssueView.php @@ -387,7 +387,7 @@ final class PhabricatorSetupIssueView extends AphrontView { array(), pht( 'PHP also loaded these %s configuration file(s):', - new PhutilNumber(count($more_loc)))); + phutil_count($more_loc))); $info[] = phutil_tag( 'pre', array(), diff --git a/src/applications/conpherence/conduit/ConpherenceUpdateThreadConduitAPIMethod.php b/src/applications/conpherence/conduit/ConpherenceUpdateThreadConduitAPIMethod.php index c7ea1405cd..d5f3267a06 100644 --- a/src/applications/conpherence/conduit/ConpherenceUpdateThreadConduitAPIMethod.php +++ b/src/applications/conpherence/conduit/ConpherenceUpdateThreadConduitAPIMethod.php @@ -29,14 +29,13 @@ final class ConpherenceUpdateThreadConduitAPIMethod protected function defineErrorTypes() { return array( 'ERR_USAGE_NO_ROOM_ID' => pht( - 'You must specify a room id or room phid to query transactions '. - 'from.'), + 'You must specify a room ID or room PHID to query transactions from.'), 'ERR_USAGE_ROOM_NOT_FOUND' => pht( - 'room does not exist or logged in user can not see it.'), + 'Room does not exist or logged in user can not see it.'), 'ERR_USAGE_ONLY_SELF_REMOVE' => pht( 'Only a user can remove themselves from a room.'), 'ERR_USAGE_NO_UPDATES' => pht( - 'You must specify data that actually updates the conpherence.'), + 'You must specify data that actually updates the Conpherence.'), ); } diff --git a/src/applications/conpherence/controller/ConpherenceUpdateController.php b/src/applications/conpherence/controller/ConpherenceUpdateController.php index 6012c81437..1ab0923fc4 100644 --- a/src/applications/conpherence/controller/ConpherenceUpdateController.php +++ b/src/applications/conpherence/controller/ConpherenceUpdateController.php @@ -325,8 +325,7 @@ final class ConpherenceUpdateController $remove_person = $request->getStr('remove_person'); $participants = $conpherence->getParticipants(); - $message = pht( - 'Are you sure you want to leave this room?'); + $message = pht('Are you sure you want to leave this room?'); $test_conpherence = clone $conpherence; $test_conpherence->attachParticipants(array()); if (!PhabricatorPolicyFilter::hasCapability( @@ -334,17 +333,14 @@ final class ConpherenceUpdateController $test_conpherence, PhabricatorPolicyCapability::CAN_VIEW)) { if (count($participants) == 1) { - $message .= pht( - ' The room will be inaccessible forever and ever.'); + $message .= ' '.pht('The room will be inaccessible forever and ever.'); } else { - $message .= pht( - ' Someone else in the room can add you back later.'); + $message .= ' '.pht('Someone else in the room can add you back later.'); } } $body = phutil_tag( 'p', - array( - ), + array(), $message); require_celerity_resource('conpherence-update-css'); diff --git a/src/applications/conpherence/storage/ConpherenceTransaction.php b/src/applications/conpherence/storage/ConpherenceTransaction.php index ba49cdf9b4..062b9e4a9f 100644 --- a/src/applications/conpherence/storage/ConpherenceTransaction.php +++ b/src/applications/conpherence/storage/ConpherenceTransaction.php @@ -77,14 +77,14 @@ final class ConpherenceTransaction extends PhabricatorApplicationTransaction { count($rem)); } else if ($add) { $title = pht( - '%s added %d files(s).', + '%s added %s files(s).', $this->renderHandleLink($author_phid), - count($add)); + phutil_count($add)); } else { $title = pht( - '%s removed %d file(s).', + '%s removed %s file(s).', $this->renderHandleLink($author_phid), - count($rem)); + phutil_count($rem)); } return $title; break; diff --git a/src/applications/daemon/management/PhabricatorDaemonManagementWorkflow.php b/src/applications/daemon/management/PhabricatorDaemonManagementWorkflow.php index 1cfa2499b2..a2beba3cd2 100644 --- a/src/applications/daemon/management/PhabricatorDaemonManagementWorkflow.php +++ b/src/applications/daemon/management/PhabricatorDaemonManagementWorkflow.php @@ -226,7 +226,9 @@ abstract class PhabricatorDaemonManagementWorkflow // Retry without sudo $console->writeOut( "%s\n", - pht('sudo command failed. Starting daemon as current user.')); + pht( + '%s command failed. Starting daemon as current user.', + 'sudo')); $this->executeDaemonLaunchCommand( $command, $daemon_script_dir, @@ -265,8 +267,9 @@ abstract class PhabricatorDaemonManagementWorkflow if (preg_match('/sudo: a password is required/', $stderr)) { throw new Exception( pht( - 'sudo exited with a zero exit code, but emitted output '. - 'consistent with failure under OSX.')); + '%s exited with a zero exit code, but emitted output '. + 'consistent with failure under OSX.', + 'sudo')); } } } diff --git a/src/applications/differential/customfield/DifferentialJIRAIssuesField.php b/src/applications/differential/customfield/DifferentialJIRAIssuesField.php index 046539d0da..e40e34f4ad 100644 --- a/src/applications/differential/customfield/DifferentialJIRAIssuesField.php +++ b/src/applications/differential/customfield/DifferentialJIRAIssuesField.php @@ -218,21 +218,21 @@ final class DifferentialJIRAIssuesField return pht( '%s updated JIRA issue(s): added %d %s; removed %d %s.', $xaction->renderHandleLink($author_phid), - new PhutilNumber(count($add)), + phutil_count($add), implode(', ', $add), - new PhutilNumber(count($rem)), + phutil_count($rem), implode(', ', $rem)); } else if ($add) { return pht( '%s added %d JIRA issue(s): %s.', $xaction->renderHandleLink($author_phid), - new PhutilNumber(count($add)), + phutil_count($add), implode(', ', $add)); } else if ($rem) { return pht( '%s removed %d JIRA issue(s): %s.', $xaction->renderHandleLink($author_phid), - new PhutilNumber(count($rem)), + phutil_count($rem), implode(', ', $rem)); } diff --git a/src/applications/differential/customfield/DifferentialUnitField.php b/src/applications/differential/customfield/DifferentialUnitField.php index 3883baba86..17973be7a6 100644 --- a/src/applications/differential/customfield/DifferentialUnitField.php +++ b/src/applications/differential/customfield/DifferentialUnitField.php @@ -125,7 +125,7 @@ final class DifferentialUnitField )) + $groups; foreach ($groups as $result => $group) { - $count = new PhutilNumber(count($group)); + $count = phutil_count($group); switch ($result) { case ArcanistUnitTestResult::RESULT_PASS: $note[] = pht('%s Passed Test(s)', $count); diff --git a/src/applications/differential/herald/DifferentialReviewersHeraldAction.php b/src/applications/differential/herald/DifferentialReviewersHeraldAction.php index c568537f7c..5293af4311 100644 --- a/src/applications/differential/herald/DifferentialReviewersHeraldAction.php +++ b/src/applications/differential/herald/DifferentialReviewersHeraldAction.php @@ -135,12 +135,12 @@ abstract class DifferentialReviewersHeraldAction case self::DO_ADD_REVIEWERS: return pht( 'Added %s reviewer(s): %s.', - new PhutilNumber(count($data)), + phutil_count($data), $this->renderHandleList($data)); case self::DO_ADD_BLOCKING_REVIEWERS: return pht( 'Added %s blocking reviewer(s): %s.', - new PhutilNumber(count($data)), + phutil_count($data), $this->renderHandleList($data)); } } diff --git a/src/applications/differential/mail/DifferentialCreateMailReceiver.php b/src/applications/differential/mail/DifferentialCreateMailReceiver.php index c3198d3642..f5d9dc59f7 100644 --- a/src/applications/differential/mail/DifferentialCreateMailReceiver.php +++ b/src/applications/differential/mail/DifferentialCreateMailReceiver.php @@ -81,14 +81,14 @@ final class DifferentialCreateMailReceiver extends PhabricatorMailReceiver { } else { $subject = pht( 'Diff creation failed; see body for %s error(s).', - new PhutilNumber(count($errors))); + phutil_count($errors)); } $body = new PhabricatorMetaMTAMailBody(); $body->addRawSection($subject); if (count($diffs)) { $text_body = ''; $html_body = array(); - $body_label = pht('%s DIFF LINK(S)', new PhutilNumber(count($diffs))); + $body_label = pht('%s DIFF LINK(S)', phutil_count($diffs)); foreach ($diffs as $filename => $diff_uri) { $text_body .= $filename.': '.$diff_uri."\n"; $html_body[] = phutil_tag( @@ -105,7 +105,7 @@ final class DifferentialCreateMailReceiver extends PhabricatorMailReceiver { if (count($errors)) { $body_section = new PhabricatorMetaMTAMailSection(); - $body_label = pht('%s ERROR(S)', new PhutilNumber(count($errors))); + $body_label = pht('%s ERROR(S)', phutil_count($errors)); foreach ($errors as $error) { $body_section->addFragment($error); } diff --git a/src/applications/diffusion/herald/DiffusionAuditorsHeraldAction.php b/src/applications/diffusion/herald/DiffusionAuditorsHeraldAction.php index 32830cb673..a7dbdde682 100644 --- a/src/applications/diffusion/herald/DiffusionAuditorsHeraldAction.php +++ b/src/applications/diffusion/herald/DiffusionAuditorsHeraldAction.php @@ -68,7 +68,7 @@ abstract class DiffusionAuditorsHeraldAction case self::DO_ADD_AUDITORS: return pht( 'Added %s auditor(s): %s.', - new PhutilNumber(count($data)), + phutil_count($data), $this->renderHandleList($data)); } } diff --git a/src/applications/diviner/atomizer/DivinerPHPAtomizer.php b/src/applications/diviner/atomizer/DivinerPHPAtomizer.php index c22cb4bcc3..36616897f2 100644 --- a/src/applications/diviner/atomizer/DivinerPHPAtomizer.php +++ b/src/applications/diviner/atomizer/DivinerPHPAtomizer.php @@ -152,8 +152,8 @@ final class DivinerPHPAtomizer extends DivinerAtomizer { $atom->addWarning( pht( 'This call takes %s parameter(s), but only %s are documented.', - new PhutilNumber(count($params)), - new PhutilNumber(count($docs)))); + phutil_count($params), + phutil_count($docs))); } } diff --git a/src/applications/diviner/publisher/DivinerPublisher.php b/src/applications/diviner/publisher/DivinerPublisher.php index 401a1a331f..e5dcf695db 100644 --- a/src/applications/diviner/publisher/DivinerPublisher.php +++ b/src/applications/diviner/publisher/DivinerPublisher.php @@ -140,14 +140,14 @@ abstract class DivinerPublisher extends Phobject { "%s\n", pht( 'Deleting %s document(s).', - new PhutilNumber(count($deleted)))); + phutil_count($deleted))); $this->deleteDocumentsByHash($deleted); $console->writeOut( "%s\n", pht( 'Creating %s document(s).', - new PhutilNumber(count($created)))); + phutil_count($created))); $this->createDocumentsByHash($created); } diff --git a/src/applications/diviner/workflow/DivinerGenerateWorkflow.php b/src/applications/diviner/workflow/DivinerGenerateWorkflow.php index d448de69c0..ad671bbbea 100644 --- a/src/applications/diviner/workflow/DivinerGenerateWorkflow.php +++ b/src/applications/diviner/workflow/DivinerGenerateWorkflow.php @@ -69,7 +69,7 @@ final class DivinerGenerateWorkflow extends DivinerWorkflow { '.book', '--book ')); } else { - $this->log(pht('Found %s book(s).', new PhutilNumber(count($books)))); + $this->log(pht('Found %s book(s).', phutil_count($books))); } } @@ -224,26 +224,26 @@ final class DivinerGenerateWorkflow extends DivinerWorkflow { $this->log( pht( 'Found %s file(s) in project.', - new PhutilNumber(count($file_hashes)))); + phutil_count($file_hashes))); $this->deleteDeadAtoms($file_hashes); $atomize = $this->getFilesToAtomize($file_hashes); $this->log( pht( 'Found %s unatomized, uncached file(s).', - new PhutilNumber(count($atomize)))); + phutil_count($atomize))); $file_atomizers = $this->getAtomizersForFiles($atomize); $this->log( pht( 'Found %s file(s) to atomize.', - new PhutilNumber(count($file_atomizers)))); + phutil_count($file_atomizers))); $futures = $this->buildAtomizerFutures($file_atomizers); $this->log( pht( 'Atomizing %s file(s).', - new PhutilNumber(count($file_atomizers)))); + phutil_count($file_atomizers))); if ($futures) { $this->resolveAtomizerFutures($futures, $file_hashes); @@ -452,7 +452,7 @@ final class DivinerGenerateWorkflow extends DivinerWorkflow { $this->log( pht( 'Found %s obsolete atom(s) in graph.', - new PhutilNumber(count($del_atoms)))); + phutil_count($del_atoms))); foreach ($del_atoms as $nhash => $shash) { $atom_cache->deleteSymbol($nhash); @@ -466,7 +466,7 @@ final class DivinerGenerateWorkflow extends DivinerWorkflow { $this->log( pht( 'Found %s new atom(s) in graph.', - new PhutilNumber(count($new_atoms)))); + phutil_count($new_atoms))); foreach ($new_atoms as $nhash => $ignored) { $shash = $this->computeSymbolHash($nhash); @@ -505,7 +505,7 @@ final class DivinerGenerateWorkflow extends DivinerWorkflow { $this->log( pht( 'Found %s affected atoms.', - new PhutilNumber(count($dirty_nhashes)))); + phutil_count($dirty_nhashes))); foreach ($dirty_nhashes as $nhash => $ignored) { $atom_cache->addGraph($nhash, $this->computeGraphHash($nhash)); diff --git a/src/applications/doorkeeper/option/PhabricatorAsanaConfigOptions.php b/src/applications/doorkeeper/option/PhabricatorAsanaConfigOptions.php index f0cdb5a819..e7f2ef85de 100644 --- a/src/applications/doorkeeper/option/PhabricatorAsanaConfigOptions.php +++ b/src/applications/doorkeeper/option/PhabricatorAsanaConfigOptions.php @@ -96,8 +96,11 @@ final class PhabricatorAsanaConfigOptions } $out = array(); - $out[] = pht('| Workspace ID | Workspace Name |'); - $out[] = '| ------------ | -------------- |'; + $out[] = sprintf( + '| %s | %s |', + pht('Workspace ID'), + pht('Workspace Name')); + $out[] = '| ------------ | -------------- |'; foreach ($workspaces as $workspace) { $out[] = sprintf('| `%s` | `%s` |', $workspace['id'], $workspace['name']); } diff --git a/src/applications/files/storage/PhabricatorFile.php b/src/applications/files/storage/PhabricatorFile.php index 4ca26fc03b..f0a5f228e3 100644 --- a/src/applications/files/storage/PhabricatorFile.php +++ b/src/applications/files/storage/PhabricatorFile.php @@ -557,7 +557,7 @@ final class PhabricatorFile extends PhabricatorFileDAO 'Failed to fetch remote URI "%s" after following %s redirect(s) '. '(%s): %s', $uri, - new PhutilNumber(count($redirects)), + phutil_count($redirects), implode(' > ', array_keys($redirects)), $ex->getMessage()), $ex); diff --git a/src/applications/harbormaster/conduit/HarbormasterSendMessageConduitAPIMethod.php b/src/applications/harbormaster/conduit/HarbormasterSendMessageConduitAPIMethod.php index 3a2d808239..6d68b0a8b6 100644 --- a/src/applications/harbormaster/conduit/HarbormasterSendMessageConduitAPIMethod.php +++ b/src/applications/harbormaster/conduit/HarbormasterSendMessageConduitAPIMethod.php @@ -37,7 +37,7 @@ final class HarbormasterSendMessageConduitAPIMethod $unit_spec = HarbormasterBuildUnitMessage::getParameterSpec(); foreach ($unit_spec as $key => $parameter) { $type = idx($parameter, 'type'); - $type = str_replace('|', pht(' or '), $type); + $type = str_replace('|', ' '.pht('or').' ', $type); $description = idx($parameter, 'description'); $rows[] = "| `{$key}` | //{$type}// | {$description} |"; } @@ -61,7 +61,7 @@ final class HarbormasterSendMessageConduitAPIMethod $lint_spec = HarbormasterBuildLintMessage::getParameterSpec(); foreach ($lint_spec as $key => $parameter) { $type = idx($parameter, 'type'); - $type = str_replace('|', pht(' or '), $type); + $type = str_replace('|', ' '.pht('or').' ', $type); $description = idx($parameter, 'description'); $rows[] = "| `{$key}` | //{$type}// | {$description} |"; } diff --git a/src/applications/harbormaster/controller/HarbormasterBuildViewController.php b/src/applications/harbormaster/controller/HarbormasterBuildViewController.php index 1d655bb2e0..363a05776e 100644 --- a/src/applications/harbormaster/controller/HarbormasterBuildViewController.php +++ b/src/applications/harbormaster/controller/HarbormasterBuildViewController.php @@ -377,7 +377,7 @@ final class HarbormasterBuildViewController array( pht( '%s empty logs are hidden.', - new PhutilNumber(count($empty_logs))), + phutil_count($empty_logs)), ' ', javelin_tag( 'a', diff --git a/src/applications/harbormaster/controller/HarbormasterStepEditController.php b/src/applications/harbormaster/controller/HarbormasterStepEditController.php index 37bef5f411..f15a3235b9 100644 --- a/src/applications/harbormaster/controller/HarbormasterStepEditController.php +++ b/src/applications/harbormaster/controller/HarbormasterStepEditController.php @@ -231,7 +231,10 @@ final class HarbormasterStepEditController extends HarbormasterController { 'The following variables can be used in most fields. '. 'To reference a variable, use `%s` in a field.', '${name}'); - $rows[] = pht('| Variable | Description |'); + $rows[] = sprintf( + '| %s | %s |', + pht('Variable'), + pht('Description')); $rows[] = '|---|---|'; foreach ($variables as $name => $description) { $rows[] = '| `'.$name.'` | '.$description.' |'; diff --git a/src/applications/harbormaster/herald/HarbormasterRunBuildPlansHeraldAction.php b/src/applications/harbormaster/herald/HarbormasterRunBuildPlansHeraldAction.php index db75b36d2f..de399e5976 100644 --- a/src/applications/harbormaster/herald/HarbormasterRunBuildPlansHeraldAction.php +++ b/src/applications/harbormaster/herald/HarbormasterRunBuildPlansHeraldAction.php @@ -54,7 +54,7 @@ final class HarbormasterRunBuildPlansHeraldAction case self::DO_BUILD: return pht( 'Started %s build(s): %s.', - new PhutilNumber(count($data)), + phutil_count($data), $this->renderHandleList($data)); } } diff --git a/src/applications/herald/action/HeraldAction.php b/src/applications/herald/action/HeraldAction.php index f4217cd4db..6b076fbddf 100644 --- a/src/applications/herald/action/HeraldAction.php +++ b/src/applications/herald/action/HeraldAction.php @@ -346,22 +346,22 @@ abstract class HeraldAction extends Phobject { case self::DO_STANDARD_NO_EFFECT: return pht( 'This action has no effect on %s target(s): %s.', - new PhutilNumber(count($data)), + phutil_count($data), $this->renderHandleList($data)); case self::DO_STANDARD_INVALID: return pht( '%s target(s) are invalid or of the wrong type: %s.', - new PhutilNumber(count($data)), + phutil_count($data), $this->renderHandleList($data)); case self::DO_STANDARD_UNLOADABLE: return pht( '%s target(s) could not be loaded: %s.', - new PhutilNumber(count($data)), + phutil_count($data), $this->renderHandleList($data)); case self::DO_STANDARD_PERMISSION: return pht( '%s target(s) do not have permission to see this object: %s.', - new PhutilNumber(count($data)), + phutil_count($data), $this->renderHandleList($data)); case self::DO_STANDARD_INVALID_ACTION: return pht( diff --git a/src/applications/legalpad/herald/LegalpadRequireSignatureHeraldAction.php b/src/applications/legalpad/herald/LegalpadRequireSignatureHeraldAction.php index 22d41449ad..7ff69d37d5 100644 --- a/src/applications/legalpad/herald/LegalpadRequireSignatureHeraldAction.php +++ b/src/applications/legalpad/herald/LegalpadRequireSignatureHeraldAction.php @@ -95,12 +95,12 @@ final class LegalpadRequireSignatureHeraldAction case self::DO_SIGNED: return pht( '%s document(s) are already signed: %s.', - new PhutilNumber(count($data)), + phutil_count($data), $this->renderHandleList($data)); case self::DO_REQUIRED: return pht( 'Required %s signature(s): %s.', - new PhutilNumber(count($data)), + phutil_count($data), $this->renderHandleList($data)); } } diff --git a/src/applications/maniphest/storage/ManiphestTransaction.php b/src/applications/maniphest/storage/ManiphestTransaction.php index a05cf1ab13..0456673a10 100644 --- a/src/applications/maniphest/storage/ManiphestTransaction.php +++ b/src/applications/maniphest/storage/ManiphestTransaction.php @@ -546,23 +546,23 @@ final class ManiphestTransaction $removed = array_diff($old, $new); if ($added && !$removed) { return pht( - '%s attached %d file(s): %s.', + '%s attached %s file(s): %s.', $this->renderHandleLink($author_phid), - count($added), + phutil_count($added), $this->renderHandleList($added)); } else if ($removed && !$added) { return pht( - '%s detached %d file(s): %s.', + '%s detached %s file(s): %s.', $this->renderHandleLink($author_phid), - count($removed), + phutil_count($removed), $this->renderHandleList($removed)); } else { return pht( - '%s changed file(s), attached %d: %s; detached %d: %s.', + '%s changed file(s), attached %s: %s; detached %s: %s.', $this->renderHandleLink($author_phid), - count($added), + phutil_count($added), $this->renderHandleList($added), - count($removed), + phutil_count($removed), $this->renderHandleList($removed)); } @@ -585,9 +585,9 @@ final class ManiphestTransaction case self::TYPE_MERGED_FROM: return pht( - '%s merged %d task(s): %s.', + '%s merged %s task(s): %s.', $this->renderHandleLink($author_phid), - count($new), + phutil_count($new), $this->renderHandleList($new)); break; diff --git a/src/applications/maniphest/view/ManiphestTaskResultListView.php b/src/applications/maniphest/view/ManiphestTaskResultListView.php index cd05d7f7f7..52f4a3b2d6 100644 --- a/src/applications/maniphest/view/ManiphestTaskResultListView.php +++ b/src/applications/maniphest/view/ManiphestTaskResultListView.php @@ -82,7 +82,7 @@ final class ManiphestTaskResultListView extends ManiphestView { $header = id(new PHUIHeaderView()) ->addSigil('task-group') ->setMetadata(array('priority' => head($list)->getPriority())) - ->setHeader(pht('%s (%s)', $group, new PhutilNumber(count($list)))); + ->setHeader(pht('%s (%s)', $group, phutil_count($list))); $lists[] = id(new PHUIObjectBoxView()) ->setHeader($header) diff --git a/src/applications/metamta/herald/PhabricatorMetaMTAEmailHeraldAction.php b/src/applications/metamta/herald/PhabricatorMetaMTAEmailHeraldAction.php index ec7036ebe0..2b29fe2443 100644 --- a/src/applications/metamta/herald/PhabricatorMetaMTAEmailHeraldAction.php +++ b/src/applications/metamta/herald/PhabricatorMetaMTAEmailHeraldAction.php @@ -75,13 +75,13 @@ abstract class PhabricatorMetaMTAEmailHeraldAction case self::DO_SEND: return pht( 'Queued email to be delivered to %s target(s): %s.', - new PhutilNumber(count($data)), + phutil_count($data), $this->renderHandleList($data)); case self::DO_FORCE: return pht( 'Queued email to be delivered to %s target(s), ignoring their '. 'notification preferences: %s.', - new PhutilNumber(count($data)), + phutil_count($data), $this->renderHandleList($data)); } } diff --git a/src/applications/multimeter/controller/MultimeterSampleController.php b/src/applications/multimeter/controller/MultimeterSampleController.php index a62d10ef30..f9a36b37d1 100644 --- a/src/applications/multimeter/controller/MultimeterSampleController.php +++ b/src/applications/multimeter/controller/MultimeterSampleController.php @@ -90,7 +90,7 @@ final class MultimeterSampleController extends MultimeterController { $events_col = $this->renderGroupingLink( $group, 'id', - pht('%s Events', new PhutilNumber($row['N']))); + pht('%s Event(s)', new PhutilNumber($row['N']))); } if (isset($group['request'])) { diff --git a/src/applications/people/controller/PhabricatorPeopleDeleteController.php b/src/applications/people/controller/PhabricatorPeopleDeleteController.php index e95dd4c646..01b37b37fe 100644 --- a/src/applications/people/controller/PhabricatorPeopleDeleteController.php +++ b/src/applications/people/controller/PhabricatorPeopleDeleteController.php @@ -49,9 +49,9 @@ final class PhabricatorPeopleDeleteController $form = id(new AphrontFormView()) ->setUser($admin) ->appendRemarkupInstructions( - pht( - " phabricator/ $ ./bin/remove destroy %s\n", - csprintf('%R', '@'.$user->getUsername()))); + csprintf( + " phabricator/ $ ./bin/remove destroy %R\n", + '@'.$user->getUsername())); return $this->newDialog() ->setWidth(AphrontDialogView::WIDTH_FORM) diff --git a/src/applications/pholio/view/PholioMockThumbGridView.php b/src/applications/pholio/view/PholioMockThumbGridView.php index d7d174d928..6467106c14 100644 --- a/src/applications/pholio/view/PholioMockThumbGridView.php +++ b/src/applications/pholio/view/PholioMockThumbGridView.php @@ -156,7 +156,7 @@ final class PholioMockThumbGridView extends AphrontView { array( 'class' => 'pholio-mock-thumb-grid-comment-count', ), - pht('%s', new PhutilNumber(count($image->getInlineComments())))); + pht('%s', phutil_count($image->getInlineComments()))); } return javelin_tag( diff --git a/src/applications/phragment/controller/PhragmentController.php b/src/applications/phragment/controller/PhragmentController.php index a96c25878e..c08adcecc6 100644 --- a/src/applications/phragment/controller/PhragmentController.php +++ b/src/applications/phragment/controller/PhragmentController.php @@ -199,7 +199,9 @@ abstract class PhragmentController extends PhabricatorController { $alt = PhabricatorEnv::getEnvConfig('security.alternate-file-domain'); if ($alt === null) { return id(new PHUIInfoView()) - ->setTitle(pht('security.alternate-file-domain must be configured!')) + ->setTitle(pht( + '%s must be configured!', + 'security.alternate-file-domain')) ->setSeverity(PHUIInfoView::SEVERITY_ERROR) ->appendChild( phutil_tag( diff --git a/src/applications/ponder/controller/PonderQuestionViewController.php b/src/applications/ponder/controller/PonderQuestionViewController.php index f7e70caab0..0e92f8e90c 100644 --- a/src/applications/ponder/controller/PonderQuestionViewController.php +++ b/src/applications/ponder/controller/PonderQuestionViewController.php @@ -292,7 +292,9 @@ final class PonderQuestionViewController extends PonderController { $item->setObject($question); $item->addAttribute( - pht('%d Answer(s)', $question->getAnswerCount())); + pht( + '%s Answer(s)', + new PhutilNumber($question->getAnswerCount()))); $list->addItem($item); } diff --git a/src/applications/ponder/query/PonderQuestionSearchEngine.php b/src/applications/ponder/query/PonderQuestionSearchEngine.php index 6692d8282a..c16c5442db 100644 --- a/src/applications/ponder/query/PonderQuestionSearchEngine.php +++ b/src/applications/ponder/query/PonderQuestionSearchEngine.php @@ -134,11 +134,11 @@ final class PonderQuestionSearchEngine foreach ($questions as $question) { $color = PonderQuestionStatus::getQuestionStatusTagColor( - $question->getStatus()); + $question->getStatus()); $icon = PonderQuestionStatus::getQuestionStatusIcon( - $question->getStatus()); + $question->getStatus()); $full_status = PonderQuestionStatus::getQuestionStatusFullName( - $question->getStatus()); + $question->getStatus()); $item = new PHUIObjectItemView(); $item->setObjectName('Q'.$question->getID()); $item->setHeader($question->getTitle()); @@ -158,7 +158,9 @@ final class PonderQuestionSearchEngine $handles[$question->getAuthorPHID()]->renderLink())); $item->addAttribute( - pht('%d Answer(s)', $question->getAnswerCount())); + pht( + '%s Answer(s)', + new PhutilNumber($question->getAnswerCount()))); if ($project_handles) { $item->addAttribute( diff --git a/src/applications/project/herald/PhabricatorProjectHeraldAction.php b/src/applications/project/herald/PhabricatorProjectHeraldAction.php index a720ebe5b0..3459da92cc 100644 --- a/src/applications/project/herald/PhabricatorProjectHeraldAction.php +++ b/src/applications/project/herald/PhabricatorProjectHeraldAction.php @@ -112,12 +112,12 @@ abstract class PhabricatorProjectHeraldAction case self::DO_ADD_PROJECTS: return pht( 'Added %s project(s): %s.', - new PhutilNumber(count($data)), + phutil_count($data), $this->renderHandleList($data)); case self::DO_REMOVE_PROJECTS: return pht( 'Removed %s project(s): %s.', - new PhutilNumber(count($data)), + phutil_count($data), $this->renderHandleList($data)); } } diff --git a/src/applications/releeph/controller/product/ReleephProductEditController.php b/src/applications/releeph/controller/product/ReleephProductEditController.php index 7fd8e81563..6a58a39bd9 100644 --- a/src/applications/releeph/controller/product/ReleephProductEditController.php +++ b/src/applications/releeph/controller/product/ReleephProductEditController.php @@ -49,7 +49,7 @@ final class ReleephProductEditController extends ReleephProductController { if (!$product_name) { $e_name = pht('Required'); $errors[] = - pht('Your releeph product should have a simple descriptive name.'); + pht('Your Releeph product should have a simple descriptive name.'); } if (!$trunk_branch) { diff --git a/src/applications/releeph/field/specification/ReleephDiffChurnFieldSpecification.php b/src/applications/releeph/field/specification/ReleephDiffChurnFieldSpecification.php index 18c3c78c87..112ef09885 100644 --- a/src/applications/releeph/field/specification/ReleephDiffChurnFieldSpecification.php +++ b/src/applications/releeph/field/specification/ReleephDiffChurnFieldSpecification.php @@ -31,6 +31,7 @@ final class ReleephDiffChurnFieldSpecification $rejections = 0; $comments = 0; $updates = 0; + foreach ($xactions as $xaction) { switch ($xaction->getTransactionType()) { case PhabricatorTransactions::TYPE_COMMENT: @@ -60,13 +61,13 @@ final class ReleephDiffChurnFieldSpecification } else { $parts = array(); if ($rejections) { - $parts[] = pht('%d rejection(s)', $rejections); + $parts[] = pht('%s rejection(s)', new PhutilNumber($rejections)); } if ($comments) { - $parts[] = pht('%d comment(s)', $comments); + $parts[] = pht('%s comment(s)', new PhutilNumber($comments)); } if ($updates) { - $parts[] = pht('%d update(s)', $updates); + $parts[] = pht('%s update(s)', new PhutilNumber($updates)); } if (count($parts) === 0) { diff --git a/src/applications/releeph/field/specification/ReleephDiffSizeFieldSpecification.php b/src/applications/releeph/field/specification/ReleephDiffSizeFieldSpecification.php index fe1a39277c..5975f208e6 100644 --- a/src/applications/releeph/field/specification/ReleephDiffSizeFieldSpecification.php +++ b/src/applications/releeph/field/specification/ReleephDiffSizeFieldSpecification.php @@ -55,7 +55,7 @@ final class ReleephDiffSizeFieldSpecification $mr_changes['tests']['lines'], count($mr_changes['tests']['paths'])); foreach ($mr_changes['tests']['paths'] as $mr_test_path) { - $test_blurb .= pht("%s\n", $mr_test_path); + $test_blurb .= sprintf("%s\n", $mr_test_path); } $test_tag = javelin_tag( diff --git a/src/applications/releeph/query/ReleephBranchSearchEngine.php b/src/applications/releeph/query/ReleephBranchSearchEngine.php index cbe5da5339..68ec126eb5 100644 --- a/src/applications/releeph/query/ReleephBranchSearchEngine.php +++ b/src/applications/releeph/query/ReleephBranchSearchEngine.php @@ -182,7 +182,9 @@ final class ReleephBranchSearchEngine $item->setStatusIcon('fa-code-fork orange'); $item->addIcon( 'fa-code-fork', - pht('%d Open Pull Request(s)', new PhutilNumber($open_count))); + pht( + '%s Open Pull Request(s)', + new PhutilNumber($open_count))); } $list->addItem($item); diff --git a/src/applications/repository/daemon/PhabricatorRepositoryPullLocalDaemon.php b/src/applications/repository/daemon/PhabricatorRepositoryPullLocalDaemon.php index 3ed78f5161..bccb58e35a 100644 --- a/src/applications/repository/daemon/PhabricatorRepositoryPullLocalDaemon.php +++ b/src/applications/repository/daemon/PhabricatorRepositoryPullLocalDaemon.php @@ -172,7 +172,7 @@ final class PhabricatorRepositoryPullLocalDaemon pht( 'Not enough process slots to schedule the other %s '. 'repository(s) for updates yet.', - new PhutilNumber(count($queue)))); + phutil_count($queue))); } if ($futures) { diff --git a/src/applications/repository/management/PhabricatorRepositoryManagementParentsWorkflow.php b/src/applications/repository/management/PhabricatorRepositoryManagementParentsWorkflow.php index 3cbbf5b5bf..61c5fedf96 100644 --- a/src/applications/repository/management/PhabricatorRepositoryManagementParentsWorkflow.php +++ b/src/applications/repository/management/PhabricatorRepositoryManagementParentsWorkflow.php @@ -91,7 +91,7 @@ final class PhabricatorRepositoryManagementParentsWorkflow "%s\n", pht( 'Found %s total commit(s); updating...', - new PhutilNumber(count($graph)))); + phutil_count($graph))); $commit_table = id(new PhabricatorRepositoryCommit()); $commit_table_name = $commit_table->getTableName(); diff --git a/src/applications/repository/management/PhabricatorRepositoryManagementReparseWorkflow.php b/src/applications/repository/management/PhabricatorRepositoryManagementReparseWorkflow.php index d36fb3f4ee..524cc606aa 100644 --- a/src/applications/repository/management/PhabricatorRepositoryManagementReparseWorkflow.php +++ b/src/applications/repository/management/PhabricatorRepositoryManagementReparseWorkflow.php @@ -260,11 +260,12 @@ final class PhabricatorRepositoryManagementReparseWorkflow if ($all_from_repo && !$force_local) { $console->writeOut("%s\n", pht( - '**NOTE**: This script will queue tasks to reparse the data. Once the '. - 'tasks have been queued, you need to run Taskmaster daemons to '. - 'execute them.'."\n\n". - "QUEUEING TASKS (%s Commits):", - new PhutilNumber(count($commits)))); + "**NOTE**: This script will queue tasks to reparse the data. Once the ". + "tasks have been queued, you need to run Taskmaster daemons to ". + "execute them.\n\n%s", + pht( + 'QUEUEING TASKS (%s Commit(s)):', + phutil_count($commits)))); } $progress = new PhutilConsoleProgressBar(); diff --git a/src/applications/subscriptions/herald/PhabricatorSubscriptionsHeraldAction.php b/src/applications/subscriptions/herald/PhabricatorSubscriptionsHeraldAction.php index 6ec7b6f776..bf0df4fd97 100644 --- a/src/applications/subscriptions/herald/PhabricatorSubscriptionsHeraldAction.php +++ b/src/applications/subscriptions/herald/PhabricatorSubscriptionsHeraldAction.php @@ -163,22 +163,22 @@ abstract class PhabricatorSubscriptionsHeraldAction return pht( 'Declined to resubscribe %s target(s) because they previously '. 'unsubscribed: %s.', - new PhutilNumber(count($data)), + phutil_count($data), $this->renderHandleList($data)); case self::DO_AUTOSUBSCRIBED: return pht( '%s automatically subscribed target(s) were not affected: %s.', - new PhutilNumber(count($data)), + phutil_count($data), $this->renderHandleList($data)); case self::DO_SUBSCRIBED: return pht( 'Added %s subscriber(s): %s.', - new PhutilNumber(count($data)), + phutil_count($data), $this->renderHandleList($data)); case self::DO_UNSUBSCRIBED: return pht( 'Removed %s subscriber(s): %s.', - new PhutilNumber(count($data)), + phutil_count($data), $this->renderHandleList($data)); } } diff --git a/src/applications/system/management/PhabricatorSystemRemoveDestroyWorkflow.php b/src/applications/system/management/PhabricatorSystemRemoveDestroyWorkflow.php index 2abbc52691..baaf4f7af9 100644 --- a/src/applications/system/management/PhabricatorSystemRemoveDestroyWorkflow.php +++ b/src/applications/system/management/PhabricatorSystemRemoveDestroyWorkflow.php @@ -119,7 +119,7 @@ EOBANNER; $console->writeOut( pht( 'These %s object(s) will be destroyed forever:', - new PhutilNumber(count($named_objects)))."\n\n"); + phutil_count($named_objects))."\n\n"); foreach ($named_objects as $object_name => $object) { $phid = $object->getPHID(); @@ -136,7 +136,7 @@ EOBANNER; $ok = $console->confirm( pht( 'Are you absolutely certain you want to destroy these %s object(s)?', - new PhutilNumber(count($named_objects)))); + phutil_count($named_objects))); if (!$ok) { throw new PhutilArgumentUsageException( pht('Aborted, your objects are safe.')); @@ -160,7 +160,7 @@ EOBANNER; "%s\n", pht( 'Permanently destroyed %s object(s).', - new PhutilNumber(count($named_objects)))); + phutil_count($named_objects))); return 0; } diff --git a/src/applications/transactions/response/PhabricatorApplicationTransactionNoEffectResponse.php b/src/applications/transactions/response/PhabricatorApplicationTransactionNoEffectResponse.php index c5af940f41..c4f6defc21 100644 --- a/src/applications/transactions/response/PhabricatorApplicationTransactionNoEffectResponse.php +++ b/src/applications/transactions/response/PhabricatorApplicationTransactionNoEffectResponse.php @@ -32,16 +32,16 @@ final class PhabricatorApplicationTransactionNoEffectResponse $only_empty_comment = (count($xactions) == 1) && (head($xactions)->getTransactionType() == $type_comment); - $count = new PhutilNumber(count($xactions)); + $count = phutil_count($xactions); if ($ex->hasAnyEffect()) { - $title = pht('%d Action(s) With No Effect', $count); - $head = pht('Some of your %d action(s) have no effect:', $count); + $title = pht('%s Action(s) With No Effect', $count); + $head = pht('Some of your %s action(s) have no effect:', $count); $tail = pht('Apply remaining actions?'); $continue = pht('Apply Remaining Actions'); } else if ($ex->hasComment()) { $title = pht('Post as Comment'); - $head = pht('The %d action(s) you are taking have no effect:', $count); + $head = pht('The %s action(s) you are taking have no effect:', $count); $tail = pht('Do you want to post your comment anyway?'); $continue = pht('Post Comment'); } else if ($only_empty_comment) { @@ -52,8 +52,8 @@ final class PhabricatorApplicationTransactionNoEffectResponse $tail = null; $continue = null; } else { - $title = pht('%d Action(s) Have No Effect', $count); - $head = pht('The %d action(s) you are taking have no effect:', $count); + $title = pht('%s Action(s) Have No Effect', $count); + $head = pht('The %s action(s) you are taking have no effect:', $count); $tail = null; $continue = null; } diff --git a/src/applications/transactions/storage/PhabricatorApplicationTransaction.php b/src/applications/transactions/storage/PhabricatorApplicationTransaction.php index e33049dcc7..a61de01978 100644 --- a/src/applications/transactions/storage/PhabricatorApplicationTransaction.php +++ b/src/applications/transactions/storage/PhabricatorApplicationTransaction.php @@ -710,19 +710,19 @@ abstract class PhabricatorApplicationTransaction return $type_obj->getTransactionEditString( $this->renderHandleLink($author_phid), new PhutilNumber(count($add) + count($rem)), - new PhutilNumber(count($add)), + phutil_count($add), $this->renderHandleList($add), - new PhutilNumber(count($rem)), + phutil_count($rem), $this->renderHandleList($rem)); } else if ($add) { return $type_obj->getTransactionAddString( $this->renderHandleLink($author_phid), - new PhutilNumber(count($add)), + phutil_count($add), $this->renderHandleList($add)); } else if ($rem) { return $type_obj->getTransactionRemoveString( $this->renderHandleLink($author_phid), - new PhutilNumber(count($rem)), + phutil_count($rem), $this->renderHandleList($rem)); } else { return $type_obj->getTransactionPreviewString( @@ -871,21 +871,21 @@ abstract class PhabricatorApplicationTransaction $this->renderHandleLink($author_phid), $this->renderHandleLink($object_phid), new PhutilNumber(count($add) + count($rem)), - new PhutilNumber(count($add)), + phutil_count($add), $this->renderHandleList($add), - new PhutilNumber(count($rem)), + phutil_count($rem), $this->renderHandleList($rem)); } else if ($add) { return $type_obj->getFeedAddString( $this->renderHandleLink($author_phid), $this->renderHandleLink($object_phid), - new PhutilNumber(count($add)), + phutil_count($add), $this->renderHandleList($add)); } else if ($rem) { return $type_obj->getFeedRemoveString( $this->renderHandleLink($author_phid), $this->renderHandleLink($object_phid), - new PhutilNumber(count($rem)), + phutil_count($rem), $this->renderHandleList($rem)); } else { return pht( diff --git a/src/infrastructure/customfield/standard/PhabricatorStandardCustomFieldPHIDs.php b/src/infrastructure/customfield/standard/PhabricatorStandardCustomFieldPHIDs.php index 81b94aff31..4c3159a621 100644 --- a/src/infrastructure/customfield/standard/PhabricatorStandardCustomFieldPHIDs.php +++ b/src/infrastructure/customfield/standard/PhabricatorStandardCustomFieldPHIDs.php @@ -117,23 +117,23 @@ abstract class PhabricatorStandardCustomFieldPHIDs '%s updated %s, added %d: %s.', $xaction->renderHandleLink($author_phid), $this->getFieldName(), - new PhutilNumber(count($add)), + phutil_count($add), $xaction->renderHandleList($add)); } else if ($rem && !$add) { return pht( - '%s updated %s, removed %d: %s.', + '%s updated %s, removed %s: %s.', $xaction->renderHandleLink($author_phid), $this->getFieldName(), - new PhutilNumber(count($rem)), + phutil_count($rem), $xaction->renderHandleList($rem)); } else { return pht( - '%s updated %s, added %d: %s; removed %d: %s.', + '%s updated %s, added %s: %s; removed %s: %s.', $xaction->renderHandleLink($author_phid), $this->getFieldName(), - new PhutilNumber(count($add)), + phutil_count($add), $xaction->renderHandleList($add), - new PhutilNumber(count($rem)), + phutil_count($rem), $xaction->renderHandleList($rem)); } } diff --git a/src/infrastructure/internationalization/management/PhabricatorInternationalizationManagementExtractWorkflow.php b/src/infrastructure/internationalization/management/PhabricatorInternationalizationManagementExtractWorkflow.php index 3554a113ed..b22040de1a 100644 --- a/src/infrastructure/internationalization/management/PhabricatorInternationalizationManagementExtractWorkflow.php +++ b/src/infrastructure/internationalization/management/PhabricatorInternationalizationManagementExtractWorkflow.php @@ -37,7 +37,7 @@ final class PhabricatorInternationalizationManagementExtractWorkflow $console->writeOut( "%s\n", - pht('Found %s file(s)...', new PhutilNumber(count($futures)))); + pht('Found %s file(s)...', phutil_count($futures))); $results = array(); diff --git a/src/infrastructure/internationalization/translation/PhabricatorUSEnglishTranslation.php b/src/infrastructure/internationalization/translation/PhabricatorUSEnglishTranslation.php index 5d3dc359d0..2fe8dd26c0 100644 --- a/src/infrastructure/internationalization/translation/PhabricatorUSEnglishTranslation.php +++ b/src/infrastructure/internationalization/translation/PhabricatorUSEnglishTranslation.php @@ -32,7 +32,7 @@ final class PhabricatorUSEnglishTranslation '%d path(s)' => array('%d path', '%d paths'), '%d diff(s)' => array('%d diff', '%d diffs'), - '%d Answer(s)' => array('%d Answer', '%d Answers'), + '%s Answer(s)' => array('%s Answer', '%s Answers'), 'Show %d Comment(s)' => array('Show %d Comment', 'Show %d Comments'), '%s DIFF LINK(S)' => array('DIFF LINK', 'DIFF LINKS'), @@ -114,17 +114,17 @@ final class PhabricatorUSEnglishTranslation 'This is a binary file. It is %s bytes in length.', ), - '%d Action(s) Have No Effect' => array( + '%s Action(s) Have No Effect' => array( 'Action Has No Effect', 'Actions Have No Effect', ), - '%d Action(s) With No Effect' => array( + '%s Action(s) With No Effect' => array( 'Action With No Effect', 'Actions With No Effect', ), - 'Some of your %d action(s) have no effect:' => array( + 'Some of your %s action(s) have no effect:' => array( 'One of your actions has no effect:', 'Some of your actions have no effect:', ), @@ -139,7 +139,7 @@ final class PhabricatorUSEnglishTranslation 'Apply Remaining Actions', ), - 'The %d action(s) you are taking have no effect:' => array( + 'The %s action(s) you are taking have no effect:' => array( 'The action you are taking has no effect:', 'The actions you are taking have no effect:', ), @@ -550,9 +550,9 @@ final class PhabricatorUSEnglishTranslation ), ), - '%d comment(s)' => array('%d comment', '%d comments'), - '%d rejection(s)' => array('%d rejection', '%d rejections'), - '%d update(s)' => array('%d update', '%d updates'), + '%s comment(s)' => array('%s comment', '%s comments'), + '%s rejection(s)' => array('%s rejection', '%s rejections'), + '%s update(s)' => array('%s update', '%s updates'), 'This configuration value is defined in these %d '. 'configuration source(s): %s.' => array( @@ -562,9 +562,9 @@ final class PhabricatorUSEnglishTranslation 'configuration sources: %s.', ), - '%d Open Pull Request(s)' => array( - '%d Open Pull Request', - '%d Open Pull Requests', + '%s Open Pull Request(s)' => array( + '%s Open Pull Request', + '%s Open Pull Requests', ), 'Stale (%s day(s))' => array( @@ -1153,6 +1153,10 @@ final class PhabricatorUSEnglishTranslation 'Found %s book.', 'Found %s books.', ), + 'Found %s file(s)...' => array( + 'Found %s file...', + 'Found %s files...', + ), 'Found %s file(s) in project.' => array( 'Found %s file in project.', 'Found %s files in project.', @@ -1392,6 +1396,10 @@ final class PhabricatorUSEnglishTranslation '%s Day', '%s Days', ), + '%s Day(s) Ago' => array( + '%s Day Ago', + '%s Days Ago', + ), 'Setting retention policy for "%s" to %s day(s).' => array( 'Setting retention policy for "%s" to one day.', @@ -1425,6 +1433,59 @@ final class PhabricatorUSEnglishTranslation 'WARNING: There are unapproved authorizations!', ), + 'Found %s Open Resource(s)' => array( + 'Found %s Open Resource', + 'Found %s Open Resources', + ), + + '%s Open Resource(s) Remain' => array( + '%s Open Resource Remain', + '%s Open Resources Remain', + ), + + 'Found %s Blueprint(s)' => array( + 'Found %s Blueprint', + 'Found %s Blueprints', + ), + + '%s Blueprint(s) Can Allocate' => array( + '%s Blueprint Can Allocate', + '%s Blueprints Can Allocate', + ), + + '%s Blueprint(s) Enabled' => array( + '%s Blueprint Enabled', + '%s Blueprints Enabled', + ), + + '%s Event(s)' => array( + '%s Event', + '%s Events', + ), + + '%s Unit(s)' => array( + '%s Unit', + '%s Units', + ), + + 'QUEUEING TASKS (%s Commit(s)):' => array( + 'QUEUEING TASKS (%s Commit):', + 'QUEUEING TASKS (%s Commits):', + ), + + 'Found %s total commit(s); updating...' => array( + 'Found %s total commit; updating...', + 'Found %s total commits; updating...', + ), + + 'Not enough process slots to schedule the other %s '. + 'repository(s) for updates yet.' => array( + 'Not enough process slots to schedule the other '.' + repository for update yet.', + 'Not enough process slots to schedule the other %s '. + 'repositories for updates yet.', + ), + ); } diff --git a/src/infrastructure/storage/management/workflow/PhabricatorStorageManagementWorkflow.php b/src/infrastructure/storage/management/workflow/PhabricatorStorageManagementWorkflow.php index e31e484c53..62b2651f70 100644 --- a/src/infrastructure/storage/management/workflow/PhabricatorStorageManagementWorkflow.php +++ b/src/infrastructure/storage/management/workflow/PhabricatorStorageManagementWorkflow.php @@ -126,7 +126,7 @@ abstract class PhabricatorStorageManagementWorkflow "documentation.\n\n". "MySQL needs to copy table data to make some adjustments, so these ". "migrations may take some time.", - new PhutilNumber(count($adjustments)))); + phutil_count($adjustments))); $prompt = pht('Fix these schema issues?'); if (!phutil_console_confirm($prompt, $default_no = true)) { diff --git a/src/view/phui/PHUIHeaderView.php b/src/view/phui/PHUIHeaderView.php index 3370519ebf..45b176f9a4 100644 --- a/src/view/phui/PHUIHeaderView.php +++ b/src/view/phui/PHUIHeaderView.php @@ -128,7 +128,7 @@ final class PHUIHeaderView extends AphrontTagView { } else if ($age == 1) { $when = pht('Yesterday'); } else { - $when = pht('%d Days Ago', $age); + $when = pht('%s Day(s) Ago', new PhutilNumber($age)); } $this->setStatus('fa-clock-o bluegrey', null, pht('Updated %s', $when));