From 410331db75708f5febb4d000a5120d9ae76c621e Mon Sep 17 00:00:00 2001 From: Joshua Spence Date: Mon, 25 May 2015 21:20:43 +1000 Subject: [PATCH] Fix some format strings Summary: These `pht` calls use `%d` instead of `%s`. Test Plan: Eyeball it. Reviewers: epriestley, #blessed_reviewers Reviewed By: epriestley, #blessed_reviewers Subscribers: Korvin, epriestley Differential Revision: https://secure.phabricator.com/D12994 --- src/workflow/ArcanistDiffWorkflow.php | 20 ++++++++------------ src/workflow/ArcanistDownloadWorkflow.php | 3 +-- 2 files changed, 9 insertions(+), 14 deletions(-) diff --git a/src/workflow/ArcanistDiffWorkflow.php b/src/workflow/ArcanistDiffWorkflow.php index db1ad23d..ded017b4 100644 --- a/src/workflow/ArcanistDiffWorkflow.php +++ b/src/workflow/ArcanistDiffWorkflow.php @@ -946,17 +946,15 @@ EOTEXT } if (count($changes) > 250) { - $count = number_format(count($changes)); - $link = - 'http://www.phabricator.com/docs/phabricator/article/'. - 'Differential_User_Guide_Large_Changes.html'; $message = pht( - 'This diff has a very large number of changes (%d). Differential '. + 'This diff has a very large number of changes (%s). Differential '. 'works best for changes which will receive detailed human review, '. 'and not as well for large automated changes or bulk checkins. '. 'See %s for information about reviewing big checkins. Continue anyway?', - $count, - $link); + new PhutilNumber(count($changes)), + 'http://www.phabricator.com/docs/phabricator/article/'. + 'Differential_User_Guide_Large_Changes.html'); + if (!phutil_console_confirm($message)) { throw new ArcanistUsageException( pht('Aborted generation of gigantic diff.')); @@ -970,13 +968,11 @@ EOTEXT $size += strlen($hunk->getCorpus()); } if ($size > $limit) { - $file_name = $change->getCurrentPath(); - $change_size = number_format($size); $byte_warning = pht( - "Diff for '%s' with context is %d bytes in length. ". + "Diff for '%s' with context is %s bytes in length. ". "Generally, source changes should not be this large.", - $file_name, - $change_size); + $change->getCurrentPath(), + new PhutilNumber($size)); if (!$this->getArgument('less-context')) { $byte_warning .= ' '.pht( "If this file is a huge text file, try using the '%s' flag.", diff --git a/src/workflow/ArcanistDownloadWorkflow.php b/src/workflow/ArcanistDownloadWorkflow.php index 56ea3a22..f3eb466b 100644 --- a/src/workflow/ArcanistDownloadWorkflow.php +++ b/src/workflow/ArcanistDownloadWorkflow.php @@ -86,8 +86,7 @@ EOTEXT 'id' => $this->id, )); - $bytes = number_format($info['byteSize']); - $desc = pht('(%d bytes)', $bytes); + $desc = pht('(%s bytes)', new PhutilNumber($info['byteSize'])); if ($info['name']) { $desc = "'".$info['name']."' ".$desc; }