// Add a comment field to the page content type - this one won't be
// translatable.
$this->
addDefaultCommentField('node', 'page', 'comment'
);
// Mark this bundle as translatable.
$this->container->
get('content_translation.manager'
)->
setEnabled('comment', 'comment_article', TRUE
);
} /**
* {@inheritdoc}
*/
protected function getTranslatorPermissions() { return array_merge(parent::
getTranslatorPermissions(),
['post comments', 'administer comments', 'access comments'
]);
} /**
* {@inheritdoc}
*/
protected function createEntity($values,
$langcode,
$comment_type = 'comment_article'
) { if ($comment_type == 'comment_article'
) { // This is the article node type, with the 'comment_article' field.
$node_type = 'article';
$field_name = 'comment_article';
}