Replace t() and mt() with translate() in the monitoring module's forms

refs #7551
This commit is contained in:
Johannes Meyer 2015-01-19 13:47:01 +01:00
parent 23bbf63b73
commit 7082ebaf7b
25 changed files with 183 additions and 204 deletions

View File

@ -21,7 +21,7 @@ class DisableNotificationsExpireCommandForm extends CommandForm
*/
public function init()
{
$this->setSubmitLabel(mt('monitoring', 'Disable Notifications'));
$this->setSubmitLabel($this->translate('Disable Notifications'));
}
/**
@ -30,8 +30,7 @@ class DisableNotificationsExpireCommandForm extends CommandForm
*/
public function getHelp()
{
return mt(
'monitoring',
return $this->translate(
'This command is used to disable host and service notifications for a specific time.'
);
}
@ -49,8 +48,8 @@ class DisableNotificationsExpireCommandForm extends CommandForm
'expire_time',
array(
'required' => true,
'label' => mt('monitoring', 'Expire Time'),
'description' => mt('monitoring', 'Set the expire time.'),
'label' => $this->translate('Expire Time'),
'description' => $this->translate('Set the expire time.'),
'value' => $expireTime
)
);
@ -67,7 +66,7 @@ class DisableNotificationsExpireCommandForm extends CommandForm
$disableNotifications
->setExpireTime($this->getElement('expire_time')->getValue()->getTimestamp());
$this->getTransport($this->request)->send($disableNotifications);
Notification::success(mt('monitoring', 'Disabling host and service notifications..'));
Notification::success($this->translate('Disabling host and service notifications..'));
return true;
}
}

View File

@ -61,13 +61,13 @@ class ToggleInstanceFeaturesCommandForm extends CommandForm
if ((bool) $this->status->notifications_enabled) {
$notificationDescription = sprintf(
'<a title="%s" href="%s" data-base-target="_next">%s</a>',
mt('monitoring', 'Disable notifications for a specific time on a program-wide basis'),
$this->translate('Disable notifications for a specific time on a program-wide basis'),
$this->getView()->href('monitoring/process/disable-notifications'),
mt('monitoring', 'Disable temporarily')
$this->translate('Disable temporarily')
);
} elseif ($this->status->disable_notif_expire_time) {
$notificationDescription = sprintf(
mt('monitoring', 'Notifications will be re-enabled in <strong>%s</strong>'),
$this->translate('Notifications will be re-enabled in <strong>%s</strong>'),
$this->getView()->timeUntil($this->status->disable_notif_expire_time)
);
} else {
@ -78,7 +78,7 @@ class ToggleInstanceFeaturesCommandForm extends CommandForm
'checkbox',
ToggleInstanceFeatureCommand::FEATURE_ACTIVE_HOST_CHECKS,
array(
'label' => mt('monitoring', 'Active Host Checks Being Executed'),
'label' => $this->translate('Active Host Checks Being Executed'),
'autosubmit' => true
)
),
@ -86,7 +86,7 @@ class ToggleInstanceFeaturesCommandForm extends CommandForm
'checkbox',
ToggleInstanceFeatureCommand::FEATURE_ACTIVE_SERVICE_CHECKS,
array(
'label' => mt('monitoring', 'Active Service Checks Being Executed'),
'label' => $this->translate('Active Service Checks Being Executed'),
'autosubmit' => true
)
),
@ -94,7 +94,7 @@ class ToggleInstanceFeaturesCommandForm extends CommandForm
'checkbox',
ToggleInstanceFeatureCommand::FEATURE_EVENT_HANDLERS,
array(
'label' => mt('monitoring', 'Event Handlers Enabled'),
'label' => $this->translate('Event Handlers Enabled'),
'autosubmit' => true
)
),
@ -102,7 +102,7 @@ class ToggleInstanceFeaturesCommandForm extends CommandForm
'checkbox',
ToggleInstanceFeatureCommand::FEATURE_FLAP_DETECTION,
array(
'label' => mt('monitoring', 'Flap Detection Enabled'),
'label' => $this->translate('Flap Detection Enabled'),
'autosubmit' => true
)
),
@ -110,7 +110,7 @@ class ToggleInstanceFeaturesCommandForm extends CommandForm
'checkbox',
ToggleInstanceFeatureCommand::FEATURE_NOTIFICATIONS,
array(
'label' => mt('monitoring', 'Notifications Enabled'),
'label' => $this->translate('Notifications Enabled'),
'autosubmit' => true,
'description' => $notificationDescription,
'decorators' => array(
@ -129,7 +129,7 @@ class ToggleInstanceFeaturesCommandForm extends CommandForm
'checkbox',
ToggleInstanceFeatureCommand::FEATURE_HOST_OBSESSING,
array(
'label' => mt('monitoring', 'Obsessing Over Hosts'),
'label' => $this->translate('Obsessing Over Hosts'),
'autosubmit' => true
)
),
@ -137,7 +137,7 @@ class ToggleInstanceFeaturesCommandForm extends CommandForm
'checkbox',
ToggleInstanceFeatureCommand::FEATURE_SERVICE_OBSESSING,
array(
'label' => mt('monitoring', 'Obsessing Over Services'),
'label' => $this->translate('Obsessing Over Services'),
'autosubmit' => true
)
),
@ -145,7 +145,7 @@ class ToggleInstanceFeaturesCommandForm extends CommandForm
'checkbox',
ToggleInstanceFeatureCommand::FEATURE_PASSIVE_HOST_CHECKS,
array(
'label' => mt('monitoring', 'Passive Host Checks Being Accepted'),
'label' => $this->translate('Passive Host Checks Being Accepted'),
'autosubmit' => true
)
),
@ -153,7 +153,7 @@ class ToggleInstanceFeaturesCommandForm extends CommandForm
'checkbox',
ToggleInstanceFeatureCommand::FEATURE_PASSIVE_SERVICE_CHECKS,
array(
'label' => mt('monitoring', 'Passive Service Checks Being Accepted'),
'label' => $this->translate('Passive Service Checks Being Accepted'),
'autosubmit' => true
)
),
@ -161,7 +161,7 @@ class ToggleInstanceFeaturesCommandForm extends CommandForm
'checkbox',
ToggleInstanceFeatureCommand::FEATURE_PERFORMANCE_DATA,
array(
'label' => mt('monitoring', 'Performance Data Being Processed'),
'label' => $this->translate('Performance Data Being Processed'),
'autosubmit' => true
)
)
@ -198,7 +198,7 @@ class ToggleInstanceFeaturesCommandForm extends CommandForm
->setEnabled($enabled);
$this->getTransport($this->request)->send($toggleFeature);
}
Notification::success(mt('monitoring', 'Toggling feature..'));
Notification::success($this->translate('Toggling feature..'));
return true;
}
}

