Add localization

This commit is contained in:
xTc 2016-03-03 17:04:33 +01:00 committed by xTc
parent a761e5d233
commit 1e9d9bcfcf
16 changed files with 73 additions and 40 deletions

View File

@ -35,7 +35,7 @@ use humhub\widgets\GridView;
'profile.lastname',
'profile.lastname',
[
'header' => 'Actions',
'header' => Yii::t('AdminModule.views_approval_index', 'Actions'),
'class' => 'yii\grid\ActionColumn',
'options' => ['width' => '150px'],
'buttons' => [

View File

@ -22,7 +22,7 @@ use humhub\widgets\GridView;
'name',
'description',
[
'header' => 'Actions',
'header' => Yii::t('AdminModule.views_group_index', 'Actions'),
'class' => 'yii\grid\ActionColumn',
'options' => ['width' => '80px'],
'buttons' => [

View File

@ -65,7 +65,7 @@ use humhub\modules\admin\widgets\SpaceGridView;
},
],
[
'header' => 'Actions',
'header' => Yii::t('AdminModule.views_space_index', 'Actions'),
'class' => 'yii\grid\ActionColumn',
'options' => ['width' => '80px'],
'buttons' => [

View File

@ -55,7 +55,7 @@ use humhub\widgets\GridView;
}
],
[
'header' => 'Actions',
'header' => Yii::t('AdminModule.views_user_index', 'Actions'),
'class' => 'yii\grid\ActionColumn',
'options' => ['style' => 'width:80px; min-width:80px;'],
'buttons' => [

View File

@ -35,16 +35,23 @@ class CreateComment extends \humhub\libs\BasePermission
/**
* @inheritdoc
*/
protected $title = "Create comment";
protected $title = 'Create comment';
/**
* @inheritdoc
*/
protected $description = "Allows the user to add comments";
protected $description = 'Allows the user to add comments';
/**
* @inheritdoc
*/
protected $moduleId = 'comment';
public function __construct($config = array()) {
parent::__construct($config);
$this->title = \Yii::t('CommentModule.permissions', 'Create comment');
$this->description = \Yii::t('CommentModule.permissions', 'Allows the user to add comments');
}
}

View File

@ -59,14 +59,14 @@ class Membership extends \yii\db\ActiveRecord
return [
'space_id' => 'Space ID',
'user_id' => 'User ID',
'originator_user_id' => 'Originator User ID',
'status' => 'Status',
'request_message' => 'Request Message',
'last_visit' => 'Last Visit',
'created_at' => 'Created At',
'created_by' => 'Created By',
'updated_at' => 'Updated At',
'updated_by' => 'Updated By',
'originator_user_id' => Yii::t('SpaceModule.models_Membership', 'Originator User ID'),
'status' => Yii::t('SpaceModule.models_Membership', 'Status'),
'request_message' => Yii::t('SpaceModule.models_Membership', 'Request Message'),
'last_visit' => Yii::t('SpaceModule.models_Membership', 'Last Visit'),
'created_at' => Yii::t('SpaceModule.models_Membership', 'Created At'),
'created_by' => Yii::t('SpaceModule.models_Membership', 'Created By'),
'updated_at' => Yii::t('SpaceModule.models_Membership', 'Updated At'),
'updated_by' => Yii::t('SpaceModule.models_Membership', 'Updated By'),
];
}

View File

@ -51,12 +51,12 @@ class Setting extends \yii\db\ActiveRecord
'id' => 'ID',
'space_id' => 'Space ID',
'module_id' => 'Module ID',
'name' => 'Name',
'value' => 'Value',
'created_at' => 'Created At',
'created_by' => 'Created By',
'updated_at' => 'Updated At',
'updated_by' => 'Updated By',
'name' => Yii::t('SpaceModule.models_Setting', 'Name'),
'value' => Yii::t('SpaceModule.models_Setting', 'Value'),
'created_at' => Yii::t('SpaceModule.models_Setting', 'Created At'),
'created_by' => Yii::t('SpaceModule.models_Setting', 'Created By'),
'updated_at' => Yii::t('SpaceModule.models_Setting', 'Updated At'),
'updated_by' => Yii::t('SpaceModule.models_Setting', 'Updated by'),
];
}

