|
3 | 3 | namespace Icinga\Editor; |
4 | 4 |
|
5 | 5 | /** |
6 | | - * Icinga Editor - generování konfigurace |
| 6 | + * Icinga Editor - Configuration Generating |
7 | 7 | * |
8 | 8 | * @package IcingaEditor |
9 | | - * @subpackage WebUI |
10 | 9 | * @author Vitex <vitex@hippy.cz> |
11 | | - * @copyright 2012 Vitex@hippy.cz (G) |
| 10 | + * @copyright 2012-2016 Vitex@hippy.cz (G) |
12 | 11 | */ |
13 | 12 | require_once 'includes/IEInit.php'; |
14 | 13 |
|
|
56 | 55 | if (($line === false) && ($line_num == 1)) { |
57 | 56 | $errorLine = $oPage->container->addItem(new \Ease\Html\Div('<span class="label label-important">'._('Chyba:').'</span>', |
58 | 57 | ['class' => 'alert alert-danger'])); |
59 | | - $oUser->addStatusMessage(_('Kontrola konfigurace nevrátila výsledek.'), |
| 58 | + $oUser->addStatusMessage(_('Configuration control empty result'), |
60 | 59 | 'error'); |
61 | | - $errorLine->addItem(_('Zkontroluj prosím zdlali nechybí potřebný fragment v /etc/sudoers:')); |
| 60 | + $errorLine->addItem(_('Please check if /etc/sudoers contains:')); |
62 | 61 | $errorLine->addItem(new \Ease\Html\Div('User_Alias APACHE = www-data')); |
63 | 62 | $errorLine->addItem(new \Ease\Html\Div('Cmnd_Alias ICINGA = /usr/sbin/icinga, /etc/init.d/icinga')); |
64 | 63 | $errorLine->addItem(new \Ease\Html\Div('APACHE ALL = (ALL) NOPASSWD: ICINGA')); |
|
67 | 66 |
|
68 | 67 | if (strstr($line, 'Error:')) { |
69 | 68 | $line = str_replace('Error:', '', $line); |
70 | | - $errorLine = $oPage->container->addItem(new \Ease\Html\Div('<span class="label label-important">'._('Chyba:').'</span>', |
| 69 | + $errorLine = $oPage->container->addItem(new \Ease\Html\Div('<span class="label label-important">'._('Error:').'</span>', |
71 | 70 | ['class' => 'alert alert-danger'])); |
72 | 71 |
|
73 | 72 | $keywords = preg_split("/['(.*)']+/", $line); |
74 | 73 | switch (trim($keywords[0])) { |
75 | 74 | case 'Service notification period': |
76 | | - $errorLine->addItem(' <a href="timeperiods.php">'._('Notifikační perioda').'</a> služeb '); |
| 75 | + $errorLine->addItem(' <a href="timeperiods.php">'._('Notification period').'</a> of services '); |
77 | 76 | $errorLine->addItem(new \Ease\Html\ATag('timeperiod.php?timeperiod_name='.$keywords[1], |
78 | 77 | $keywords[1])); |
79 | 78 | break; |
80 | 79 | case 'Host notification period': |
81 | | - $errorLine->addItem(' <a href="timeperiods.php">'._('Notifikační perioda').'</a> hostů'); |
| 80 | + $errorLine->addItem(' <a href="timeperiods.php">'._('Notification period').'</a> of hosts'); |
82 | 81 | $errorLine->addItem(new \Ease\Html\ATag('timeperiod.php?timeperiod_name='.$keywords[1], |
83 | 82 | $keywords[1])); |
84 | 83 | break; |
|
91 | 90 | if (isset($keywords[2])) { |
92 | 91 | switch (trim($keywords[2])) { |
93 | 92 | case 'specified for contact': |
94 | | - $errorLine->addItem(' specifikovaná pro kontakt '); |
| 93 | + $errorLine->addItem(' specified for contact '); |
95 | 94 | $contact = new Engine\Contact($keywords[3]); |
96 | 95 | $errorLine->addItem(new \Ease\Html\ATag('contact.php?contact_id='.$contact->getMyKey(), |
97 | 96 | $keywords[3])); |
|
104 | 103 | if (isset($keywords[4])) { |
105 | 104 | switch (trim($keywords[4])) { |
106 | 105 | case 'is not defined anywhere!': |
107 | | - $errorLine->addItem(' není nikde definován/a '); |
| 106 | + $errorLine->addItem(''._('is not defined anywhere')); |
108 | 107 | break; |
109 | 108 | } |
110 | 109 | } |
111 | | - //$OPage->addItem('<pre>' . EaseBrick::printPreBasic($keywords) . '</pre>'); |
112 | 110 | } |
113 | 111 |
|
114 | 112 | if (strstr($line, 'Error in configuration file')) { |
|
145 | 143 | if (strstr($line, 'Total Warnings')) { |
146 | 144 | list($msg, $WarningCount) = explode(':', $line); |
147 | 145 | if (intval(trim($WarningCount))) { |
148 | | - $oUser->addStatusMessage(sprintf(_('celkem %s varování'), |
| 146 | + $oUser->addStatusMessage(sprintf(_('total %s warnings'), |
149 | 147 | $WarningCount), 'warning'); |
150 | 148 | } else { |
151 | | - $oUser->addStatusMessage(_('test proběhl bez varování'), |
| 149 | + $oUser->addStatusMessage(_('test successfully done without warnings'), |
152 | 150 | 'success'); |
153 | 151 | } |
154 | 152 | } |
155 | 153 | if (strstr($line, 'Total Errors')) { |
156 | 154 | list($msg, $errorCount) = explode(':', $line); |
157 | 155 | if (intval(trim($errorCount))) { |
158 | | - $oUser->addStatusMessage(sprintf(_('celkem %s chyb'), |
| 156 | + $oUser->addStatusMessage(sprintf(_('total %s errors'), |
159 | 157 | $errorCount), 'warning'); |
160 | 158 | } else { |
161 | | - $oUser->addStatusMessage(_('test proběhl bez chyb'), 'success'); |
| 159 | + $oUser->addStatusMessage(_('test successfully done without errors'), |
| 160 | + 'success'); |
162 | 161 | } |
163 | 162 | } |
164 | 163 | } |
165 | 164 | fclose($testing); |
166 | 165 |
|
167 | 166 | if (!intval($errorCount) && !is_null($WarningCount)) { |
168 | 167 | if (Engine\Configurator::reloadIcinga()) { |
169 | | - $oPage->container->addItem(_('Všechny vaše konfigurační soubory byly přegenerovány')); |
| 168 | + $oPage->container->addItem(_('All your configuration files was regenerated')); |
| 169 | + |
170 | 170 | $oPage->container->addItem(new \Ease\TWB\LinkButton('main.php', |
171 | | - _('Hotovo').' '.\Ease\TWB\Part::GlyphIcon('ok-sign'), 'success')); |
| 171 | + _('Done').' '.\Ease\TWB\Part::GlyphIcon('ok-sign'), 'success')); |
172 | 172 | \Ease\Shared::user()->setSettingValue('unsaved', false); |
173 | 173 | } |
174 | 174 | } |
|
0 commit comments