View File

@ -31,8 +31,7 @@ class AcknowledgeProblemCommandForm extends ObjectsCommandForm
*/
public function getHelp()
{
return mt(
'monitoring',
return $this->translate(
'This command is used to acknowledge host or service problems. When a problem is acknowledged,'
. ' future notifications about problems are temporarily disabled until the host or service'
. ' recovers.'
@ -51,9 +50,8 @@ class AcknowledgeProblemCommandForm extends ObjectsCommandForm
'comment',
array(
'required' => true,
'label' => mt('monitoring', 'Comment'),
'description' => mt(
'monitoring',
'label' => $this->translate('Comment'),
'description' => $this->translate(
'If you work with other administrators, you may find it useful to share information about the'
. ' the host or service that is having problems. Make sure you enter a brief description of'
. ' what you are doing.'
@ -64,9 +62,8 @@ class AcknowledgeProblemCommandForm extends ObjectsCommandForm
'checkbox',
'persistent',
array(
'label' => mt('monitoring', 'Persistent Comment'),
'description' => mt(
'monitoring',
'label' => $this->translate('Persistent Comment'),
'description' => $this->translate(
'If you would like the comment to remain even when the acknowledgement is removed, check this'
. ' option.'
)
@ -76,8 +73,10 @@ class AcknowledgeProblemCommandForm extends ObjectsCommandForm
'checkbox',
'expire',
array(
'label' => mt('monitoring', 'Use Expire Time'),
'description' => mt('monitoring', 'If the acknowledgement should expire, check this option.'),
'label' => $this->translate('Use Expire Time'),
'description' => $this->translate(
'If the acknowledgement should expire, check this option.'
),
'autosubmit' => true
)
)
@ -89,10 +88,9 @@ class AcknowledgeProblemCommandForm extends ObjectsCommandForm
'dateTimePicker',
'expire_time',
array(
'label' => mt('monitoring', 'Expire Time'),
'label' => $this->translate('Expire Time'),
'value' => $expireTime,
'description' => mt(
'monitoring',
'description' => $this->translate(
'Enter the expire date and time for this acknowledgement here. Icinga will delete the'
. ' acknowledgement after this time expired.'
)
@ -114,10 +112,9 @@ class AcknowledgeProblemCommandForm extends ObjectsCommandForm
'checkbox',
'sticky',
array(
'label' => mt('monitoring', 'Sticky Acknowledgement'),
'label' => $this->translate('Sticky Acknowledgement'),
'value' => true,
'description' => mt(
'monitoring',
'description' => $this->translate(
'If you want the acknowledgement to disable notifications until the host or service recovers,'
. ' check this option.'
)
@ -127,10 +124,9 @@ class AcknowledgeProblemCommandForm extends ObjectsCommandForm
'checkbox',
'notify',
array(
'label' => mt('monitoring', 'Send Notification'),
'label' => $this->translate('Send Notification'),
'value' => true,
'description' => mt(
'monitoring',
'description' => $this->translate(
'If you do not want an acknowledgement notification to be sent out to the appropriate contacts,'
. ' uncheck this option.'
)

View File

@ -29,8 +29,7 @@ class AddCommentCommandForm extends ObjectsCommandForm
*/
public function getHelp()
{
return mt(
'monitoring',
return $this->translate(
'This command is used to add host or service comments.'
);
}
@ -47,9 +46,8 @@ class AddCommentCommandForm extends ObjectsCommandForm
'comment',
array(
'required' => true,
'label' => mt('monitoring', 'Comment'),
'description' => mt(
'monitoring',
'label' => $this->translate('Comment'),
'description' => $this->translate(
'If you work with other administrators, you may find it useful to share information about the'
. ' the host or service that is having problems. Make sure you enter a brief description of'
. ' what you are doing.'
@ -60,10 +58,9 @@ class AddCommentCommandForm extends ObjectsCommandForm
'checkbox',
'persistent',
array(
'label' => mt('monitoring', 'Persistent'),
'label' => $this->translate('Persistent'),
'value' => true,
'description' => mt(
'monitoring',
'description' => $this->translate(
'If you uncheck this option, the comment will automatically be deleted the next time Icinga is'
. ' restarted.'
)

View File

@ -35,8 +35,8 @@ class CheckNowCommandForm extends ObjectsCommandForm
array(
'ignore' => true,
'type' => 'submit',
'value' => mt('monitoring', 'Check now'),
'label' => '<i class="icon-reschedule"></i> ' . mt('monitoring', 'Check now'),
'value' => $this->translate('Check now'),
'label' => '<i class="icon-reschedule"></i> ' . $this->translate('Check now'),
'decorators' => array('ViewHelper'),
'escape' => false,
'class' => 'link-like'

View File

@ -55,7 +55,7 @@ class DeleteCommentCommandForm extends ObjectsCommandForm
array(
'ignore' => true,
'label' => 'X',
'title' => mt('monitoring', 'Delete comment'),
'title' => $this->translate('Delete comment'),
'decorators' => array('ViewHelper')
)
);
@ -80,7 +80,7 @@ class DeleteCommentCommandForm extends ObjectsCommandForm
if (! empty($redirect)) {
$this->setRedirectUrl($redirect);
}
Notification::success(mt('monitoring', 'Deleting comment..'));
Notification::success($this->translate('Deleting comment..'));
return true;
}
}

View File

@ -55,7 +55,7 @@ class DeleteDowntimeCommandForm extends ObjectsCommandForm
array(
'ignore' => true,
'label' => 'X',
'title' => mt('monitoring', 'Delete downtime'),
'title' => $this->translate('Delete downtime'),
'decorators' => array('ViewHelper')
)
);
@ -80,7 +80,7 @@ class DeleteDowntimeCommandForm extends ObjectsCommandForm
if (! empty($redirect)) {
$this->setRedirectUrl($redirect);
}
Notification::success(mt('monitoring', 'Deleting downtime..'));
Notification::success($this->translate('Deleting downtime..'));
return true;
}
}

View File

@ -29,8 +29,7 @@ class ProcessCheckResultCommandForm extends ObjectsCommandForm
*/
public function getHelp()
{
return mt(
'monitoring',
return $this->translate(
'This command is used to submit passive host or service check results.'
);
}
@ -53,17 +52,17 @@ class ProcessCheckResultCommandForm extends ObjectsCommandForm
'status',
array(
'required' => true,
'label' => mt('monitoring', 'Status'),
'description' => mt('monitoring', 'The state this check result should report'),
'label' => $this->translate('Status'),
'description' => $this->translate('The state this check result should report'),
'multiOptions' => $object->getType() === $object::TYPE_HOST ? array(
ProcessCheckResultCommand::HOST_UP => mt('monitoring', 'UP', 'icinga.state'),
ProcessCheckResultCommand::HOST_DOWN => mt('monitoring', 'DOWN', 'icinga.state'),
ProcessCheckResultCommand::HOST_UNREACHABLE => mt('monitoring', 'UNREACHABLE', 'icinga.state')
ProcessCheckResultCommand::HOST_UP => $this->translate('UP', 'icinga.state'),
ProcessCheckResultCommand::HOST_DOWN => $this->translate('DOWN', 'icinga.state'),
ProcessCheckResultCommand::HOST_UNREACHABLE => $this->translate('UNREACHABLE', 'icinga.state')
) : array(
ProcessCheckResultCommand::SERVICE_OK => mt('monitoring', 'OK', 'icinga.state'),
ProcessCheckResultCommand::SERVICE_WARNING => mt('monitoring', 'WARNING', 'icinga.state'),
ProcessCheckResultCommand::SERVICE_CRITICAL => mt('monitoring', 'CRITICAL', 'icinga.state'),
ProcessCheckResultCommand::SERVICE_UNKNOWN => mt('monitoring', 'UNKNOWN', 'icinga.state')
ProcessCheckResultCommand::SERVICE_OK => $this->translate('OK', 'icinga.state'),
ProcessCheckResultCommand::SERVICE_WARNING => $this->translate('WARNING', 'icinga.state'),
ProcessCheckResultCommand::SERVICE_CRITICAL => $this->translate('CRITICAL', 'icinga.state'),
ProcessCheckResultCommand::SERVICE_UNKNOWN => $this->translate('UNKNOWN', 'icinga.state')
)
)
);
@ -72,8 +71,8 @@ class ProcessCheckResultCommandForm extends ObjectsCommandForm
'output',
array(
'required' => true,
'label' => mt('monitoring', 'Output'),
'description' => mt('monitoring', 'The plugin output of this check result')
'label' => $this->translate('Output'),
'description' => $this->translate('The plugin output of this check result')
)
);
$this->addElement(
@ -81,9 +80,8 @@ class ProcessCheckResultCommandForm extends ObjectsCommandForm
'perfdata',
array(
'allowEmpty' => true,
'label' => mt('monitoring', 'Performance Data'),
'description' => mt(
'monitoring',
'label' => $this->translate('Performance Data'),
'description' => $this->translate(
'The performance data of this check result. Leave empty'
. ' if this check result has no performance data'
)

View File

@ -24,9 +24,8 @@ class ScheduleHostCheckCommandForm extends ScheduleServiceCheckCommandForm
'checkbox',
'all_services',
array(
'label' => mt('monitoring', 'All Services'),
'description' => mt(
'monitoring',
'label' => $this->translate('All Services'),
'description' => $this->translate(
'Schedule check for all services on the hosts and the hosts themselves.'
)
)

View File

@ -27,9 +27,8 @@ class ScheduleHostDowntimeCommandForm extends ScheduleServiceDowntimeCommandForm
'checkbox',
'all_services',
array(
'label' => mt('monitoring', 'All Services'),
'description' => mt(
'monitoring',
'label' => $this->translate('All Services'),
'description' => $this->translate(
'Schedule downtime for all services on the hosts and the hosts themselves.'
)
)
@ -38,15 +37,14 @@ class ScheduleHostDowntimeCommandForm extends ScheduleServiceDowntimeCommandForm
'select',
'child_hosts',
array(
'label' => mt('monitoring', 'Child Hosts'),
'label' => $this->translate('Child Hosts'),
'required' => true,
'multiOptions' => array(
0 => mt('monitoring', 'Do nothing with child hosts'),
1 => mt('monitoring', 'Schedule triggered downtime for all child hosts'),
2 => mt('monitoring', 'Schedule non-triggered downtime for all child hosts')
0 => $this->translate('Do nothing with child hosts'),
1 => $this->translate('Schedule triggered downtime for all child hosts'),
2 => $this->translate('Schedule non-triggered downtime for all child hosts')
),
'description' => mt(
'monitoring',
'description' => $this->translate(
'Define what should be done with the child hosts of the hosts.'
)
)

View File

@ -32,8 +32,7 @@ class ScheduleServiceCheckCommandForm extends ObjectsCommandForm
*/
public function getHelp()
{
return mt(
'monitoring',
return $this->translate(
'This command is used to schedule the next check of hosts or services. Icinga will re-queue the'
. ' hosts or services to be checked at the time you specify.'
);
@ -52,8 +51,7 @@ class ScheduleServiceCheckCommandForm extends ObjectsCommandForm
'note',
'command-info',
array(
'value' => mt(
'monitoring',
'value' => $this->translate(
'This command is used to schedule the next check of hosts or services. Icinga will re-queue the'
. ' hosts or services to be checked at the time you specify.'
)
@ -64,8 +62,10 @@ class ScheduleServiceCheckCommandForm extends ObjectsCommandForm
'check_time',
array(
'required' => true,
'label' => mt('monitoring', 'Check Time'),
'description' => mt('monitoring', 'Set the date and time when the check should be scheduled.'),
'label' => $this->translate('Check Time'),
'description' => $this->translate(
'Set the date and time when the check should be scheduled.'
),
'value' => $checkTime
)
),
@ -73,9 +73,8 @@ class ScheduleServiceCheckCommandForm extends ObjectsCommandForm
'checkbox',
'force_check',
array(
'label' => mt('monitoring', 'Force Check'),
'description' => mt(
'monitoring',
'label' => $this->translate('Force Check'),
'description' => $this->translate(
'If you select this option, Icinga will force a check regardless of both what time the'
. ' scheduled check occurs and whether or not checks are enabled.'
)

View File

@ -42,8 +42,7 @@ class ScheduleServiceDowntimeCommandForm extends ObjectsCommandForm
*/
public function getHelp()
{
return mt(
'monitoring',
return $this->translate(
'This command is used to schedule host and service downtimes. During the specified downtime,'
. ' Icinga will not send notifications out about the hosts and services. When the scheduled'
. ' downtime expires, Icinga will send out notifications for the hosts and services as it'
@ -67,9 +66,8 @@ class ScheduleServiceDowntimeCommandForm extends ObjectsCommandForm
'comment',
array(
'required' => true,
'label' => mt('monitoring', 'Comment'),
'description' => mt(
'monitoring',
'label' => $this->translate('Comment'),
'description' => $this->translate(
'If you work with other administrators, you may find it useful to share information about the'
. ' the host or service that is having problems. Make sure you enter a brief description of'
. ' what you are doing.'
@ -81,8 +79,8 @@ class ScheduleServiceDowntimeCommandForm extends ObjectsCommandForm
'start',
array(
'required' => true,
'label' => mt('monitoring', 'Start Time'),
'description' => mt('monitoring', 'Set the start date and time for the downtime.'),
'label' => $this->translate('Start Time'),
'description' => $this->translate('Set the start date and time for the downtime.'),
'value' => $start
)
),
@ -91,8 +89,8 @@ class ScheduleServiceDowntimeCommandForm extends ObjectsCommandForm
'end',
array(
'required' => true,
'label' => mt('monitoring', 'End Time'),
'description' => mt('monitoring', 'Set the end date and time for the downtime.'),
'label' => $this->translate('End Time'),
'description' => $this->translate('Set the end date and time for the downtime.'),
'value' => $end
)
),
@ -102,17 +100,16 @@ class ScheduleServiceDowntimeCommandForm extends ObjectsCommandForm
array(
'required' => true,
'autosubmit' => true,
'label' => mt('monitoring', 'Type'),
'description' => mt(
'monitoring',
'label' => $this->translate('Type'),
'description' => $this->translate(
'If you select the fixed option, the downtime will be in effect between the start and end'
. ' times you specify whereas a flexible downtime starts when the host or service enters a'
. ' problem state sometime between the start and end times you specified and lasts as long'
. ' as the duration time you enter. The duration fields do not apply for fixed downtimes.'
),
'multiOptions' => array(
self::FIXED => mt('monitoring', 'Fixed'),
self::FLEXIBLE => mt('monitoring', 'Flexible')
self::FIXED => $this->translate('Fixed'),
self::FLEXIBLE => $this->translate('Flexible')
),
'validators' => array(
array(
@ -141,7 +138,7 @@ class ScheduleServiceDowntimeCommandForm extends ObjectsCommandForm
'hours',
array(
'required' => true,
'label' => mt('monitoring', 'Hours'),
'label' => $this->translate('Hours'),
'value' => 2,
'min' => -1
)
@ -151,7 +148,7 @@ class ScheduleServiceDowntimeCommandForm extends ObjectsCommandForm
'minutes',
array(
'required' => true,
'label' => mt('monitoring', 'Minutes'),
'label' => $this->translate('Minutes'),
'value' => 0,
'min' => -1
)
@ -161,9 +158,8 @@ class ScheduleServiceDowntimeCommandForm extends ObjectsCommandForm
array('hours', 'minutes'),
'duration',
array(
'legend' => mt('monitoring', 'Flexible Duration'),
'description' => mt(
'monitoring',
'legend' => $this->translate('Flexible Duration'),
'description' => $this->translate(
'Enter here the duration of the downtime. The downtime will be automatically deleted after this'
. ' time expired.'
),

View File

@ -33,7 +33,7 @@ class ToggleObjectFeaturesCommandForm extends ObjectsCommandForm
'checkbox',
ToggleObjectFeatureCommand::FEATURE_ACTIVE_CHECKS,
array(
'label' => mt('monitoring', 'Active Checks'),
'label' => $this->translate('Active Checks'),
'autosubmit' => true
)
),
@ -41,7 +41,7 @@ class ToggleObjectFeaturesCommandForm extends ObjectsCommandForm
'checkbox',
ToggleObjectFeatureCommand::FEATURE_PASSIVE_CHECKS,
array(
'label' => mt('monitoring', 'Passive Checks'),
'label' => $this->translate('Passive Checks'),
'autosubmit' => true
)
),
@ -49,7 +49,7 @@ class ToggleObjectFeaturesCommandForm extends ObjectsCommandForm
'checkbox',
ToggleObjectFeatureCommand::FEATURE_OBSESSING,
array(
'label' => mt('monitoring', 'Obsessing'),
'label' => $this->translate('Obsessing'),
'autosubmit' => true
)
),
@ -57,7 +57,7 @@ class ToggleObjectFeaturesCommandForm extends ObjectsCommandForm
'checkbox',
ToggleObjectFeatureCommand::FEATURE_NOTIFICATIONS,
array(
'label' => mt('monitoring', 'Notifications'),
'label' => $this->translate('Notifications'),
'autosubmit' => true
)
),
@ -65,7 +65,7 @@ class ToggleObjectFeaturesCommandForm extends ObjectsCommandForm
'checkbox',
ToggleObjectFeatureCommand::FEATURE_EVENT_HANDLER,
array(
'label' => mt('monitoring', 'Event Handler'),
'label' => $this->translate('Event Handler'),
'autosubmit' => true
)
),
@ -73,7 +73,7 @@ class ToggleObjectFeaturesCommandForm extends ObjectsCommandForm
'checkbox',
ToggleObjectFeatureCommand::FEATURE_FLAP_DETECTION,
array(
'label' => mt('monitoring', 'Flap Detection'),
'label' => $this->translate('Flap Detection'),
'autosubmit' => true
)
)
@ -95,7 +95,7 @@ class ToggleObjectFeaturesCommandForm extends ObjectsCommandForm
$element = $this->getElement($feature);
$element->setChecked($object->{$feature});
if ((bool) $object->{$feature . '_changed'} === true) {
$element->setDescription(mt('monitoring', 'changed'));
$element->setDescription($this->translate('changed'));
}
}
return $this;
@ -120,7 +120,7 @@ class ToggleObjectFeaturesCommandForm extends ObjectsCommandForm
}
}
}
Notification::success(mt('monitoring', 'Toggling feature..'));
Notification::success($this->translate('Toggling feature..'));
return true;
}
}

View File

@ -28,9 +28,9 @@ class LocalInstanceForm extends Form
'path',
array(
'required' => true,
'label' => mt('monitoring', 'Command File'),
'label' => $this->translate('Command File'),
'value' => '/var/run/icinga2/cmd/icinga2.cmd',
'description' => mt('monitoring', 'Path to the local Icinga command file')
'description' => $this->translate('Path to the local Icinga command file')
)
);
return $this;

View File

@ -29,8 +29,8 @@ class RemoteInstanceForm extends Form
'host',
array(
'required' => true,
'label' => mt('monitoring', 'Host'),
'description' => mt('monitoring',
'label' => $this->translate('Host'),
'description' => $this->translate(
'Hostname or address of the remote Icinga instance'
)
)
@ -40,8 +40,8 @@ class RemoteInstanceForm extends Form
'port',
array(
'required' => true,
'label' => mt('monitoring', 'Port'),
'description' => mt('monitoring', 'SSH port to connect to on the remote Icinga instance'),
'label' => $this->translate('Port'),
'description' => $this->translate('SSH port to connect to on the remote Icinga instance'),
'value' => 22
)
),
@ -50,8 +50,8 @@ class RemoteInstanceForm extends Form
'user',
array(
'required' => true,
'label' => mt('monitoring', 'User'),
'description' => mt('monitoring',
'label' => $this->translate('User'),
'description' => $this->translate(
'User to log in as on the remote Icinga instance. Please note that key-based SSH login must be'
. ' possible for this user'
)
@ -62,9 +62,9 @@ class RemoteInstanceForm extends Form
'path',
array(
'required' => true,
'label' => mt('monitoring', 'Command File'),
'label' => $this->translate('Command File'),
'value' => '/var/run/icinga2/cmd/icinga2.cmd',
'description' => mt('monitoring', 'Path to the Icinga command file on the remote Icinga instance')
'description' => $this->translate('Path to the Icinga command file on the remote Icinga instance')
)
)
));

View File

@ -25,7 +25,7 @@ class InstanceConfigForm extends ConfigForm
public function init()
{
$this->setName('form_config_monitoring_instance');
$this->setSubmitLabel(mt('monitoring', 'Save Changes'));
$this->setSubmitLabel($this->translate('Save Changes'));
}
/**
@ -48,7 +48,7 @@ class InstanceConfigForm extends ConfigForm
break;
default:
throw new InvalidArgumentException(
sprintf(mt('monitoring', 'Invalid instance type "%s" given'), $type)
sprintf($this->translate('Invalid instance type "%s" given'), $type)
);
}
return $form;
@ -69,10 +69,10 @@ class InstanceConfigForm extends ConfigForm
{
$name = isset($values['name']) ? $values['name'] : '';
if (! $name) {
throw new InvalidArgumentException(mt('monitoring', 'Instance name missing'));
throw new InvalidArgumentException($this->translate('Instance name missing'));
}
if ($this->config->hasSection($name)) {
throw new InvalidArgumentException(mt('monitoring', 'Instance already exists'));
throw new InvalidArgumentException($this->translate('Instance already exists'));
}
unset($values['name']);
@ -93,11 +93,11 @@ class InstanceConfigForm extends ConfigForm
public function edit($name, array $values)
{
if (! $name) {
throw new InvalidArgumentException(mt('monitoring', 'Old instance name missing'));
throw new InvalidArgumentException($this->translate('Old instance name missing'));
} elseif (! ($newName = isset($values['name']) ? $values['name'] : '')) {
throw new InvalidArgumentException(mt('monitoring', 'New instance name missing'));
throw new InvalidArgumentException($this->translate('New instance name missing'));
} elseif (! $this->config->hasSection($name)) {
throw new InvalidArgumentException(mt('monitoring', 'Unknown instance name provided'));
throw new InvalidArgumentException($this->translate('Unknown instance name provided'));
}
unset($values['name']);
@ -117,9 +117,9 @@ class InstanceConfigForm extends ConfigForm
public function remove($name)
{
if (! $name) {
throw new InvalidArgumentException(mt('monitoring', 'Instance name missing'));
throw new InvalidArgumentException($this->translate('Instance name missing'));
} elseif (! $this->config->hasSection($name)) {
throw new InvalidArgumentException(mt('monitoring', 'Unknown instance name provided'));
throw new InvalidArgumentException($this->translate('Unknown instance name provided'));
}
$instanceConfig = $this->config->getSection($name);
@ -136,10 +136,10 @@ class InstanceConfigForm extends ConfigForm
$instanceName = $this->request->getQuery('instance');
if ($instanceName !== null) {
if (! $instanceName) {
throw new ConfigurationError(mt('monitoring', 'Instance name missing'));
throw new ConfigurationError($this->translate('Instance name missing'));
}
if (! $this->config->hasSection($instanceName)) {
throw new ConfigurationError(mt('monitoring', 'Unknown instance name given'));
throw new ConfigurationError($this->translate('Unknown instance name given'));
}
$instanceConfig = $this->config->getSection($instanceName)->toArray();
@ -158,10 +158,10 @@ class InstanceConfigForm extends ConfigForm
try {
if ($instanceName === null) { // create new instance
$this->add($this->getValues());
$message = mt('monitoring', 'Instance "%s" created successfully.');
$message = $this->translate('Instance "%s" created successfully.');
} else { // edit existing instance
$this->edit($instanceName, $this->getValues());
$message = mt('monitoring', 'Instance "%s" edited successfully.');
$message = $this->translate('Instance "%s" edited successfully.');
}
} catch (InvalidArgumentException $e) {
Notification::error($e->getMessage());
@ -189,7 +189,7 @@ class InstanceConfigForm extends ConfigForm
'name',
array(
'required' => true,
'label' => mt('monitoring', 'Instance Name')
'label' => $this->translate('Instance Name')
)
),
array(
@ -198,10 +198,10 @@ class InstanceConfigForm extends ConfigForm
array(
'required' => true,
'autosubmit' => true,
'label' => mt('monitoring', 'Instance Type'),
'label' => $this->translate('Instance Type'),
'multiOptions' => array(
LocalCommandFile::TRANSPORT => mt('monitoring', 'Local Command File'),
RemoteCommandFile::TRANSPORT => mt('monitoring', 'Remote Command File')
LocalCommandFile::TRANSPORT => $this->translate('Local Command File'),
RemoteCommandFile::TRANSPORT => $this->translate('Remote Command File')
),
'value' => $instanceType
)

View File

@ -18,7 +18,7 @@ class SecurityConfigForm extends ConfigForm
public function init()
{
$this->setName('form_config_monitoring_security');
$this->setSubmitLabel(mt('monitoring', 'Save Changes'));
$this->setSubmitLabel($this->translate('Save Changes'));
}
/**
@ -29,7 +29,7 @@ class SecurityConfigForm extends ConfigForm
$this->config->setSection('security', $this->getValues());
if ($this->save()) {
Notification::success(mt('monitoring', 'New security configuration has successfully been stored'));
Notification::success($this->translate('New security configuration has successfully been stored'));
} else {
return false;
}
@ -54,8 +54,8 @@ class SecurityConfigForm extends ConfigForm
array(
'allowEmpty' => true,
'value' => '*pw*,*pass*,community',
'label' => mt('monitoring', 'Protected Custom Variables'),
'description' => mt('monitoring',
'label' => $this->translate('Protected Custom Variables'),
'description' => $this->translate(
'Comma separated case insensitive list of protected custom variables.'
. ' Use * as a placeholder for zero or more wildcard characters.'
. ' Existance of those custom variables will be shown, but their values will be masked.'

View File

@ -44,7 +44,7 @@ class EventOverviewForm extends Form
'checkbox',
'statechange',
array(
'label' => t('State Changes'),
'label' => $this->translate('State Changes'),
'class' => 'autosubmit',
'decorators' => $decorators,
'value' => strpos($url, $this->stateChangeFilter()->toQueryString()) === false ? 0 : 1
@ -54,7 +54,7 @@ class EventOverviewForm extends Form
'checkbox',
'downtime',
array(
'label' => t('Downtimes'),
'label' => $this->translate('Downtimes'),
'class' => 'autosubmit',
'decorators' => $decorators,
'value' => strpos($url, $this->downtimeFilter()->toQueryString()) === false ? 0 : 1
@ -64,7 +64,7 @@ class EventOverviewForm extends Form
'checkbox',
'comment',
array(
'label' => t('Comments'),
'label' => $this->translate('Comments'),
'class' => 'autosubmit',
'decorators' => $decorators,
'value' => strpos($url, $this->commentFilter()->toQueryString()) === false ? 0 : 1
@ -74,7 +74,7 @@ class EventOverviewForm extends Form
'checkbox',
'notification',
array(
'label' => t('Notifications'),
'label' => $this->translate('Notifications'),
'class' => 'autosubmit',
'decorators' => $decorators,
'value' => strpos($url, $this->notificationFilter()->toQueryString()) === false ? 0 : 1
@ -84,7 +84,7 @@ class EventOverviewForm extends Form
'checkbox',
'flapping',
array(
'label' => t('Flapping'),
'label' => $this->translate('Flapping'),
'class' => 'autosubmit',
'decorators' => $decorators,
'value' => strpos($url, $this->flappingFilter()->toQueryString()) === false ? 0 : 1

View File

@ -20,7 +20,7 @@ class BackendPage extends Form
'note',
'title',
array(
'value' => mt('monitoring', 'Monitoring Backend', 'setup.page.title'),
'value' => $this->translate('Monitoring Backend', 'setup.page.title'),
'decorators' => array(
'ViewHelper',
array('HtmlTag', array('tag' => 'h2'))
@ -31,8 +31,7 @@ class BackendPage extends Form
'note',
'description',
array(
'value' => mt(
'monitoring',
'value' => $this->translate(
'Please configure below how Icinga Web 2 should retrieve monitoring information.'
)
)
@ -44,8 +43,8 @@ class BackendPage extends Form
array(
'required' => true,
'value' => 'icinga',
'label' => mt('monitoring', 'Backend Name'),
'description' => mt('monitoring', 'The identifier of this backend')
'label' => $this->translate('Backend Name'),
'description' => $this->translate('The identifier of this backend')
)
);
@ -60,8 +59,10 @@ class BackendPage extends Form
'type',
array(
'required' => true,
'label' => mt('monitoring', 'Backend Type'),
'description' => mt('monitoring', 'The data source used for retrieving monitoring information'),
'label' => $this->translate('Backend Type'),
'description' => $this->translate(
'The data source used for retrieving monitoring information'
),
'multiOptions' => $resourceTypes
)
);

View File

@ -28,7 +28,7 @@ class IdoResourcePage extends Form
'note',
'title',
array(
'value' => mt('monitoring', 'Monitoring IDO Resource', 'setup.page.title'),
'value' => $this->translate('Monitoring IDO Resource', 'setup.page.title'),
'decorators' => array(
'ViewHelper',
array('HtmlTag', array('tag' => 'h2'))
@ -39,8 +39,7 @@ class IdoResourcePage extends Form
'note',
'description',
array(
'value' => mt(
'monitoring',
'value' => $this->translate(
'Please fill out the connection details below to access'
. ' the IDO database of your monitoring environment.'
)
@ -91,8 +90,10 @@ class IdoResourcePage extends Form
'skip_validation',
array(
'required' => true,
'label' => t('Skip Validation'),
'description' => t('Check this to not to validate connectivity with the given database server')
'label' => $this->translate('Skip Validation'),
'description' => $this->translate(
'Check this to not to validate connectivity with the given database server'
)
)
);
}

View File

@ -20,7 +20,7 @@ class InstancePage extends Form
'note',
'title',
array(
'value' => mt('monitoring', 'Monitoring Instance', 'setup.page.title'),
'value' => $this->translate('Monitoring Instance', 'setup.page.title'),
'decorators' => array(
'ViewHelper',
array('HtmlTag', array('tag' => 'h2'))
@ -31,8 +31,7 @@ class InstancePage extends Form
'note',
'description',
array(
'value' => mt(
'monitoring',
'value' => $this->translate(
'Please define the settings specific to your monitoring instance below.'
)
)

View File

@ -28,7 +28,7 @@ class LivestatusResourcePage extends Form
'note',
'title',
array(
'value' => mt('monitoring', 'Monitoring Livestatus Resource', 'setup.page.title'),
'value' => $this->translate('Monitoring Livestatus Resource', 'setup.page.title'),
'decorators' => array(
'ViewHelper',
array('HtmlTag', array('tag' => 'h2'))
@ -39,8 +39,7 @@ class LivestatusResourcePage extends Form
'note',
'description',
array(
'value' => mt(
'monitoring',
'value' => $this->translate(
'Please fill out the connection details below to access the Livestatus'
. ' socket interface for your monitoring environment.'
)
@ -91,8 +90,10 @@ class LivestatusResourcePage extends Form
'skip_validation',
array(
'required' => true,
'label' => t('Skip Validation'),
'description' => t('Check this to not to validate connectivity with the given Livestatus socket')
'label' => $this->translate('Skip Validation'),
'description' => $this->translate(
'Check this to not to validate connectivity with the given Livestatus socket'
)
)
);
}

View File

@ -20,7 +20,7 @@ class SecurityPage extends Form
'note',
'title',
array(
'value' => mt('monitoring', 'Monitoring Security', 'setup.page.title'),
'value' => $this->translate('Monitoring Security', 'setup.page.title'),
'decorators' => array(
'ViewHelper',
array('HtmlTag', array('tag' => 'h2'))
@ -31,8 +31,7 @@ class SecurityPage extends Form
'note',
'description',
array(
'value' => mt(
'monitoring',
'value' => $this->translate(
'To protect your monitoring environment against prying eyes please fill out the settings below.'
)
)

View File

@ -19,10 +19,7 @@ class WelcomePage extends Form
'note',
'welcome',
array(
'value' => mt(
'monitoring',
'Welcome to the configuration of the monitoring module for Icinga Web 2!'
),
'value' => $this->translate('Welcome to the configuration of the monitoring module for Icinga Web 2!'),
'decorators' => array(
'ViewHelper',
array('HtmlTag', array('tag' => 'h2'))
@ -34,7 +31,7 @@ class WelcomePage extends Form
'note',
'core_hint',
array(
'value' => mt('monitoring', 'This is the core module for Icinga Web 2.')
'value' => $this->translate('This is the core module for Icinga Web 2.')
)
);
@ -42,8 +39,7 @@ class WelcomePage extends Form
'note',
'description',
array(
'value' => mt(
'monitoring',
'value' => $this->translate(
'It offers various status and reporting views with powerful filter capabilities that allow'
. ' you to keep track of the most important events in your monitoring environment.'
)

View File

@ -19,7 +19,7 @@ class StatehistoryForm extends Form
public function init()
{
$this->setName('form_event_overview');
$this->setSubmitLabel(mt('monitoring', 'Apply'));
$this->setSubmitLabel($this->translate('Apply'));
}
/**
@ -65,14 +65,14 @@ class StatehistoryForm extends Form
'select',
'from',
array(
'label' => mt('monitoring', 'From'),
'label' => $this->translate('From'),
'value' => $this->getRequest()->getParam('from', strtotime('3 months ago')),
'multiOptions' => array(
strtotime('midnight 3 months ago') => mt('monitoring', '3 Months'),
strtotime('midnight 4 months ago') => mt('monitoring', '4 Months'),
strtotime('midnight 8 months ago') => mt('monitoring', '8 Months'),
strtotime('midnight 12 months ago') => mt('monitoring', '1 Year'),
strtotime('midnight 24 months ago') => mt('monitoring', '2 Years')
strtotime('midnight 3 months ago') => $this->translate('3 Months'),
strtotime('midnight 4 months ago') => $this->translate('4 Months'),
strtotime('midnight 8 months ago') => $this->translate('8 Months'),
strtotime('midnight 12 months ago') => $this->translate('1 Year'),
strtotime('midnight 24 months ago') => $this->translate('2 Years')
),
'class' => 'autosubmit'
)
@ -81,10 +81,10 @@ class StatehistoryForm extends Form
'select',
'to',
array(
'label' => mt('monitoring', 'To'),
'label' => $this->translate('To'),
'value' => $this->getRequest()->getParam('to', time()),
'multiOptions' => array(
time() => mt('monitoring', 'Today')
time() => $this->translate('Today')
),
'class' => 'autosubmit'
)
@ -95,11 +95,11 @@ class StatehistoryForm extends Form
'select',
'objecttype',
array(
'label' => mt('monitoring', 'Object type'),
'label' => $this->translate('Object type'),
'value' => $objectType,
'multiOptions' => array(
'services' => mt('monitoring', 'Services'),
'hosts' => mt('monitoring', 'Hosts')
'services' => $this->translate('Services'),
'hosts' => $this->translate('Hosts')
),
'class' => 'autosubmit'
)
@ -113,13 +113,13 @@ class StatehistoryForm extends Form
'select',
'state',
array(
'label' => mt('monitoring', 'State'),
'label' => $this->translate('State'),
'value' => $serviceState,
'multiOptions' => array(
'cnt_critical_hard' => mt('monitoring', 'Critical'),
'cnt_warning_hard' => mt('monitoring', 'Warning'),
'cnt_unknown_hard' => mt('monitoring', 'Unknown'),
'cnt_ok' => mt('monitoring', 'Ok')
'cnt_critical_hard' => $this->translate('Critical'),
'cnt_warning_hard' => $this->translate('Warning'),
'cnt_unknown_hard' => $this->translate('Unknown'),
'cnt_ok' => $this->translate('Ok')
),
'class' => 'autosubmit'
)
@ -133,12 +133,12 @@ class StatehistoryForm extends Form
'select',
'state',
array(
'label' => mt('monitoring', 'State'),
'label' => $this->translate('State'),
'value' => $hostState,
'multiOptions' => array(
'cnt_up' => mt('monitoring', 'Up'),
'cnt_down_hard' => mt('monitoring', 'Down'),
'cnt_unreachable_hard' => mt('monitoring', 'Unreachable')
'cnt_up' => $this->translate('Up'),
'cnt_down_hard' => $this->translate('Down'),
'cnt_unreachable_hard' => $this->translate('Unreachable')
),
'class' => 'autosubmit'
)