Replace all mt() calls with translate() in the setup module's view scripts

This commit is contained in:
Johannes Meyer 2015-01-20 17:39:47 +01:00
parent 095d9437b8
commit 99699a14ad
6 changed files with 23 additions and 27 deletions

View File

@ -4,8 +4,8 @@ use Icinga\Web\Wizard;
?> ?>
<div class="module-menu"> <div class="module-menu">
<p><?= mt('setup', 'The following modules can be set up by using a web-based wizard as well. To setup a module, just complete its wizard and advance to the summary!'); ?></p> <p><?= $this->translate('The following modules can be set up by using a web-based wizard as well. To setup a module, just complete its wizard and advance to the summary!'); ?></p>
<p><?= mt('setup', 'You can freely switch to a module\'s wizard by clicking its name below. The wizard you are currently looking at is written in bold. A small tick is shown on the right once a wizard has been completed.'); ?></p> <p><?= $this->translate('You can freely switch to a module\'s wizard by clicking its name below. The wizard you are currently looking at is written in bold. A small tick is shown on the right once a wizard has been completed.'); ?></p>
<form name="<?= $form->getName(); ?>" enctype="<?= $form->getEncType(); ?>" method="<?= $form->getMethod(); ?>" action="<?= $form->getAction(); ?>"> <form name="<?= $form->getName(); ?>" enctype="<?= $form->getEncType(); ?>" method="<?= $form->getMethod(); ?>" action="<?= $form->getAction(); ?>">
<?= $form->getElement($form->getTokenElementName()); ?> <?= $form->getElement($form->getTokenElementName()); ?>
<?= $form->getElement($form->getUidElementName()); ?> <?= $form->getElement($form->getUidElementName()); ?>
@ -19,7 +19,7 @@ use Icinga\Web\Wizard;
<?= $isActive ? '<strong>' : '' ?><?= $module->getTitle(); ?><?= $isActive ? '</strong>' : '' ?> <?= $isActive ? '<strong>' : '' ?><?= $module->getTitle(); ?><?= $isActive ? '</strong>' : '' ?>
</button> </button>
<?php if ($module->getSetupWizard()->isFinished()): ?> <?php if ($module->getSetupWizard()->isFinished()): ?>
<?= $this->icon('ok', mt('setup', 'Completed', 'setup.modules.wizard.state')); ?> <?= $this->icon('ok', $this->translate('Completed', 'setup.modules.wizard.state')); ?>
<?php else: ?> <?php else: ?>
<?php $allFinished = false; ?> <?php $allFinished = false; ?>
<?php endif ?> <?php endif ?>
@ -29,9 +29,9 @@ use Icinga\Web\Wizard;
</ul> </ul>
</form> </form>
<?php if ($allFinished): ?> <?php if ($allFinished): ?>
<p class="all-completed"><?= mt('setup', 'You\'ve completed all module wizards!'); ?></p> <p class="all-completed"><?= $this->translate('You\'ve completed all module wizards!'); ?></p>
<?php else: ?> <?php else: ?>
<p style="font-size: 80%;"><?= mt('setup', 'Note that you can skip a specific module by just not completing its wizard.'); ?></p> <p style="font-size: 80%;"><?= $this->translate('Note that you can skip a specific module by just not completing its wizard.'); ?></p>
<?php endif ?> <?php endif ?>
</div> </div>
<div class="module-wizard"> <div class="module-wizard">

View File

@ -22,7 +22,7 @@ $requirements = $form->getRequirements();
<td></td> <td></td>
<td class="btn-update"> <td class="btn-update">
<div class="buttons"> <div class="buttons">
<a title="<?= $this->translate('You may also need to restart the web-server for the changes to take effect!'); ?>" href="<?= $this->href(); ?>" class="button-like"><?= mt('setup', 'Refresh'); ?></a> <a title="<?= $this->translate('You may also need to restart the web-server for the changes to take effect!'); ?>" href="<?= $this->href(); ?>" class="button-like"><?= $this->translate('Refresh'); ?></a>
</div> </div>
</td> </td>
</tr> </tr>

View File

