diff --git a/lang/en.yml b/lang/en.yml index 606a3359..0ba24c1a 100644 --- a/lang/en.yml +++ b/lang/en.yml @@ -27,12 +27,12 @@ en: has_many_Versions: Versions SilverStripe\Versioned\VersionedGridFieldItemRequest: ARCHIVE: Archive - Archived: 'Archived %s %s' + Archived: 'Archived {name} {title}' BUTTONARCHIVEDESC: 'Unpublish and send to archive' BUTTONPUBLISH: Publish BUTTONUNPUBLISH: Unpublish BUTTONUNPUBLISHDESC: 'Remove this record from the published site' Published: 'Published {name} {link}' - Unpublished: 'Unpublished %s %s' SilverStripe\Versioned\VersionedHTTPMiddleware: + Unpublished: 'Unpublished {name} {title}' DRAFT_SITE_ACCESS_RESTRICTION: 'You must log in with your CMS password in order to view the draft or archived content. Click here to go back to the published site.' diff --git a/src/VersionedGridFieldItemRequest.php b/src/VersionedGridFieldItemRequest.php index efc411a2..e935d992 100644 --- a/src/VersionedGridFieldItemRequest.php +++ b/src/VersionedGridFieldItemRequest.php @@ -101,10 +101,13 @@ public function doArchive($data, $form) $title = $record->Title; $record->doArchive(); - $message = sprintf( - _t('SilverStripe\\Versioned\\VersionedGridFieldItemRequest.Archived', 'Archived %s %s'), - $record->i18n_singular_name(), - Convert::raw2xml($title) + $message = _t( + __CLASS__ . '.Archived', + 'Archived {name} {title}', + [ + 'name' => $record->i18n_singular_name(), + 'title' => Convert::raw2xml($title) + ] ); $this->setFormMessage($form, $message); @@ -171,10 +174,13 @@ public function doUnpublish($data, $form) $title = $record->Title; $record->doUnpublish(); - $message = sprintf( - _t('SilverStripe\\Versioned\\VersionedGridFieldItemRequest.Unpublished', 'Unpublished %s %s'), - $record->i18n_singular_name(), - Convert::raw2xml($title) + $message = _t( + __CLASS__ . '.Unpublished', + 'Unpublished {name} {title}', + [ + 'name' => $record->i18n_singular_name(), + 'title' => Convert::raw2xml($title) + ] ); $this->setFormMessage($form, $message);