View File

@ -28,7 +28,7 @@ use humhub\libs\BasePermission;
'user.profile.firstname',
'user.profile.lastname',
[
'label' => 'Group',
'label' => Yii::t('SpaceModule.views_admin_members', 'Group'),
'class' => 'humhub\libs\DropDownGridColumn',
'attribute' => 'group_id',
'submitAttributes' => ['user_id'],
@ -58,7 +58,7 @@ use humhub\libs\BasePermission;
}
],
[
'header' => 'Actions',
'header' => Yii::t('SpaceModule.views_admin_members', 'Actions'),
'class' => 'yii\grid\ActionColumn',
'buttons' => [
'view' => function () {
@ -68,7 +68,7 @@ use humhub\libs\BasePermission;
if ($space->isSpaceOwner($model->user->id) || Yii::$app->user->id == $model->user->id) {
return;
}
return Html::a('Remove', $space->createUrl('reject-applicant', ['userGuid' => $model->user->guid]), ['class' => 'btn btn-danger btn-sm', 'data-method' => 'POST', 'data-confirm' => 'Are you sure?']);
return Html::a(Yii::t('SpaceModule.views_admin_members', 'Remove'), $space->createUrl('reject-applicant', ['userGuid' => $model->user->guid]), ['class' => 'btn btn-danger btn-sm', 'data-method' => 'POST', 'data-confirm' => 'Are you sure?']);
},
'update' => function () {
return;

View File

@ -25,7 +25,7 @@ use humhub\modules\space\modules\manage\widgets\MemberMenu;
'user.profile.lastname',
'request_message',
[
'header' => 'Actions',
'header' => Yii::t('SpaceModule.views_admin_members', 'Actions'),
'class' => 'yii\grid\ActionColumn',
'buttons' => [
'view' => function() {

View File

@ -32,7 +32,7 @@ use humhub\modules\space\modules\manage\widgets\MemberMenu;
}
],
[
'header' => 'Actions',
'header' => Yii::t('SpaceModule.views_admin_members', 'Actions'),
'class' => 'yii\grid\ActionColumn',
'buttons' => [
'view' => function() {

View File

@ -12,9 +12,8 @@ use humhub\modules\user\widgets\PermissionGridEditor;
<?php echo Yii::t('SpaceModule.views_admin_members', '<strong>Manage</strong> permissions'); ?>
</div>
<div class="panel-body">
<strong>Current Group:</strong>
<?php
echo Yii::t('SpaceModule.views_admin_members', '<strong>Current Group:</strong>');
echo Html::beginForm($space->createUrl('permissions'), 'GET');
echo Html::dropDownList('groupId', $groupId, $groups, ['class' => 'form-control', 'onchange' => 'this.form.submit()']);
echo Html::endForm();

View File

@ -30,25 +30,25 @@ class MemberMenu extends \humhub\widgets\BaseMenu
{
$this->addItem(array(
'label' => 'Members',
'label' => Yii::t('SpaceModule.widgets_SpaceMembersMenu','Members'),
'url' => $this->space->createUrl('/space/manage/member/index'),
'sortOrder' => 100,
'isActive' => (Yii::$app->controller->action->id == 'index' && Yii::$app->controller->id === 'member'),
));
$this->addItem(array(
'label' => 'Pending Invites',
'label' => Yii::t('SpaceModule.widgets_SpaceMembersMenu','Pending Invites'),
'url' => $this->space->createUrl('/space/manage/member/pending-invitations'),
'sortOrder' => 200,
'isActive' => (Yii::$app->controller->action->id == 'pending-invitations'),
));
$this->addItem(array(
'label' => 'Pending Approvals',
'label' => Yii::t('SpaceModule.widgets_SpaceMembersMenu','Pending Approvals'),
'url' => $this->space->createUrl('/space/manage/member/pending-approvals'),
'sortOrder' => 300,
'isActive' => (Yii::$app->controller->action->id == 'pending-approvals'),
));
$this->addItem(array(
'label' => 'Permissions',
'label' => Yii::t('SpaceModule.widgets_SpaceMembersMenu','Permissions'),
'url' => $this->space->createUrl('/space/manage/member/permissions'),
'sortOrder' => 400,
'isActive' => (Yii::$app->controller->action->id == 'permissions'),
@ -56,7 +56,7 @@ class MemberMenu extends \humhub\widgets\BaseMenu
if ($this->space->isSpaceOwner()) {
$this->addItem(array(
'label' => 'Owner',
'label' => Yii::t('SpaceModule.widgets_SpaceMembersMenu','Owner'),
'url' => $this->space->createUrl('/space/manage/member/change-owner'),
'sortOrder' => 500,
'isActive' => (Yii::$app->controller->action->id == 'change-owner'),

View File

@ -22,12 +22,12 @@ class CreatePrivateSpace extends \humhub\libs\BasePermission
/**
* @inheritdoc
*/
protected $title = "Create private space";
protected $title = 'Create private space';
/**
* @inheritdoc
*/
protected $description = "Can create hidden (private) spaces.";
protected $description = 'Can create hidden (private) spaces.';
/**
* @inheritdoc
@ -39,4 +39,10 @@ class CreatePrivateSpace extends \humhub\libs\BasePermission
*/
protected $defaultState = self::STATE_ALLOW;
public function __construct($config = array()) {
parent::__construct($config);
$this->title = \Yii::t('SpaceModule.permissions', 'Create private space');
$this->description = \Yii::t('SpaceModule.permissions', 'Can create hidden (private) spaces.');
}
}

View File

@ -36,16 +36,23 @@ class CreatePublicContent extends \humhub\libs\BasePermission
/**
* @inheritdoc
*/
protected $title = "Create public content";
protected $title = 'Create public content';
/**
* @inheritdoc
*/
protected $description = "Allows the user to create public content";
protected $description = 'Allows the user to create public content';
/**
* @inheritdoc
*/
protected $moduleId = 'space';
public function __construct($config = array()) {
parent::__construct($config);
$this->title = \Yii::t('SpaceModule.permissions', 'Create public content');
$this->description = \Yii::t('SpaceModule.permissions', 'Allows the user to create public content');
}
}

View File

@ -22,12 +22,12 @@ class CreatePublicSpace extends \humhub\libs\BasePermission
/**
* @inheritdoc
*/
protected $title = "Create public space";
protected $title = 'Create public space';
/**
* @inheritdoc
*/
protected $description = "Can create public visible spaces. (Listed in directory)";
protected $description = 'Can create public visible spaces. (Listed in directory)';
/**
* @inheritdoc
@ -38,5 +38,12 @@ class CreatePublicSpace extends \humhub\libs\BasePermission
* @inheritdoc
*/
protected $defaultState = self::STATE_ALLOW;
public function __construct($config = array()) {
parent::__construct($config);
$this->title = \Yii::t('SpaceModule.permissions', 'Create public space');
$this->description = \Yii::t('SpaceModule.permissions', 'Can create public visible spaces. (Listed in directory)');
}
}

View File

@ -36,16 +36,23 @@ class InviteUsers extends \humhub\libs\BasePermission
/**
* @inheritdoc
*/
protected $title = "Invite users";
protected $title = 'Invite users';
/**
* @inheritdoc
*/
protected $description = "Allows the user to invite new members to the space";
protected $description = 'Allows the user to invite new members to the space';
/**
* @inheritdoc
*/
protected $moduleId = 'space';
public function __construct($config = array()) {
parent::__construct($config);
$this->title = \Yii::t('SpaceModule.permissions', 'Invite users');
$this->description = \Yii::t('SpaceModule.permissions', 'Allows the user to invite new members to the space');
}
}