Skip to content

Commit 212711d

Browse files
committed
Fix compound.future for pt_BR. Inline key in PreciseFormatter.
1 parent 9104ef0 commit 212711d

File tree

2 files changed

+3
-5
lines changed

2 files changed

+3
-5
lines changed

src/Coduo/PHPHumanizer/DateTime/PreciseFormatter.php

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,18 +31,16 @@ public function formatDifference(PreciseDifference $difference, $locale = 'en')
3131

3232
foreach ($difference->getCompoundResults() as $result) {
3333
$diff[] = $this->translator->transChoice(
34-
'compound.'.$result->getUnit()->getName(),
34+
'compound.' . $result->getUnit()->getName(),
3535
$result->getQuantity(),
3636
array('%count%' => $result->getQuantity()),
3737
'difference',
3838
$locale
3939
);
4040
}
4141

42-
$translationKey = $difference->isPast() ? 'past' : 'future';
43-
4442
return $this->translator->trans(
45-
'compound.' . $translationKey,
43+
'compound.' . ($difference->isPast() ? 'past' : 'future'),
4644
array('%value%' => implode(', ', $diff)),
4745
'difference',
4846
$locale

src/Coduo/PHPHumanizer/Resources/translations/difference.pt_BR.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,4 +32,4 @@ compound:
3232
month: "{1} %count% mês|[2,Inf] %count% meses"
3333
year: "{1} %count% ano|[2,Inf] %count% anos"
3434
past: "%value% atrás"
35-
from_now: "a partir de agora"
35+
future: "%value% a partir de agora"

0 commit comments

Comments
 (0)