Merge pull request #185 from janneklouman/master

Extended translation support
This commit is contained in:
Daniel Hensby 2016-07-05 11:18:43 +01:00 committed by GitHub
commit 3541dd6002
4 changed files with 15 additions and 8 deletions

View File

@ -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.')
);
}
}

View File

@ -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',

View File

@ -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'

View File

@ -2,6 +2,9 @@
class CommentAdminTest extends SapphireTest
{
protected $usesDatabase = true;
public function testProvidePermissions()
{
$commentAdmin = new CommentAdmin();