1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-29 18:22:41 +01:00

Display correct size of binary files in Diffusion

Test Plan: https://secure.phabricator.com/diffusion/P/browse/master/webroot/rsrc/image/header_logo.png

Reviewers: btrahan, epriestley

Reviewed By: btrahan

CC: aran, Korvin

Maniphest Tasks: T1139

Differential Revision: https://secure.phabricator.com/D3961
This commit is contained in:
vrana 2012-11-12 16:35:26 -08:00
parent ede1f4721f
commit abd880e30f
2 changed files with 9 additions and 2 deletions

View file

@ -885,9 +885,11 @@ final class DiffusionBrowseFileController extends DiffusionController {
private function buildBinaryCorpus($file_uri, $data) { private function buildBinaryCorpus($file_uri, $data) {
$properties = new PhabricatorPropertyListView(); $properties = new PhabricatorPropertyListView();
$size = strlen($data);
$properties->addTextContent( $properties->addTextContent(
pht('This is a binary file. It is %d bytes in length.', pht('This is a binary file. It is %2$s byte(s) in length.',
number_format(strlen($data))) $size,
PhutilTranslator::getInstance()->formatNumber($size))
); );
$actions = id(new PhabricatorActionListView()) $actions = id(new PhabricatorActionListView())

View file

@ -167,6 +167,11 @@ 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 %2$s byte in length.',
'This is a binary file. It is %2$s bytes in length.',
),
); );
} }