1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-12-22 21:40:55 +01:00

Use PhutilNumber in translations

Summary: It's a little bit confusing that you couldn't use %d but kind of expected taken that the number will be formatted so it's not a number anymore.

Test Plan: /paste/

Reviewers: epriestley

Reviewed By: epriestley

CC: aran, Korvin

Differential Revision: https://secure.phabricator.com/D4764
This commit is contained in:
vrana 2013-01-31 08:44:21 -08:00
parent 356c300086
commit 01236dcaf0
4 changed files with 13 additions and 16 deletions

View file

@ -182,10 +182,9 @@ final class DifferentialRevisionViewController extends DifferentialController {
$warning->setSeverity(AphrontErrorView::SEVERITY_WARNING); $warning->setSeverity(AphrontErrorView::SEVERITY_WARNING);
$warning->appendChild( $warning->appendChild(
pht( pht(
'This diff is very large and affects %2$s files. Load each file '. 'This diff is very large and affects %s files. Load each file '.
'individually.', 'individually.',
$count, new PhutilNumber($count)).
PhutilTranslator::getInstance()->formatNumber($count)).
" <strong>". " <strong>".
phutil_render_tag( phutil_render_tag(
'a', 'a',

View file

@ -807,10 +807,9 @@ final class DiffusionBrowseFileController extends DiffusionController {
$size = strlen($data); $size = strlen($data);
$properties->addTextContent( $properties->addTextContent(
pht('This is a binary file. It is %2$s byte(s) in length.', pht(
$size, 'This is a binary file. It is %s byte(s) in length.',
PhutilTranslator::getInstance()->formatNumber($size)) new PhutilNumber($size)));
);
$actions = id(new PhabricatorActionListView()) $actions = id(new PhabricatorActionListView())
->setUser($this->getRequest()->getUser()) ->setUser($this->getRequest()->getUser())

View file

@ -94,9 +94,8 @@ final class PhabricatorPasteListController extends PhabricatorPasteController {
$line_count = count(explode("\n", $paste->getContent())); $line_count = count(explode("\n", $paste->getContent()));
$line_count = pht( $line_count = pht(
'%2$s Line(s)', '%s Line(s)',
$line_count, new PhutilNumber($line_count));
PhutilTranslator::getInstance()->formatNumber($line_count));
$item = id(new PhabricatorObjectItemView()) $item = id(new PhabricatorObjectItemView())
->setHeader($paste->getFullName()) ->setHeader($paste->getFullName())

View file

@ -167,9 +167,9 @@ abstract class PhabricatorBaseEnglishTranslation
'%d Lint Messages', '%d Lint Messages',
), ),
'This is a binary file. It is %2$s byte(s) in length.' => array( 'This is a binary file. It is %s byte(s) in length.' => array(
'This is a binary file. It is %2$s byte in length.', 'This is a binary file. It is %s byte in length.',
'This is a binary file. It is %2$s bytes in length.', 'This is a binary file. It is %s bytes in length.',
), ),
'%d Action(s) Have No Effect' => array( '%d Action(s) Have No Effect' => array(
@ -226,9 +226,9 @@ abstract class PhabricatorBaseEnglishTranslation
), ),
), ),
'%2$s Line(s)' => array( '%s Line(s)' => array(
'%2$s Line', '%s Line',
'%2$s Lines', '%s Lines',
), ),
"Indexing %d object(s) of type %s." => array( "Indexing %d object(s) of type %s." => array(