From 5951ec26b4473b0b695eecc1eb97cb81d815401f Mon Sep 17 00:00:00 2001 From: Joshua Spence Date: Thu, 25 Sep 2014 07:09:07 +1000 Subject: [PATCH] `pht`ize some strings 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 | 42 +++++++++++++++----------- 1 file changed, 25 insertions(+), 17 deletions(-) diff --git a/src/lint/linter/ArcanistTextLinter.php b/src/lint/linter/ArcanistTextLinter.php index 11afc5c1..f7d8206d 100644 --- a/src/lint/linter/ArcanistTextLinter.php +++ b/src/lint/linter/ArcanistTextLinter.php @@ -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); } }