diff --git a/core/modules/comment/comment.module b/core/modules/comment/comment.module index fdaeba7..fe61b7c 100644 --- a/core/modules/comment/comment.module +++ b/core/modules/comment/comment.module @@ -1738,6 +1738,9 @@ function template_preprocess_comment_wrapper(&$variables) { // Create separate variables for the comments and comment form. $variables['comments'] = $variables['content']['comments']; + $variables['add_new_label'] = t('Add new @label', array( + '@label' => $variables['comments']['#label'], + )); $variables['form'] = $variables['content']['comment_form']; } diff --git a/core/modules/comment/lib/Drupal/comment/Plugin/field/formatter/CommentDefaultFormatter.php b/core/modules/comment/lib/Drupal/comment/Plugin/field/formatter/CommentDefaultFormatter.php index db55970..d125ba2 100644 --- a/core/modules/comment/lib/Drupal/comment/Plugin/field/formatter/CommentDefaultFormatter.php +++ b/core/modules/comment/lib/Drupal/comment/Plugin/field/formatter/CommentDefaultFormatter.php @@ -56,6 +56,7 @@ public function viewElements(EntityInterface $entity, $langcode, array $items) { comment_prepare_thread($comments); $build = comment_view_multiple($comments); $build['pager']['#theme'] = 'pager'; + $build['#label'] = $field->getFieldLabel(); $additions['comments'] = $build; } } diff --git a/core/modules/comment/templates/comment-wrapper.html.twig b/core/modules/comment/templates/comment-wrapper.html.twig index b19c051..ec19be7 100644 --- a/core/modules/comment/templates/comment-wrapper.html.twig +++ b/core/modules/comment/templates/comment-wrapper.html.twig @@ -36,16 +36,11 @@ */ #} - {% if comments and (entity.entityType != 'node' or entity.bundle != 'forum') %} - {{ title_prefix }} -

{{ 'Comments'|t }}

- {{ title_suffix }} - {% endif %} {{ comments }} {% if form %} -

{{ 'Add new comment'|t }}

+

{{ add_new_label }}

{{ form }} {% endif %}