Skip to content

Commit

Permalink
IncidentListItem: Translate text in meta
Browse files Browse the repository at this point in the history
  • Loading branch information
raviks789 committed May 6, 2024
1 parent 03b7c07 commit 5d776c2
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions library/Notifications/Widget/ItemList/IncidentListItem.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,10 @@
use Icinga\Module\Notifications\Widget\SourceIcon;
use ipl\Html\Attributes;
use ipl\Html\BaseHtmlElement;
use ipl\Html\FormattedString;
use ipl\Html\Html;
use ipl\Html\HtmlElement;
use ipl\I18n\Translation;
use ipl\Web\Common\BaseListItem;
use ipl\Web\Widget\Icon;
use ipl\Web\Widget\Link;
Expand All @@ -25,6 +27,8 @@
*/
class IncidentListItem extends BaseListItem
{
use Translation;

/** @var Incident The associated list item */
protected $item;

Expand Down Expand Up @@ -84,10 +88,10 @@ protected function assembleHeader(BaseHtmlElement $header): void
$meta->addHtml((new SourceIcon(SourceIcon::SIZE_BIG))->addHtml($source->getIcon()));

if ($this->item->recovered_at !== null) {
$meta->add([
'closed ',
$meta->addHtml(FormattedString::create(
$this->translate('closed %s', '(incident) ... <relative time>'),
new TimeAgo($this->item->recovered_at->getTimestamp())
]);
));
} else {
$meta->addHtml(new TimeSince($this->item->started_at->getTimestamp()));
}
Expand Down

0 comments on commit 5d776c2

Please sign in to comment.