]> khamidou — GitHub mirrors - arcanist.git/commitdiff
`pht`ize some strings
authorJoshua Spence <josh@joshuaspence.com>
Wed, 24 Sep 2014 21:09:07 +0000 (07:09 +1000)
committerJoshua Spence <josh@joshuaspence.com>
Wed, 24 Sep 2014 21:10:12 +0000 (07:10 +1000)
Summary: Self explanatory.

Test Plan: N/A

Reviewers: epriestley, #blessed_reviewers

Reviewed By: epriestley, #blessed_reviewers

Subscribers: epriestley, Korvin

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

src/lint/linter/ArcanistTextLinter.php

index 11afc5c1ca88db21b9fc82924a6106bf1bdde318..f7d8206db4c415be376ad67bdf22713c168fc462 100644 (file)
@@ -128,7 +128,7 @@ final class ArcanistTextLinter extends ArcanistLinter {
       $this->raiseLintAtOffset(
         $pos,
         self::LINT_DOS_NEWLINE,
-        'You must use ONLY Unix linebreaks ("\n") in source code.',
+        pht('You must use ONLY Unix linebreaks ("%s") in source code.', '\n'),
         "\r");
       if ($this->isMessageEnabled(self::LINT_DOS_NEWLINE)) {
         $this->stopAllLinters();
@@ -142,7 +142,7 @@ final class ArcanistTextLinter extends ArcanistLinter {
       $this->raiseLintAtOffset(
         $pos,
         self::LINT_TAB_LITERAL,
-        'Configure your editor to use spaces for indentation.',
+        pht('Configure your editor to use spaces for indentation.'),
         "\t");
     }
   }
@@ -157,8 +157,11 @@ final class ArcanistTextLinter extends ArcanistLinter {
           $line_idx + 1,
           1,
           self::LINT_LINE_WRAP,
-          'This line is '.number_format(strlen($line)).' characters long, '.
-          'but the convention is '.$width.' characters.',
+          pht(
+            'This line is %s characters long, but the '.
+            'convention is %s characters.',
+            new PhutilNumber(strlen($line)),
+            $width),
           $line);
       }
     }
@@ -170,7 +173,7 @@ final class ArcanistTextLinter extends ArcanistLinter {
       $this->raiseLintAtOffset(
         strlen($data),
         self::LINT_EOF_NEWLINE,
-        'Files must end in a newline.',
+        pht('Files must end in a newline.'),
         '',
         "\n");
     }
@@ -196,9 +199,10 @@ final class ArcanistTextLinter extends ArcanistLinter {
       $this->raiseLintAtOffset(
         $offset,
         self::LINT_BAD_CHARSET,
-        'Source code should contain only ASCII bytes with ordinal decimal '.
-        'values between 32 and 126 inclusive, plus linefeed. Do not use UTF-8 '.
-        'or other multibyte charsets.',
+        pht(
+          'Source code should contain only ASCII bytes with ordinal '.
+          'decimal values between 32 and 126 inclusive, plus linefeed. '.
+          'Do not use UTF-8 or other multibyte charsets.'),
         $string);
     }
 
@@ -226,9 +230,10 @@ final class ArcanistTextLinter extends ArcanistLinter {
       $this->raiseLintAtOffset(
         $offset,
         self::LINT_TRAILING_WHITESPACE,
-        'This line contains trailing whitespace. Consider setting up your '.
-          'editor to automatically remove trailing whitespace, you will save '.
-          'time.',
+        pht(
+          'This line contains trailing whitespace. Consider setting '.
+          'up your editor to automatically remove trailing whitespace, '.
+          'you will save time.'),
         $string,
         '');
     }
@@ -252,8 +257,9 @@ final class ArcanistTextLinter extends ArcanistLinter {
     $this->raiseLintAtOffset(
       $offset,
       self::LINT_BOF_WHITESPACE,
-      'This file contains leading whitespace at the beginning of the file. '.
-      'This is unnecessary and should be avoided when possible.',
+      pht(
+        'This file contains leading whitespace at the beginning of the file. '.
+        'This is unnecessary and should be avoided when possible.'),
       $string,
       '');
   }
@@ -276,8 +282,9 @@ final class ArcanistTextLinter extends ArcanistLinter {
     $this->raiseLintAtOffset(
       $offset,
       self::LINT_EOF_WHITESPACE,
-      'This file contains trailing whitespace at the end of the file. This '.
-      'is unnecessary and should be avoided when possible.',
+      pht(
+        'This file contains trailing whitespace at the end of the file. '.
+        'This is unnecessary and should be avoided when possible.'),
       $string,
       '');
   }
@@ -292,8 +299,9 @@ final class ArcanistTextLinter extends ArcanistLinter {
       $this->raiseLintAtOffset(
         $offset,
         self::LINT_NO_COMMIT,
-        'This file is explicitly marked as "'.$deadly.'", which blocks '.
-        'commits.',
+        pht(
+          'This file is explicitly marked as "%s", which blocks commits.',
+          $deadly),
         $deadly);
     }
   }