Skip to content

Commit 815dd63

Browse files
author
Timm Ortloff
committed
SendForm: translate texts
1 parent 5c0a242 commit 815dd63

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

library/Reporting/Web/Forms/SendForm.php

+9-7
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,14 @@
1010
use Icinga\Module\Reporting\ProvidedReports;
1111
use Icinga\Module\Reporting\Report;
1212
use Icinga\Module\Reporting\Web\Forms\Decorator\CompatDecorator;
13+
use ipl\I18n\Translation;
1314
use ipl\Web\Compat\CompatForm;
1415

1516
class SendForm extends CompatForm
1617
{
1718
use Database;
1819
use ProvidedReports;
20+
use Translation;
1921

2022
/** @var Report */
2123
protected $report;
@@ -34,34 +36,34 @@ protected function assemble()
3436
(new SendMail())->initConfigForm($this, $this->report);
3537

3638
$radio = $this->addElement('radio', 'source_radio', [
37-
'label' => 'E-Mail Source',
39+
'label' => $this->translate('E-Mail Source'),
3840
'options' => [
39-
'manual' => 'Manual',
40-
'contacts' => 'Contacts',
41+
'manual' => $this->translate('Manual input'),
42+
'contacts' => $this->translate('Contacts'),
4143
],
4244
'value' => 'contacts',
4345
'class' => 'autosubmit'
4446
]);
4547

4648
if ($radio->getValue('source_radio') === 'contacts') {
47-
$emails = [null => 'Select Contacts'];
49+
$emails = [null => $this->translate('Select Contacts')];
4850
foreach (EmailProviderHook::getProviders() as $provider) {
4951
$emails = array_merge($emails, $provider->getContactEmails());
5052
}
5153

5254
$this->addElement('select', 'emails_list', [
5355
'multiple' => true,
54-
'label' => 'Contacts',
56+
'label' => $this->translate('Contacts'),
5557
'options' => $emails
5658
]);
5759
} else {
5860
$this->addElement('textarea', 'emails_manual', [
59-
'label' => 'Contact E-Mails'
61+
'label' => $this->translate('Contact E-Mails')
6062
]);
6163
}
6264

6365
$this->addElement('submit', 'submit', [
64-
'label' => 'Send Report'
66+
'label' => $this->translate('Send Report')
6567
]);
6668
}
6769

0 commit comments

Comments
 (0)