From 1c2e7e5daa925332c9a73cbe6f98cdb291a50918 Mon Sep 17 00:00:00 2001 From: vrana Date: Fri, 21 Dec 2012 14:31:55 -0800 Subject: [PATCH] Fix Paste translation Summary: This syntax is extremely stupid, I'll probably rewrite it later. Test Plan: pht('%s Line(s)', number_format(1000)); Reviewers: epriestley Reviewed By: epriestley CC: aran, Korvin Differential Revision: https://secure.phabricator.com/D4272 --- .../paste/controller/PhabricatorPasteListController.php | 6 +++++- .../PhabricatorBaseEnglishTranslation.php | 6 +++--- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/applications/paste/controller/PhabricatorPasteListController.php b/src/applications/paste/controller/PhabricatorPasteListController.php index 01f4c5907f..32194daed1 100644 --- a/src/applications/paste/controller/PhabricatorPasteListController.php +++ b/src/applications/paste/controller/PhabricatorPasteListController.php @@ -93,13 +93,17 @@ final class PhabricatorPasteListController extends PhabricatorPasteController { $source_code); $line_count = count(explode("\n", $paste->getContent())); + $line_count = pht( + '%2$s Line(s)', + $line_count, + PhutilTranslator::getInstance()->formatNumber($line_count)); $item = id(new PhabricatorObjectItemView()) ->setHeader($paste->getFullName()) ->setHref('/P'.$paste->getID()) ->setObject($paste) ->addAttribute(pht('Created %s by %s', $created, $author)) - ->addIcon('none', pht('%s Line(s)', number_format($line_count))) + ->addIcon('none', $line_count) ->appendChild($source_code); $lang_name = $paste->getLanguage(); diff --git a/src/infrastructure/internationalization/PhabricatorBaseEnglishTranslation.php b/src/infrastructure/internationalization/PhabricatorBaseEnglishTranslation.php index 75080c4a37..a353b4593a 100644 --- a/src/infrastructure/internationalization/PhabricatorBaseEnglishTranslation.php +++ b/src/infrastructure/internationalization/PhabricatorBaseEnglishTranslation.php @@ -193,9 +193,9 @@ abstract class PhabricatorBaseEnglishTranslation ), ), - '%s Line(s)' => array( - '%s Line', - '%s Lines', + '%2$s Line(s)' => array( + '%2$s Line', + '%2$s Lines', ), "Indexing %d object(s) of type %s." => array(