diff --git a/src/Plugin.php b/src/Plugin.php
index 11a820f9..1ba062b8 100644
--- a/src/Plugin.php
+++ b/src/Plugin.php
@@ -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',
+ ]
+ ]
+ ]
];
}
diff --git a/src/messages/ru/hosting.php b/src/messages/ru/hosting.php
new file mode 100644
index 00000000..f15cd909
--- /dev/null
+++ b/src/messages/ru/hosting.php
@@ -0,0 +1,28 @@
+ 'Заблокировать акканут',
+ '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' => 'Введите новый пароль',
+
+];
\ No newline at end of file
diff --git a/src/views/account/_block.php b/src/views/account/_block.php
index 6c8d5130..50466ce7 100644
--- a/src/views/account/_block.php
+++ b/src/views/account/_block.php
@@ -9,23 +9,23 @@
$modalButton = ModalButton::begin([
'model' => $model,
'scenario' => 'enable-block',
- 'button' => ['label' => '' . Yii::t('app', 'Block account')],
+ 'button' => ['label' => '' . 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',
]
]
]); ?>
-
= Yii::t('app', 'This will immediately terminate SSH sessions and reject new SSH and FTP connections!') ?>
+ = Yii::t('hipanel/hosting', 'This will immediately terminate SSH sessions and reject new SSH and FTP connections!') ?>
form->field($model, 'type')->dropDownList($blockReasons); ?>
@@ -36,17 +36,17 @@
$modalButton = ModalButton::begin([
'model' => $model,
'scenario' => 'disable-block',
- 'button' => ['label' => '' . Yii::t('app', 'Unblock account')],
+ 'button' => ['label' => '' . 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',
]
]
diff --git a/src/views/account/_form.php b/src/views/account/_form.php
index 0e44f542..d82c52df 100644
--- a/src/views/account/_form.php
+++ b/src/views/account/_form.php
@@ -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()
]
@@ -73,9 +73,9 @@
-= Html::submitButton(Yii::t('app', 'Save'), ['class' => 'btn btn-default']) ?>
+= Html::submitButton(Yii::t('hipanel', 'Save'), ['class' => 'btn btn-default']) ?>
-= 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)']) ?>
registerJs("$('#account-sshftp_ips').popover({placement: 'top', trigger: 'focus'});");
\ No newline at end of file
diff --git a/src/views/account/create-ftponly.php b/src/views/account/create-ftponly.php
index 73a83460..4b568b40 100644
--- a/src/views/account/create-ftponly.php
+++ b/src/views/account/create-ftponly.php
@@ -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;
?>
diff --git a/src/views/account/create.php b/src/views/account/create.php
index 31d13066..596fb9bd 100644
--- a/src/views/account/create.php
+++ b/src/views/account/create.php
@@ -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;
?>
diff --git a/src/views/account/index.php b/src/views/account/index.php
index fce7d656..e1d658ac 100644
--- a/src/views/account/index.php
+++ b/src/views/account/index.php
@@ -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,
]);
@@ -22,13 +22,13 @@
= \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() ?>
diff --git a/src/views/account/set-mail-settings.php b/src/views/account/set-mail-settings.php
index eb0d12c0..d2d72ad3 100644
--- a/src/views/account/set-mail-settings.php
+++ b/src/views/account/set-mail-settings.php
@@ -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')
]);
@@ -63,7 +63,7 @@
-= Html::submitButton(Yii::t('app', 'Save'), ['class' => 'btn btn-default']) ?>
+= Html::submitButton(Yii::t('hipanel', 'Save'), ['class' => 'btn btn-default']) ?>
-= 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)']) ?>
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,
]);
@@ -48,15 +48,15 @@
'model' => $model,
'scenario' => 'set-password',
'button' => [
- 'label' => '' . Yii::t('app', 'Change password'),
+ 'label' => '' . 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',
]
]
@@ -64,7 +64,7 @@
?>
-
= Yii::t('app', 'This will immediately terminate all sessions of the user!') ?>
+ = Yii::t('hipanel/hosting', 'This will immediately terminate all sessions of the user!') ?>
form->field($model,
@@ -80,15 +80,15 @@
'model' => $model,
'scenario' => 'set-allowed-ips',
'button' => [
- 'label' => '' . Yii::t('app', 'Manage IP restrictions'),
+ 'label' => '' . 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',
]
]
@@ -96,7 +96,7 @@
?>
-
= Yii::t('app', 'This will immediately terminate all sessions of the user!') ?>
+ = Yii::t('hipanel/hosting', 'This will immediately terminate all sessions of the user!') ?>
form->field($model, 'sshftp_ips');
@@ -113,15 +113,15 @@
'model' => $model,
'scenario' => 'set-mail-settings',
'button' => [
- 'label' => '' . Yii::t('app', 'Mail settings'),
+ 'label' => '' . 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',
]
]
@@ -143,16 +143,16 @@
= ModalButton::widget([
'model' => $model,
'scenario' => 'delete',
- 'button' => ['label' => '' . Yii::t('app', 'Delete')],
- 'body' => Yii::t('app',
+ 'button' => ['label' => '' . 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',
]
]
@@ -169,7 +169,7 @@
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([