Skip to content

Commit

Permalink
Various translation improvements
Browse files Browse the repository at this point in the history
Summary: Depends on D14070.

Test Plan: Eyeball it.

Reviewers: epriestley, #blessed_reviewers

Reviewed By: epriestley, #blessed_reviewers

Subscribers: Korvin

Differential Revision: https://secure.phabricator.com/D14072
  • Loading branch information
Joshua Spence committed Nov 2, 2015
1 parent d12bcdc commit 2db40f9
Show file tree
Hide file tree
Showing 8 changed files with 33 additions and 32 deletions.
10 changes: 4 additions & 6 deletions src/internationalization/ArcanistUSEnglishTranslation.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ protected function getTranslations() {
'these files, or continue. If you continue, these files will be '.
'marked as binary.',
),
'%d AFFECTED FILE(S)' => array('AFFECTED FILE', 'AFFECTED FILES'),
'%s AFFECTED FILE(S)' => array('AFFECTED FILE', 'AFFECTED FILES'),
'Do you want to mark these %s file(s) as binary and continue?' => array(
'Do you want to mark this file as binary and continue?',
'Do you want to mark these files as binary and continue?',
Expand All @@ -57,11 +57,9 @@ protected function getTranslations() {

'%s line(s)' => array('line', 'lines'),

'%d test(s)' => array('%d test', '%d tests'),

'%d assertion(s) passed.' => array(
'%d assertion passed.',
'%d assertions passed.',
'%s assertion(s) passed.' => array(
'%s assertion passed.',
'%s assertions passed.',
),

'Ignore these %s untracked file(s) and continue?' => array(
Expand Down
5 changes: 4 additions & 1 deletion src/unit/engine/phutil/PhutilTestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -490,7 +490,10 @@ final public function run() {
call_user_func_array(
array($this, $name),
array());
$this->passTest(pht('%d assertion(s) passed.', $this->assertions));
$this->passTest(
pht(
'%s assertion(s) passed.',
new PhutilNumber($this->assertions)));
} catch (Exception $ex) {
$exceptions['Execution'] = $ex;
}
Expand Down
10 changes: 5 additions & 5 deletions src/upload/ArcanistFileUploader.php
Original file line number Diff line number Diff line change
Expand Up @@ -245,14 +245,14 @@ private function uploadChunks(ArcanistFileDataRef $file, $file_phid) {
if ($done) {
$this->writeStatus(
pht(
'Resuming upload (%d of %d chunks remain).',
new PhutilNumber(count($remaining)),
new PhutilNumber(count($chunks))));
'Resuming upload (%s of %s chunks remain).',
phutil_count($remaining),
phutil_count($chunks)));
} else {
$this->writeStatus(
pht(
'Uploading chunks (%d chunks to upload).',
new PhutilNumber(count($remaining))));
'Uploading chunks (%s chunks to upload).',
phutil_count($remaining)));
}

$progress = new PhutilConsoleProgressBar();
Expand Down
6 changes: 3 additions & 3 deletions src/workflow/ArcanistCommitWorkflow.php
Original file line number Diff line number Diff line change
Expand Up @@ -225,10 +225,10 @@ protected function getCommitFileList(array $revision) {
if ($modified_but_not_included) {
$prefix = pht(
'%s locally modified path(s) are not included in this revision:',
new PhutilNumber(count($modified_but_not_included)));
phutil_count($modified_but_not_included));
$prompt = pht(
'These %s path(s) will NOT be committed. Commit this revision anyway?',
new PhutilNumber(count($modified_but_not_included)));
phutil_count($modified_but_not_included));
$this->promptFileWarning($prefix, $prompt, $modified_but_not_included);
}

