Skip to content

Commit

Permalink
Added module-scope dictionary, translations updated in account module
Browse files Browse the repository at this point in the history
  • Loading branch information
SilverFire committed Nov 17, 2015
1 parent e4d1a1a commit 7bad7ab
Show file tree
Hide file tree
Showing 9 changed files with 84 additions and 47 deletions.
9 changes: 9 additions & 0 deletions src/Plugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,14 @@ class Plugin extends \hiqdev\pluginmanager\Plugin
'class' => 'hipanel\modules\hosting\Module',
],
],
'translations' => [
'hipanel/hosting' => [
'class' => 'yii\i18n\PhpMessageSource',
'basePath' => '@hipanel/modules/hosting/messages',
'fileMap' => [
'hipanel/hosting' => 'hosting.php',
]
]
]
];
}
28 changes: 28 additions & 0 deletions src/messages/ru/hosting.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<?php

return [
'Block account' => 'Заблокировать акканут',
'Confirm account blocking' => 'Подтвердите блокировку аккаунта',
'This will immediately terminate SSH sessions and reject new SSH and FTP connections' => 'Это приведет к немедленному разрыву активных SSH соединений и запретит установку новых SSH или FTP соединений!',
'Unblock account' => 'Разблокировать аккаунт',
'Confirm account unblocking' => 'Подтвердите разблокировку аккаунта',
'Access to the account is opened by default. Please input the IPs, for which the access to the server will be granted' => 'Доступ к аккаунту открыт по умолчанию. Пожалуйста, введите IP-адреса, для которых доступ к серверу будет предоставлен',
'IP restrictions' => 'Ограничения по IP',
'Create FTP account' => 'Создать FTP аккаунт',
'Create account' => 'Создать аккаунт',
'Accounts' => 'Аккаунты',
'account mail config' => 'найстройки почты аккаунта',
'Mail config' => 'Настройки почты',
'Account creating task has been added to queue' => 'Задача создания аккаунта была добавлена в очередь',
'Account deleting task has been added to queue' => 'Задача удаления аккаунта записи была добавлена в очередь',
'Account detailed information' => 'Подробная информация о аккаунте',
'Account information' => 'Информация об аккаунте',
'Confirm account deleting' => 'Подтвердите удаление аккаунта',
'Are you sure you want to delete account {name}? You will loose all data, that relates this account!' => 'Вы уверены, что хотите удалить аккаунт {name}? Вы потеряете все данные, что связаны с ним!',
'Enter mail settings' => 'Введите настройки почты',
'Mail settings' => 'Настройки почты',
'This will immediately terminate all sessions of the user!' => 'Это немедленно прервет все сеансы пользователя!',
'Enter new restrictions' => 'Введите новые ограничения',
'Enter a new password' => 'Введите новый пароль',

];
18 changes: 9 additions & 9 deletions src/views/account/_block.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,23 +9,23 @@
$modalButton = ModalButton::begin([
'model' => $model,
'scenario' => 'enable-block',
'button' => ['label' => '<i class="ion-locked"></i>' . Yii::t('app', 'Block account')],
'button' => ['label' => '<i class="ion-locked"></i>' . Yii::t('hipanel/hosting', 'Block account')],
'form' => [
'enableAjaxValidation' => true,
'validationUrl' => Url::toRoute(['validate-form', 'scenario' => 'enable-block']),
],
'modal' => [
'header' => Html::tag('h4', Yii::t('app', 'Confirm account blocking')),
'header' => Html::tag('h4', Yii::t('hipanel/hosting', 'Confirm account blocking')),
'headerOptions' => ['class' => 'label-danger'],
'footer' => [
'label' => Yii::t('app', 'Block'),
'data-loading-text' => Yii::t('app', 'Blocking...'),
'label' => Yii::t('hipanel', 'Block'),
'data-loading-text' => Yii::t('hipanel', 'Blocking...'),
'class' => 'btn btn-danger',
]
]
]); ?>
<div class="callout callout-warning">
<h4><?= Yii::t('app', 'This will immediately terminate SSH sessions and reject new SSH and FTP connections!') ?></h4>
<h4><?= Yii::t('hipanel/hosting', 'This will immediately terminate SSH sessions and reject new SSH and FTP connections!') ?></h4>
</div>

