Extended translation support

Added translation support for the CommentsAdmin's GridField's inline spam/approve marking labels, and also for the success messages (controller response).
This commit is contained in:
Janne Klouman 2016-06-10 15:02:28 +02:00 committed by GitHub
parent 1a94d1cd55
commit 801025c39a

View File

@ -53,7 +53,7 @@ class CommentsGridFieldAction implements GridField_ColumnProvider, GridField_Act
$field .= GridField_FormAction::create( $field .= GridField_FormAction::create(
$gridField, $gridField,
'CustomAction' . $record->ID . 'Spam', 'CustomAction' . $record->ID . 'Spam',
'Spam', _t('CommentsGridFieldAction.SPAM', 'Spam'),
'spam', 'spam',
array('RecordID' => $record->ID) array('RecordID' => $record->ID)
)->Field(); )->Field();
@ -63,7 +63,7 @@ class CommentsGridFieldAction implements GridField_ColumnProvider, GridField_Act
$field .= GridField_FormAction::create( $field .= GridField_FormAction::create(
$gridField, $gridField,
'CustomAction' . $record->ID . 'Approve', 'CustomAction' . $record->ID . 'Approve',
'Approve', _t('CommentsGridFieldAction.APPROVE', 'Approve'),
'approve', 'approve',
array('RecordID' => $record->ID) array('RecordID' => $record->ID)
)->Field(); )->Field();
@ -92,7 +92,7 @@ class CommentsGridFieldAction implements GridField_ColumnProvider, GridField_Act
// output a success message to the user // output a success message to the user
Controller::curr()->getResponse()->setStatusCode( Controller::curr()->getResponse()->setStatusCode(
200, 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 // output a success message to the user
Controller::curr()->getResponse()->setStatusCode( Controller::curr()->getResponse()->setStatusCode(
200, 200,
'Comment approved.' _t('CommentsGridFieldAction.COMMENTAPPROVED', 'Comment approved.')
); );
} }
} }