diff --git a/application/controllers/HostController.php b/application/controllers/HostController.php index c900f570c..76b187991 100644 --- a/application/controllers/HostController.php +++ b/application/controllers/HostController.php @@ -63,7 +63,7 @@ public function init(): void /** @var Host $host */ $host = $query->first(); if ($host === null) { - throw new NotFoundError(t('Host not found')); + throw new NotFoundError($this->translate('Host not found')); } $this->host = $host; @@ -150,7 +150,7 @@ public function historyAction(): Generator $sortControl = $this->createSortControl( $history, [ - 'history.event_time desc, history.event_type desc' => t('Event Time') + 'history.event_time desc, history.event_type desc' => $this->translate('Event Time') ] ); $viewModeSwitcher = $this->createViewModeSwitcher($paginationControl, $limitControl, true); @@ -214,10 +214,10 @@ public function servicesAction(): Generator $sortControl = $this->createSortControl( $services, [ - 'service.display_name' => t('Name'), - 'service.state.severity desc,service.state.last_state_change desc' => t('Severity'), - 'service.state.soft_state' => t('Current State'), - 'service.state.last_state_change desc' => t('Last State Change') + 'service.display_name' => $this->translate('Name'), + 'service.state.severity desc,service.state.last_state_change desc' => $this->translate('Severity'), + 'service.state.soft_state' => $this->translate('Current State'), + 'service.state.last_state_change desc' => $this->translate('Last State Change') ] ); @@ -449,15 +449,15 @@ protected function createTabs(): Tabs $tabs = $this->getTabs() ->add('index', [ - 'label' => t('Host'), + 'label' => $this->translate('Host'), 'url' => Links::host($this->host) ]) ->add('services', [ - 'label' => t('Services'), + 'label' => $this->translate('Services'), 'url' => HostLinks::services($this->host) ]) ->add('history', [ - 'label' => t('History'), + 'label' => $this->translate('History'), 'url' => HostLinks::history($this->host) ]); @@ -473,7 +473,7 @@ protected function createTabs(): Tabs if ($this->hasPermission('icingadb/object/show-source')) { $tabs->add('source', [ - 'label' => t('Source'), + 'label' => $this->translate('Source'), 'url' => Links::hostSource($this->host) ]); } diff --git a/application/controllers/ServiceController.php b/application/controllers/ServiceController.php index 0d5a51645..c086c3976 100644 --- a/application/controllers/ServiceController.php +++ b/application/controllers/ServiceController.php @@ -73,7 +73,7 @@ public function init(): void /** @var Service $service */ $service = $query->first(); if ($service === null) { - throw new NotFoundError(t('Service not found')); + throw new NotFoundError($this->translate('Service not found')); } $this->service = $service; @@ -86,7 +86,7 @@ public function init(): void $this->setTitleTab($this->getRequest()->getActionName()); $this->setTitle( - t('%s on %s', ' on '), + $this->translate('%s on %s', ' on '), $service->display_name, $service->host->display_name ); @@ -289,7 +289,7 @@ public function historyAction(): Generator $sortControl = $this->createSortControl( $history, [ - 'history.event_time desc, history.event_type desc' => t('Event Time') + 'history.event_time desc, history.event_type desc' => $this->translate('Event Time') ] ); $viewModeSwitcher = $this->createViewModeSwitcher($paginationControl, $limitControl, true); @@ -421,11 +421,11 @@ protected function createTabs(): Tabs $tabs = $this->getTabs() ->add('index', [ - 'label' => t('Service'), + 'label' => $this->translate('Service'), 'url' => Links::service($this->service, $this->service->host) ]) ->add('history', [ - 'label' => t('History'), + 'label' => $this->translate('History'), 'url' => ServiceLinks::history($this->service, $this->service->host) ]); @@ -447,7 +447,7 @@ protected function createTabs(): Tabs if ($this->hasPermission('icingadb/object/show-source')) { $tabs->add('source', [ - 'label' => t('Source'), + 'label' => $this->translate('Source'), 'url' => Links::serviceSource($this->service, $this->service->host) ]); }