<?php echo $modalButton->form->field($model, 'type')->dropDownList($blockReasons); ?>
Expand All @@ -36,17 +36,17 @@
$modalButton = ModalButton::begin([
'model' => $model,
'scenario' => 'disable-block',
'button' => ['label' => '<i class="ion-unlocked"></i>' . Yii::t('app', 'Unblock account')],
'button' => ['label' => '<i class="ion-unlocked"></i>' . Yii::t('hipanel/hosting', 'Unblock account')],
'form' => [
'enableAjaxValidation' => true,
'validationUrl' => Url::toRoute(['validate-form', 'scenario' => 'disable-block']),
],
'modal' => [
'header' => Html::tag('h4', Yii::t('app', 'Confirm account unblocking')),
'header' => Html::tag('h4', Yii::t('hipanel/hosting', 'Confirm account unblocking')),
'headerOptions' => ['class' => 'label-info'],
'footer' => [
'label' => Yii::t('app', 'Unblock'),
'data-loading-text' => Yii::t('app', 'Unblocking...'),
'label' => Yii::t('hipanel', 'Unblock'),
'data-loading-text' => Yii::t('hipanel', 'Unblocking...'),
'class' => 'btn btn-info',
]
]
Expand Down
10 changes: 5 additions & 5 deletions src/views/account/_form.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,11 +56,11 @@
}

print $form->field($model, "[$i]sshftp_ips")
->hint(Yii::t('app', 'Access to the account is opened by default. Please input the IPs, for which the access to the server will be granted'))
->hint(Yii::t('hipanel/hosting', 'Access to the account is opened by default. Please input the IPs, for which the access to the server will be granted'))
->input('text', [
'data' => [
'title' => Yii::t('app', 'IP restrictions'),
'content' => Yii::t('app', 'Text about IP restrictions'),
'title' => Yii::t('hipanel/hosting', 'IP restrictions'),
'content' => Yii::t('hipanel/hosting', 'Text about IP restrictions'), /// TODO
],
'value' => $model->getSshFtpIpsList()
]
Expand All @@ -73,9 +73,9 @@
</div>
<?php } ?>
</div>
<?= Html::submitButton(Yii::t('app', 'Save'), ['class' => 'btn btn-default']) ?>
<?= Html::submitButton(Yii::t('hipanel', 'Save'), ['class' => 'btn btn-default']) ?>
&nbsp;
<?= Html::button(Yii::t('app', 'Cancel'), ['class' => 'btn btn-default', 'onclick' => 'history.go(-1)']) ?>
<?= Html::button(Yii::t('hipanel', 'Cancel'), ['class' => 'btn btn-default', 'onclick' => 'history.go(-1)']) ?>
<?php ActiveForm::end();

$this->registerJs("$('#account-sshftp_ips').popover({placement: 'top', trigger: 'focus'});");
2 changes: 1 addition & 1 deletion src/views/account/create-ftponly.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
/* @var $model hipanel\modules\hosting\models\Account */
/* @var $type string */

$this->title = Yii::t('app', 'Create FTP account');
$this->title = Yii::t('hipanel/hosting', 'Create FTP account');
$this->params['breadcrumbs'][] = ['label' => Yii::t('app', 'Accounts'), 'url' => ['index']];
$this->params['breadcrumbs'][] = $this->title;
?>
Expand Down
4 changes: 2 additions & 2 deletions src/views/account/create.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
/* @var $model hipanel\modules\hosting\models\Account */
/* @var $type string */

$this->title = Yii::t('app', 'Create account');
$this->params['breadcrumbs'][] = ['label' => Yii::t('app', 'Accounts'), 'url' => ['index']];
$this->title = Yii::t('hipanel/hosting', 'Create account');
$this->params['breadcrumbs'][] = ['label' => Yii::t('hipanel/hosting', 'Accounts'), 'url' => ['index']];
$this->params['breadcrumbs'][] = $this->title;
?>

Expand Down
8 changes: 4 additions & 4 deletions src/views/account/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
use hipanel\widgets\ActionBox;
use hipanel\widgets\Pjax;

$this->title = Yii::t('app', 'Accounts');
$this->title = Yii::t('hipanel/hosting', 'Accounts');
$this->breadcrumbs->setItems([
$this->title,
]);
Expand All @@ -22,13 +22,13 @@
<div class="dropdown">
<button class="btn btn-success dropdown-toggle" type="button" id="dropdownMenu1" data-toggle="dropdown"
aria-haspopup="true" aria-expanded="true">
<?= Yii::t('app', 'Create account'); ?>
<?= Yii::t('hipanel/hosting', 'Create account'); ?>
<span class="caret"></span>
</button>
<?= \yii\bootstrap\Dropdown::widget([
'items' => [
['label' => Yii::t('app', 'Create account'), 'url' => ['create']],
['label' => Yii::t('app', 'Create FTP account'), 'url' => ['create-ftponly']],
['label' => Yii::t('hipanel/hosting', 'Create account'), 'url' => ['create']],
['label' => Yii::t('hipanel/hosting', 'Create FTP account'), 'url' => ['create-ftponly']],
]
]); ?>
<?= $box->renderSearchButton() ?>
Expand Down
8 changes: 4 additions & 4 deletions src/views/account/set-mail-settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@
use yii\bootstrap\ActiveForm;

$this->title = $model->login;
$this->subtitle = Yii::t('app', 'account mail config') . ' #' . $model->id;
$this->subtitle = Yii::t('hipanel/hosting', 'account mail config') . ' #' . $model->id;
$this->breadcrumbs->setItems([
['label' => 'Accounts', 'url' => ['index']],
['label' => $model->login, 'url' => ['view', 'id' => $model->id]],
Yii::t('app', 'Mail config')
Yii::t('hipanel/hosting', 'Mail config')
]);


Expand Down Expand Up @@ -63,7 +63,7 @@
</div>
<?php } ?>
</div>
<?= Html::submitButton(Yii::t('app', 'Save'), ['class' => 'btn btn-default']) ?>
<?= Html::submitButton(Yii::t('hipanel', 'Save'), ['class' => 'btn btn-default']) ?>
&nbsp;
<?= Html::button(Yii::t('app', 'Cancel'), ['class' => 'btn btn-default', 'onclick' => 'history.go(-1)']) ?>
<?= Html::button(Yii::t('hipanel', 'Cancel'), ['class' => 'btn btn-default', 'onclick' => 'history.go(-1)']) ?>
<?php ActiveForm::end();
44 changes: 22 additions & 22 deletions src/views/account/view.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@
use yii\helpers\Url;

