Skip to content

Commit

Permalink
Fix compound.future for pt_BR. Inline key in PreciseFormatter.
Browse files Browse the repository at this point in the history
  • Loading branch information
sam002 committed Nov 3, 2015
1 parent 9104ef0 commit 212711d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
6 changes: 2 additions & 4 deletions src/Coduo/PHPHumanizer/DateTime/PreciseFormatter.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,18 +31,16 @@ 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',
$locale
);
}

$translationKey = $difference->isPast() ? 'past' : 'future';

return $this->translator->trans(
'compound.' . $translationKey,
'compound.' . ($difference->isPast() ? 'past' : 'future'),
array('%value%' => implode(', ', $diff)),
'difference',
$locale
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"

0 comments on commit 212711d

Please sign in to comment.