diff --git a/src/Coduo/PHPHumanizer/DateTime/PreciseFormatter.php b/src/Coduo/PHPHumanizer/DateTime/PreciseFormatter.php index fef065c..7788683 100644 --- a/src/Coduo/PHPHumanizer/DateTime/PreciseFormatter.php +++ b/src/Coduo/PHPHumanizer/DateTime/PreciseFormatter.php @@ -31,7 +31,7 @@ public function formatDifference(PreciseDifference $difference, $locale = 'en') foreach ($difference->getCompoundResults() as $result) { $diff[] = $this->translator->transChoice( - 'compound.'.$result->getUnit()->getName(), + 'compound.' . $result->getUnit()->getName(), $result->getQuantity(), array('%count%' => $result->getQuantity()), 'difference', @@ -39,10 +39,8 @@ public function formatDifference(PreciseDifference $difference, $locale = 'en') ); } - $translationKey = $difference->isPast() ? 'past' : 'future'; - return $this->translator->trans( - 'compound.' . $translationKey, + 'compound.' . ($difference->isPast() ? 'past' : 'future'), array('%value%' => implode(', ', $diff)), 'difference', $locale diff --git a/src/Coduo/PHPHumanizer/Resources/translations/difference.pt_BR.yml b/src/Coduo/PHPHumanizer/Resources/translations/difference.pt_BR.yml index d590ab4..b771ff4 100644 --- a/src/Coduo/PHPHumanizer/Resources/translations/difference.pt_BR.yml +++ b/src/Coduo/PHPHumanizer/Resources/translations/difference.pt_BR.yml @@ -32,4 +32,4 @@ compound: month: "{1} %count% mês|[2,Inf] %count% meses" year: "{1} %count% ano|[2,Inf] %count% anos" past: "%value% atrás" - from_now: "a partir de agora" + future: "%value% a partir de agora"