$this->title = $model->login;
$this->subtitle = Yii::t('app', 'Account detailed information') . ' #' . $model->id;
$this->subtitle = Yii::t('hipanel/hosting', 'Account detailed information') . ' #' . $model->id;
$this->breadcrumbs->setItems([
['label' => Yii::t('app', 'Accounts'), 'url' => ['index']],
['label' => Yii::t('hipanel/hosting', 'Accounts'), 'url' => ['index']],
$this->title,
]);

Expand Down Expand Up @@ -48,23 +48,23 @@
'model' => $model,
'scenario' => 'set-password',
'button' => [
'label' => '<i class="fa fa-lock"></i>' . Yii::t('app', 'Change password'),
'label' => '<i class="fa fa-lock"></i>' . Yii::t('hipanel', 'Change password'),
'disabled' => !$model->isOperable(),
],
'modal' => [
'header' => Html::tag('h4', Yii::t('app', 'Enter a new password')),
'header' => Html::tag('h4', Yii::t('hipanel/hosting', 'Enter a new password')),
'headerOptions' => ['class' => 'label-info'],
'footer' => [
'label' => Yii::t('app', 'Change'),
'data-loading-text' => Yii::t('app', 'Changing...'),
'label' => Yii::t('hipanel', 'Change'),
'data-loading-text' => Yii::t('hipanel', 'Changing...'),
'class' => 'btn btn-warning',
]
]
]);
?>

