]> khamidou — GitHub mirrors - arcanist.git/commitdiff
Various translation improvements
authorJoshua Spence <josh@freelancer.com>
Mon, 2 Nov 2015 10:28:15 +0000 (21:28 +1100)
committerJoshua Spence <josh@freelancer.com>
Mon, 2 Nov 2015 10:31:04 +0000 (21:31 +1100)
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

src/internationalization/ArcanistUSEnglishTranslation.php
src/unit/engine/phutil/PhutilTestCase.php
src/upload/ArcanistFileUploader.php
src/workflow/ArcanistCommitWorkflow.php
src/workflow/ArcanistCoverWorkflow.php
src/workflow/ArcanistDiffWorkflow.php
src/workflow/ArcanistUploadWorkflow.php
src/workflow/ArcanistWorkflow.php

index e83e099e46f40458bfdcd61c14689a12e5b042fd..f8d01ee9bbc3339e41d6d872abb457cb14a0eba5 100644 (file)
@@ -34,7 +34,7 @@ final class ArcanistUSEnglishTranslation extends PhutilTranslation {
           '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?',
@@ -57,11 +57,9 @@ final class ArcanistUSEnglishTranslation extends PhutilTranslation {
 
       '%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(
index 911ebbc8aa7c68a149a9cd560ea5e3b03b3e9875..f16d9f2b490c9bb793ee1cbb2837260e004898b1 100644 (file)
@@ -490,7 +490,10 @@ abstract class PhutilTestCase extends Phobject {
             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;
           }
index 27ec8d347a48b0103a41b4c381507b2deb0ed7a3..d8c65a437b2f34fd5e847f9105693e79a6baa1fa 100644 (file)
@@ -245,14 +245,14 @@ final class ArcanistFileUploader extends Phobject {
     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();
index e1c5a917f30f4281d741eb87a1ec85f8c3ef175e..c0e91db39aa5fa13e2b4571b03018df7998fd127 100644 (file)
@@ -225,10 +225,10 @@ EOTEXT
     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);
     }
 
@@ -251,7 +251,7 @@ EOTEXT
     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);
     }
index 35c3c891936561a87dc3bc3b68bb923f205b6c71..a9b188cf4cd9f76d9d4929990b39415cd6fb0db5 100644 (file)
@@ -120,7 +120,7 @@ EOTEXT
         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";
         }
index eeabfdfba144593261239379abacd13276008d48..aeae05263c022c3192f23707e93af2b49c9ea9b9 100644 (file)
@@ -962,7 +962,7 @@ EOTEXT
         '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/');
 
@@ -1070,18 +1070,18 @@ EOTEXT
             '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",
index a31ce0f08138c01ae203e1f27c20107708f8ecfe..a0582a69f8425aed21d1f4f97d3e5fcbe93622dc 100644 (file)
@@ -143,14 +143,14 @@ EOTEXT
     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();
index e222914ce6195f49eeb277d3db9a8bb3416a601b..ad57c8439220ff5c3cfeb4cc83bb25a6b46927f7 100644 (file)
@@ -938,17 +938,17 @@ abstract class ArcanistWorkflow extends Phobject {
       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');
       }
 
@@ -961,7 +961,7 @@ abstract class ArcanistWorkflow extends Phobject {
 
       $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();
@@ -1150,11 +1150,11 @@ abstract class ArcanistWorkflow extends Phobject {
     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;
   }