Expand All @@ -251,7 +251,7 @@ protected function getCommitFileList(array $revision) {
if ($do_not_exist) {
$prefix = pht(
'Revision includes changes to %s path(s) that do not exist:',
new PhutilNumber(count($do_not_exist)));
phutil_count($do_not_exist));
$prompt = pht('Commit this revision anyway?');
$this->promptFileWarning($prefix, $prompt, $do_not_exist);
}
Expand Down
2 changes: 1 addition & 1 deletion src/workflow/ArcanistCoverWorkflow.php
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ public function run() {
foreach ($files as $file => $info) {
$line_noun = pht(
'%s line(s)',
new PhutilNumber(count($info['lines'])));
phutil_count($info['lines']));
$lines = $this->readableSequenceFromLineNumbers($info['lines']);
echo " {$file}: {$line_noun} {$lines}\n";
}
Expand Down
10 changes: 5 additions & 5 deletions src/workflow/ArcanistDiffWorkflow.php
Original file line number Diff line number Diff line change
Expand Up @@ -962,7 +962,7 @@ protected function generateChanges() {
'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?',
new PhutilNumber(count($changes)),
phutil_count($changes),
'https://secure.phabricator.com/book/phabricator/article/'.
'differential_large_changes/');

Expand Down Expand Up @@ -1070,18 +1070,18 @@ protected function generateChanges() {
'contain invalid byte sequences). You can either stop this '.
'workflow and fix these files, or continue. If you continue, '.
'these files will be marked as binary.',
new PhutilNumber(count($utf8_problems))),
phutil_count($utf8_problems)),
pht(
"You can learn more about how Phabricator handles character ".
"encodings (and how to configure encoding settings and detect and ".
"correct encoding problems) by reading 'User Guide: UTF-8 and ".
"Character Encoding' in the Phabricator documentation."),
pht(
'%d AFFECTED FILE(S)',
count($utf8_problems)));
'%s AFFECTED FILE(S)',
phutil_count($utf8_problems)));
$confirm = pht(
'Do you want to mark these %s file(s) as binary and continue?',
new PhutilNumber(count($utf8_problems)));
phutil_count($utf8_problems));

echo phutil_console_format(
"**%s**\n",
Expand Down
10 changes: 5 additions & 5 deletions src/workflow/ArcanistUploadWorkflow.php
Original file line number Diff line number Diff line change
Expand Up @@ -143,14 +143,14 @@ private function uploadChunks($file_phid, $path) {
if ($done) {
$this->writeStatus(
pht(
'Resuming upload (%d of %d chunks remain).',
new PhutilNumber(count($remaining)),
new PhutilNumber(count($chunks))));
'Resuming upload (%s of %s chunks remain).',
phutil_count($remaining),
phutil_count($chunks)));
} else {
$this->writeStatus(
pht(
'Uploading chunks (%d chunks to upload).',
new PhutilNumber(count($remaining))));
'Uploading chunks (%s chunks to upload).',
phutil_count($remaining)));
}

$progress = new PhutilConsoleProgressBar();
Expand Down
12 changes: 6 additions & 6 deletions src/workflow/ArcanistWorkflow.php
Original file line number Diff line number Diff line change
Expand Up @@ -938,17 +938,17 @@ final public function requireCleanWorkingCopy() {
if ($api instanceof ArcanistGitAPI) {
$hint = pht(
'(To ignore these %s change(s), add them to "%s".)',
new PhutilNumber(count($untracked)),
phutil_count($untracked),
'.git/info/exclude');
} else if ($api instanceof ArcanistSubversionAPI) {
$hint = pht(
'(To ignore these %s change(s), add them to "%s".)',
new PhutilNumber(count($untracked)),
phutil_count($untracked),
'svn:ignore');
} else if ($api instanceof ArcanistMercurialAPI) {
$hint = pht(
'(To ignore these %s change(s), add them to "%s".)',
new PhutilNumber(count($untracked)),
phutil_count($untracked),
'.hgignore');
}

Expand All @@ -961,7 +961,7 @@ final public function requireCleanWorkingCopy() {

$prompt = pht(
'Ignore these %s untracked file(s) and continue?',
new PhutilNumber(count($untracked)));
phutil_count($untracked));

if (!phutil_console_confirm($prompt)) {
throw new ArcanistUserAbortException();
Expand Down Expand Up @@ -1150,11 +1150,11 @@ private function getAskForAddPrompt(array $files) {
if ($this->getShouldAmend()) {
$prompt = pht(
'Do you want to amend these %s change(s) to the current commit?',
new PhutilNumber(count($files)));
phutil_count($files));
} else {
$prompt = pht(
'Do you want to create a new commit with these %s change(s)?',
new PhutilNumber(count($files)));
phutil_count($files));
}
return $prompt;
}
Expand Down

0 comments on commit 2db40f9

Please sign in to comment.