<div class="callout callout-warning">
<h4><?= Yii::t('app', 'This will immediately terminate all sessions of the user!') ?></h4>
<h4><?= Yii::t('hipanel/hosting', 'This will immediately terminate all sessions of the user!') ?></h4>
</div>

<?php echo $modalButton->form->field($model,
Expand All @@ -80,23 +80,23 @@
'model' => $model,
'scenario' => 'set-allowed-ips',
'button' => [
'label' => '<i class="fa fa-globe"></i>' . Yii::t('app', 'Manage IP restrictions'),
'label' => '<i class="fa fa-globe"></i>' . Yii::t('hipanel/hosting', 'Manage IP restrictions'),
'disabled' => !$model->isOperable(),
],
'modal' => [
'header' => Html::tag('h4', Yii::t('app', 'Enter new restrictions')),
'header' => Html::tag('h4', Yii::t('hipanel/hosting', 'Enter new restrictions')),
'headerOptions' => ['class' => 'label-info'],
'footer' => [
'label' => Yii::t('app', 'Change'),
'data-loading-text' => Yii::t('app', 'Changing...'),
'label' => Yii::t('hipanel', 'Change'),
'data-loading-text' => Yii::t('hipanel', 'Changing...'),
'class' => 'btn btn-warning',
]
]
]);
?>

<div class="callout callout-warning">
<h4><?= Yii::t('app', 'This will immediately terminate all sessions of the user!') ?></h4>
<h4><?= Yii::t('hipanel/hosting', 'This will immediately terminate all sessions of the user!') ?></h4>
</div>

<?php echo $modalButton->form->field($model, 'sshftp_ips');
Expand All @@ -113,15 +113,15 @@
'model' => $model,
'scenario' => 'set-mail-settings',
'button' => [
'label' => '<i class="fa fa-envelope-o"></i>' . Yii::t('app', 'Mail settings'),
'label' => '<i class="fa fa-envelope-o"></i>' . Yii::t('hipanel/hosting', 'Mail settings'),
'disabled' => !$model->isOperable(),
],
'modal' => [
'header' => Html::tag('h4', Yii::t('app', 'Enter mail settings')),
'header' => Html::tag('h4', Yii::t('hipanel/hosting', 'Enter mail settings')),
'headerOptions' => ['class' => 'label-info'],
'footer' => [
'label' => Yii::t('app', 'Change'),
'data-loading-text' => Yii::t('app', 'Changing...'),
'label' => Yii::t('hipanel', 'Change'),
'data-loading-text' => Yii::t('hipanel', 'Changing...'),
'class' => 'btn btn-info',
]
]
Expand All @@ -143,16 +143,16 @@
<?= ModalButton::widget([
'model' => $model,
'scenario' => 'delete',
'button' => ['label' => '<i class="fa fa-trash-o"></i>' . Yii::t('app', 'Delete')],
'body' => Yii::t('app',
'button' => ['label' => '<i class="fa fa-trash-o"></i>' . Yii::t('hipanel', 'Delete')],
'body' => Yii::t('hipanel/hosting',
'Are you sure you want to delete account {name}? You will loose all data, that relates this account!',
['name' => $model->login]),
'modal' => [
'header' => Html::tag('h4', Yii::t('app', 'Confirm account deleting')),
'header' => Html::tag('h4', Yii::t('hipanel/hosting', 'Confirm account deleting')),
'headerOptions' => ['class' => 'label-danger'],
'footer' => [
'label' => Yii::t('app', 'Delete'),
'data-loading-text' => Yii::t('app', 'Deleting...'),
'label' => Yii::t('hipanel', 'Delete'),
'data-loading-text' => Yii::t('hipanel', 'Deleting...'),
'class' => 'btn btn-danger',
]
]
Expand All @@ -169,7 +169,7 @@
<?php
$box = Box::begin(['renderBody' => false]);
$box->beginHeader();
echo $box->renderTitle(Yii::t('app', 'Account information'));
echo $box->renderTitle(Yii::t('hipanel/hosting', 'Account information'));
$box->endHeader();
$box->beginBody();
echo AccountGridView::detailView([
Expand Down

0 comments on commit 7bad7ab

Please sign in to comment.