From be53f4f9bc6657ffd3b104801e919c3574611f72 Mon Sep 17 00:00:00 2001 From: Eric Lippmann Date: Mon, 30 Mar 2015 12:04:05 +0200 Subject: [PATCH] Use Controller::translate() instead of t()/mt() in the ChartController refs #7330 --- .../controllers/ChartController.php | 72 +++++++++---------- 1 file changed, 36 insertions(+), 36 deletions(-) diff --git a/modules/monitoring/application/controllers/ChartController.php b/modules/monitoring/application/controllers/ChartController.php index f19d3f4581..08f9334ee8 100644 --- a/modules/monitoring/application/controllers/ChartController.php +++ b/modules/monitoring/application/controllers/ChartController.php @@ -236,39 +236,39 @@ private function drawServiceGroupChart($query) $unknownBars[] = array($servicegroup->servicegroup, $servicegroup->services_unknown_unhandled); } $this->view->chart = new GridChart(); - $this->view->chart->title = t('Service Group Chart'); - $this->view->chart->description = t('Contains service states for each service group.'); + $this->view->chart->title = $this->translate('Service Group Chart'); + $this->view->chart->description = $this->translate('Contains service states for each service group.'); $this->view->chart->alignTopLeft(); - $this->view->chart->setAxisLabel('', mt('monitoring', 'Services')) + $this->view->chart->setAxisLabel('', $this->translate('Services')) ->setXAxis(new StaticAxis()) ->setAxisMin(null, 0); - $tooltip = mt('monitoring', '{title}:
{value} of {sum} services are {label}'); + $tooltip = $this->translate('{title}:
{value} of {sum} services are {label}'); $this->view->chart->drawBars( array( - 'label' => mt('monitoring', 'Ok'), + 'label' => $this->translate('Ok'), 'color' => '#44bb77', 'stack' => 'stack1', 'data' => $okBars, 'tooltip' => $tooltip ), array( - 'label' => mt('monitoring', 'Warning'), + 'label' => $this->translate('Warning'), 'color' => '#ffaa44', 'stack' => 'stack1', 'data' => $warningBars, 'tooltip' => $tooltip ), array( - 'label' => mt('monitoring', 'Critical'), + 'label' => $this->translate('Critical'), 'color' => '#ff5566', 'stack' => 'stack1', 'data' => $critBars, 'tooltip' => $tooltip ), array( - 'label' => mt('monitoring', 'Unknown'), + 'label' => $this->translate('Unknown'), 'color' => '#dd66ff', 'stack' => 'stack1', 'data' => $unknownBars, @@ -293,32 +293,32 @@ private function drawHostGroupChart($query) (string)$i, rand(1, 200), rand(1, 200) ); } - $tooltip = mt('monitoring', '{title}:
{value} of {sum} hosts are {label}'); + $tooltip = $this->translate('{title}:
{value} of {sum} hosts are {label}'); $this->view->chart = new GridChart(); - $this->view->chart->title = t('Host Group Chart'); - $this->view->chart->description = t('Contains host states of each service group.'); + $this->view->chart->title = $this->translate('Host Group Chart'); + $this->view->chart->description = $this->translate('Contains host states of each service group.'); $this->view->chart->alignTopLeft(); - $this->view->chart->setAxisLabel('', mt('monitoring', 'Hosts')) + $this->view->chart->setAxisLabel('', $this->translate('Hosts')) ->setXAxis(new StaticAxis()) ->setAxisMin(null, 0); $this->view->chart->drawBars( array( - 'label' => mt('monitoring', 'Up'), + 'label' => $this->translate('Up'), 'color' => '#44bb77', 'stack' => 'stack1', 'data' => $upBars, 'tooltip' => $tooltip ), array( - 'label' => mt('monitoring', 'Down'), + 'label' => $this->translate('Down'), 'color' => '#ff5566', 'stack' => 'stack1', 'data' => $downBars, 'tooltip' => $tooltip ), array( - 'label' => mt('monitoring', 'Unreachable'), + 'label' => $this->translate('Unreachable'), 'color' => '#dd66ff', 'stack' => 'stack1', 'data' => $unreachableBars, @@ -345,13 +345,13 @@ private function drawServiceGroupPie($query) 'colors' => array('#44bb77', '#ff4444', '#ff0000', '#ffff00', '#ffff33', '#E066FF', '#f099FF', '#fefefe'), 'labels'=> array( $query->services_ok . ' Up Services', - $query->services_warning_handled . mt('monitoring', ' Warning Services (Handled)'), - $query->services_warning_unhandled . mt('monitoring', ' Warning Services (Unhandled)'), - $query->services_critical_handled . mt('monitoring', ' Down Services (Handled)'), - $query->services_critical_unhandled . mt('monitoring', ' Down Services (Unhandled)'), - $query->services_unknown_handled . mt('monitoring', ' Unreachable Services (Handled)'), - $query->services_unknown_unhandled . mt('monitoring', ' Unreachable Services (Unhandled)'), - $query->services_pending . mt('monitoring', ' Pending Services') + $query->services_warning_handled . $this->translate(' Warning Services (Handled)'), + $query->services_warning_unhandled . $this->translate(' Warning Services (Unhandled)'), + $query->services_critical_handled . $this->translate(' Down Services (Handled)'), + $query->services_critical_unhandled . $this->translate(' Down Services (Unhandled)'), + $query->services_unknown_handled . $this->translate(' Unreachable Services (Handled)'), + $query->services_unknown_unhandled . $this->translate(' Unreachable Services (Unhandled)'), + $query->services_pending . $this->translate(' Pending Services') ) )); } @@ -378,12 +378,12 @@ private function drawHostGroupPie($query) '#fefefe' ), 'labels'=> array( - (int) $query->hosts_up . mt('monitoring', ' Up Hosts'), - (int) $query->hosts_down_handled . mt('monitoring', ' Down Hosts (Handled)'), - (int) $query->hosts_down_unhandled . mt('monitoring', ' Down Hosts (Unhandled)'), - (int) $query->hosts_unreachable_handled . mt('monitoring', ' Unreachable Hosts (Handled)'), - (int) $query->hosts_unreachable_unhandled . mt('monitoring', ' Unreachable Hosts (Unhandled)'), - (int) $query->hosts_pending . mt('monitoring', ' Pending Hosts') + (int) $query->hosts_up . $this->translate(' Up Hosts'), + (int) $query->hosts_down_handled . $this->translate(' Down Hosts (Handled)'), + (int) $query->hosts_down_unhandled . $this->translate(' Down Hosts (Unhandled)'), + (int) $query->hosts_unreachable_handled . $this->translate(' Unreachable Hosts (Handled)'), + (int) $query->hosts_unreachable_unhandled . $this->translate(' Unreachable Hosts (Unhandled)'), + (int) $query->hosts_pending . $this->translate(' Pending Hosts') ) ), array( 'data' => array( @@ -398,14 +398,14 @@ private function drawHostGroupPie($query) ), 'colors' => array('#44bb77', '#ff4444', '#ff0000', '#ffff00', '#ffff33', '#E066FF', '#f099FF', '#fefefe'), 'labels'=> array( - $query->services_ok . mt('monitoring', ' Up Services'), - $query->services_warning_handled . mt('monitoring', ' Warning Services (Handled)'), - $query->services_warning_unhandled . mt('monitoring', ' Warning Services (Unhandled)'), - $query->services_critical_handled . mt('monitoring', ' Down Services (Handled)'), - $query->services_critical_unhandled . mt('monitoring', ' Down Services (Unhandled)'), - $query->services_unknown_handled . mt('monitoring', ' Unreachable Services (Handled)'), - $query->services_unknown_unhandled . mt('monitoring', ' Unreachable Services (Unhandled)'), - $query->services_pending . mt('monitoring', ' Pending Services') + $query->services_ok . $this->translate(' Up Services'), + $query->services_warning_handled . $this->translate(' Warning Services (Handled)'), + $query->services_warning_unhandled . $this->translate(' Warning Services (Unhandled)'), + $query->services_critical_handled . $this->translate(' Down Services (Handled)'), + $query->services_critical_unhandled . $this->translate(' Down Services (Unhandled)'), + $query->services_unknown_handled . $this->translate(' Unreachable Services (Handled)'), + $query->services_unknown_unhandled . $this->translate(' Unreachable Services (Unhandled)'), + $query->services_pending . $this->translate(' Pending Services') ) )); }