mirror of
https://github.com/silverstripe/silverstripe-comments
synced 2024-10-22 11:05:49 +02:00
Merge pull request #185 from janneklouman/master
Extended translation support
This commit is contained in:
commit
3541dd6002
@ -53,7 +53,7 @@ class CommentsGridFieldAction implements GridField_ColumnProvider, GridField_Act
|
||||
$field .= GridField_FormAction::create(
|
||||
$gridField,
|
||||
'CustomAction' . $record->ID . 'Spam',
|
||||
'Spam',
|
||||
_t('CommentsGridFieldAction.SPAM', 'Spam'),
|
||||
'spam',
|
||||
array('RecordID' => $record->ID)
|
||||
)->Field();
|
||||
@ -63,7 +63,7 @@ class CommentsGridFieldAction implements GridField_ColumnProvider, GridField_Act
|
||||
$field .= GridField_FormAction::create(
|
||||
$gridField,
|
||||
'CustomAction' . $record->ID . 'Approve',
|
||||
'Approve',
|
||||
_t('CommentsGridFieldAction.APPROVE', 'Approve'),
|
||||
'approve',
|
||||
array('RecordID' => $record->ID)
|
||||
)->Field();
|
||||
@ -92,7 +92,7 @@ class CommentsGridFieldAction implements GridField_ColumnProvider, GridField_Act
|
||||
// output a success message to the user
|
||||
Controller::curr()->getResponse()->setStatusCode(
|
||||
200,
|
||||
'Comment marked as spam.'
|
||||
_t('CommentsGridFieldAction.COMMENTMARKEDSPAM', 'Comment marked as spam.')
|
||||
);
|
||||
}
|
||||
|
||||
@ -103,7 +103,7 @@ class CommentsGridFieldAction implements GridField_ColumnProvider, GridField_Act
|
||||
// output a success message to the user
|
||||
Controller::curr()->getResponse()->setStatusCode(
|
||||
200,
|
||||
'Comment approved.'
|
||||
_t('CommentsGridFieldAction.COMMENTAPPROVED', 'Comment approved.')
|
||||
);
|
||||
}
|
||||
}
|
||||
|
@ -26,7 +26,9 @@ class CommentsGridFieldConfig extends GridFieldConfig_RecordEditor
|
||||
$manager = new GridFieldBulkManager();
|
||||
|
||||
$manager->addBulkAction(
|
||||
'spam', 'Spam', 'CommentsGridFieldBulkAction_Handlers',
|
||||
'spam',
|
||||
_t('CommentsGridFieldConfig.SPAM', 'Spam'),
|
||||
'CommentsGridFieldBulkAction_Handlers',
|
||||
array(
|
||||
'isAjax' => true,
|
||||
'icon' => 'cross',
|
||||
@ -35,7 +37,9 @@ class CommentsGridFieldConfig extends GridFieldConfig_RecordEditor
|
||||
);
|
||||
|
||||
$manager->addBulkAction(
|
||||
'approve', 'Approve', 'CommentsGridFieldBulkAction_Handlers',
|
||||
'approve',
|
||||
_t('CommentsGridFieldConfig.APPROVE', 'Approve'),
|
||||
'CommentsGridFieldBulkAction_Handlers',
|
||||
array(
|
||||
'isAjax' => true,
|
||||
'icon' => 'cross',
|
||||
|
@ -576,7 +576,7 @@ class Comment extends DataObject
|
||||
->obj('Created')
|
||||
->scaffoldFormField($this->fieldLabel('Created'))
|
||||
->performReadonlyTransformation(),
|
||||
TextField::create('Name', $this->fieldLabel('AuthorName')),
|
||||
TextField::create('Name', $this->fieldLabel('Name')),
|
||||
$commentField::create('Comment', $this->fieldLabel('Comment')),
|
||||
EmailField::create('Email', $this->fieldLabel('Email')),
|
||||
TextField::create('URL', $this->fieldLabel('URL')),
|
||||
@ -584,7 +584,7 @@ class Comment extends DataObject
|
||||
CheckboxField::create('Moderated', $this->fieldLabel('Moderated')),
|
||||
CheckboxField::create('IsSpam', $this->fieldLabel('IsSpam')),
|
||||
))
|
||||
->setTitle('Options')
|
||||
->setTitle(_t('Comment.OPTIONS', 'Options'))
|
||||
->setDescription(_t(
|
||||
'Comment.OPTION_DESCRIPTION',
|
||||
'Unmoderated and spam comments will not be displayed until approved'
|
||||
|
@ -2,6 +2,9 @@
|
||||
|
||||
class CommentAdminTest extends SapphireTest
|
||||
{
|
||||
|
||||
protected $usesDatabase = true;
|
||||
|
||||
public function testProvidePermissions()
|
||||
{
|
||||
$commentAdmin = new CommentAdmin();
|
||||
|
Loading…
Reference in New Issue
Block a user