@ -4,8 +4,7 @@ use Icinga\Web\Wizard;
?> ?>
<p><?= sprintf( <p><?= sprintf(
mt( $this->translate(
'setup',
'The wizard is now complete. You can review the changes supposed to be made before setting up %1$s.' 'The wizard is now complete. You can review the changes supposed to be made before setting up %1$s.'
. ' Make sure that everything is correct (Feel free to navigate back to make any corrections!) so' . ' Make sure that everything is correct (Feel free to navigate back to make any corrections!) so'
. ' that you can start using %1$s right after it has successfully been set up.' . ' that you can start using %1$s right after it has successfully been set up.'

View File

@ -11,16 +11,14 @@ $cliPath = realpath(Icinga::app()->getApplicationDir() . '/../bin/icingacli');
?> ?>
<div class="welcome-page"> <div class="welcome-page">
<h2><?= mt('setup', 'Welcome to the configuration of Icinga Web 2!') ?></h2> <h2><?= $this->translate('Welcome to the configuration of Icinga Web 2!') ?></h2>
<?php if (false === file_exists($setupTokenPath) && file_exists(Config::resolvePath('config.ini'))): ?> <?php if (false === file_exists($setupTokenPath) && file_exists(Config::resolvePath('config.ini'))): ?>
<p class="restart-warning"><?= mt( <p class="restart-warning"><?= $this->translate(
'setup',
'You\'ve already completed the configuration of Icinga Web 2. Note that most of your configuration' 'You\'ve already completed the configuration of Icinga Web 2. Note that most of your configuration'
. ' files will be overwritten in case you\'ll re-configure Icinga Web 2 using this wizard!' . ' files will be overwritten in case you\'ll re-configure Icinga Web 2 using this wizard!'
); ?></p> ); ?></p>
<?php else: ?> <?php else: ?>
<p><?= mt( <p><?= $this->translate(
'setup',
'This wizard will guide you through the configuration of Icinga Web 2. Once completed and successfully' 'This wizard will guide you through the configuration of Icinga Web 2. Once completed and successfully'
. ' finished you are able to log in and to explore all the new and stunning features!' . ' finished you are able to log in and to explore all the new and stunning features!'
); ?></p> ); ?></p>
@ -39,23 +37,22 @@ $cliPath = realpath(Icinga::app()->getApplicationDir() . '/../bin/icingacli');
</div> </div>
<div> <div>
<p><?= <p><?=
mt( $this->translate(
'setup',
'To run this wizard a user needs to authenticate using a token which is usually' 'To run this wizard a user needs to authenticate using a token which is usually'
. ' provided to him by an administrator who\'d followed the instructions below.' . ' provided to him by an administrator who\'d followed the instructions below.'
); ?></p> ); ?></p>
<p><?= mt('setup', 'If you\'ve got the IcingaCLI installed you can do the following:'); ?></p> <p><?= $this->translate('If you\'ve got the IcingaCLI installed you can do the following:'); ?></p>
<div class="code"> <div class="code">
<span><?= $cliPath ? $cliPath : 'icingacli'; ?> setup config directory --group <?= ($user = Platform::getPhpUser()) !== null ? $user : 'your_webserver_group'; ?><?= $configDir !== '/etc/icingaweb2' ? ' --config ' . $configDir : ''; ?>;</span> <span><?= $cliPath ? $cliPath : 'icingacli'; ?> setup config directory --group <?= ($user = Platform::getPhpUser()) !== null ? $user : 'your_webserver_group'; ?><?= $configDir !== '/etc/icingaweb2' ? ' --config ' . $configDir : ''; ?>;</span>
<span><?= $cliPath ? $cliPath : 'icingacli'; ?> setup token create;</span> <span><?= $cliPath ? $cliPath : 'icingacli'; ?> setup token create;</span>
</div> </div>
<p><?= mt('setup', 'In case the IcingaCLI is missing you can create the token manually:'); ?></p> <p><?= $this->translate('In case the IcingaCLI is missing you can create the token manually:'); ?></p>
<div class="code"> <div class="code">
<span>su <?= ($user = Platform::getPhpUser()) !== null ? $user : 'your_webserver_user'; ?> -c "mkdir -m 2770 <?= dirname($setupTokenPath); ?>; head -c 12 /dev/urandom | base64 | tee <?= $setupTokenPath; ?>; chmod 0660 <?= $setupTokenPath; ?>;";</span> <span>su <?= ($user = Platform::getPhpUser()) !== null ? $user : 'your_webserver_user'; ?> -c "mkdir -m 2770 <?= dirname($setupTokenPath); ?>; head -c 12 /dev/urandom | base64 | tee <?= $setupTokenPath; ?>; chmod 0660 <?= $setupTokenPath; ?>;";</span>
</div> </div>
<p><?= sprintf( <p><?= sprintf(
mt('setup', 'Please see the %s for an extensive description on how to access and use this wizard.'), $this->translate('Please see the %s for an extensive description on how to access and use this wizard.'),
'<a href="http://docs.icinga.org/">' . mt('setup', 'Icinga Web 2 documentation') . '</a>' // TODO: Add link to iw2 docs which points to the installation topic '<a href="http://docs.icinga.org/">' . $this->translate('Icinga Web 2 documentation') . '</a>' // TODO: Add link to iw2 docs which points to the installation topic
); ?></p> ); ?></p>
</div> </div>
</div> </div>

View File

@ -30,7 +30,7 @@ if ($notifications->hasMessages()) {
<?= $this->img('img/logo_icinga_big.png'); ?> <?= $this->img('img/logo_icinga_big.png'); ?>
<div class="progress-bar"> <div class="progress-bar">
<div class="step" style="width: 10%;"> <div class="step" style="width: 10%;">
<h1><?= mt('setup', 'Welcome', 'setup.progress'); ?></h1> <h1><?= $this->translate('Welcome', 'setup.progress'); ?></h1>
<?php $stateClass = $finished || $currentPos > 0 ? 'complete' : ( <?php $stateClass = $finished || $currentPos > 0 ? 'complete' : (
$maxProgress > 0 ? 'visited' : 'active' $maxProgress > 0 ? 'visited' : 'active'
); ?> ); ?>
@ -54,7 +54,7 @@ if ($notifications->hasMessages()) {
</tr></tbody></table> </tr></tbody></table>
</div> </div>
<div class="step" style="width: 10%;"> <div class="step" style="width: 10%;">
<h1><?= mt('setup', 'Requirements', 'setup.progress'); ?></h1> <h1><?= $this->translate('Requirements', 'setup.progress'); ?></h1>
<?php $stateClass = $finished || $currentPos > 2 ? ' complete' : ( <?php $stateClass = $finished || $currentPos > 2 ? ' complete' : (
$maxProgress > 2 ? ' visited' : ( $maxProgress > 2 ? ' visited' : (
$currentPos === 2 ? ' active' : '' $currentPos === 2 ? ' active' : ''
@ -67,7 +67,7 @@ if ($notifications->hasMessages()) {
</tr></tbody></table> </tr></tbody></table>
</div> </div>
<div class="step" style="width: 60%;"> <div class="step" style="width: 60%;">
<h1><?= mt('setup', 'Configuration', 'setup.progress'); ?></h1> <h1><?= $this->translate('Configuration', 'setup.progress'); ?></h1>
<table><tbody><tr> <table><tbody><tr>
<td class="left"> <td class="left">
<?php <?php
@ -118,7 +118,7 @@ if ($notifications->hasMessages()) {
</tr></tbody></table> </tr></tbody></table>
</div> </div>
<div class="step" style="width: 10%;"> <div class="step" style="width: 10%;">
<h1><?= mt('setup', 'Finish', 'setup.progress'); ?></h1> <h1><?= $this->translate('Finish', 'setup.progress'); ?></h1>
<?php $stateClass = $finished ? ' active' : ''; ?> <?php $stateClass = $finished ? ' active' : ''; ?>
<table><tbody><tr> <table><tbody><tr>
<td class="left"><div class="line left<?= $stateClass; ?>"></div></td> <td class="left"><div class="line left<?= $stateClass; ?>"></div></td>

View File

@ -11,16 +11,16 @@
<?php endif ?> <?php endif ?>
<?php endforeach ?> <?php endforeach ?>
<?php if ($success): ?> <?php if ($success): ?>
<p class="success"><?= mt('setup', 'Congratulations! Icinga Web 2 has been successfully set up.'); ?></p> <p class="success"><?= $this->translate('Congratulations! Icinga Web 2 has been successfully set up.'); ?></p>
<?php else: ?> <?php else: ?>
<p class="failure"><?= mt('setup', 'Sorry! Failed to set up Icinga Web 2 successfully.'); ?></p> <p class="failure"><?= $this->translate('Sorry! Failed to set up Icinga Web 2 successfully.'); ?></p>
<?php endif ?> <?php endif ?>
</div> </div>
<div class="buttons"> <div class="buttons">
<?php if ($success): ?> <?php if ($success): ?>
<a href="<?= $this->href('authentication/login'); ?>" class="button-like login"><?= mt('setup', 'Login to Icinga Web 2'); ?></a> <a href="<?= $this->href('authentication/login'); ?>" class="button-like login"><?= $this->translate('Login to Icinga Web 2'); ?></a>
<?php else: ?> <?php else: ?>
<a href="<?= $this->href(); ?>" class="button-like"><?= mt('setup', 'Back'); ?></a> <a href="<?= $this->href(); ?>" class="button-like"><?= $this->translate('Back'); ?></a>
<?php endif ?> <?php endif ?>
</div> </div>
</div> </div>