diff --git a/library/Icingadb/Widget/Detail/RedundancyGroupHeader.php b/library/Icingadb/Widget/Detail/RedundancyGroupHeader.php index d98c7b0f5..850a94802 100644 --- a/library/Icingadb/Widget/Detail/RedundancyGroupHeader.php +++ b/library/Icingadb/Widget/Detail/RedundancyGroupHeader.php @@ -8,6 +8,7 @@ use Icinga\Module\Icingadb\Model\RedundancyGroupSummary; use Icinga\Module\Icingadb\Widget\DependencyNodeStatistics; use ipl\Html\BaseHtmlElement; +use ipl\Html\Html; use ipl\Html\HtmlElement; use ipl\Html\Text; use ipl\Web\Widget\StateBall; @@ -37,14 +38,18 @@ protected function assembleVisual(BaseHtmlElement $visual): void protected function assembleTitle(BaseHtmlElement $title): void { - $title->addHtml($this->createSubject()); + $subject = $this->createSubject(); if ($this->object->state->failed) { - $text = $this->translate('has no working objects'); + $title->addHtml(Html::sprintf( + $this->translate('%s has no working objects', ' has ...'), + $subject + )); } else { - $text = $this->translate('has working objects'); + $title->addHtml(Html::sprintf( + $this->translate('%s has working objects', ' has ...'), + $subject + )); } - - $title->addHtml(HtmlElement::create('span', null, Text::create($text))); } protected function createStatistics(): BaseHtmlElement diff --git a/library/Icingadb/Widget/ItemList/RedundancyGroupListItem.php b/library/Icingadb/Widget/ItemList/RedundancyGroupListItem.php index 7b56f5cac..70a2c782e 100644 --- a/library/Icingadb/Widget/ItemList/RedundancyGroupListItem.php +++ b/library/Icingadb/Widget/ItemList/RedundancyGroupListItem.php @@ -12,6 +12,7 @@ use Icinga\Module\Icingadb\Model\RedundancyGroupState; use Icinga\Module\Icingadb\Widget\DependencyNodeStatistics; use ipl\Html\BaseHtmlElement; +use ipl\Html\Html; use ipl\Stdlib\Filter; use ipl\Web\Url; use ipl\Web\Widget\Link; @@ -80,14 +81,18 @@ protected function assembleCaption(BaseHtmlElement $caption): void protected function assembleTitle(BaseHtmlElement $title): void { - $title->addHtml($this->createSubject()); + $subject = $this->createSubject(); if ($this->state->failed) { - $text = $this->translate('has no working objects'); + $title->addHtml(Html::sprintf( + $this->translate('%s has no working objects', ' has ...'), + $subject + )); } else { - $text = $this->translate('has working objects'); + $title->addHtml(Html::sprintf( + $this->translate('%s has working objects', ' has ...'), + $subject + )); } - - $title->addHtml(HtmlElement::create('span', null, Text::create($text))); } protected function assemble(): void