Skip to content

Commit

Permalink
UPDATE allow translations for element summary (#41)
Browse files Browse the repository at this point in the history
* Update ElementPromos.php

* UPDATE Promo vs Feature
  • Loading branch information
muskie9 authored Sep 20, 2023
1 parent 5448f4d commit f77ff3e
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions src/Elements/ElementPromos.php
Original file line number Diff line number Diff line change
Expand Up @@ -145,12 +145,14 @@ public function getPromoList()
*/
public function getSummary()
{
if ($this->Promos()->count() == 1) {
$label = ' promo';
} else {
$label = ' promos';
}
return DBField::create_field('HTMLText', $this->Promos()->count() . $label)->Summary(20);
$count = $this->Promos()->count();
$label = _t(
static::class . '.PLURALS',
'A Promo|{count} Promos',
[ 'count' => $count ]
);

return DBField::create_field('HTMLText', $label)->Summary(20);
}

/**
Expand Down

0 comments on commit f77ff3e

Please sign in to comment.