Loading core/modules/announcements_feed/src/LazyBuilders.php +5 −2 Original line number Diff line number Diff line Loading @@ -8,6 +8,7 @@ use Drupal\Component\Utility\Html; use Drupal\Core\Render\ElementInfoManagerInterface; use Drupal\Core\Security\TrustedCallbackInterface; use Drupal\Core\StringTranslation\StringTranslationTrait; use Drupal\Core\Url; /** Loading @@ -17,6 +18,8 @@ */ final class LazyBuilders implements TrustedCallbackInterface { use StringTranslationTrait; /** * Constructs LazyBuilders object. * Loading @@ -40,11 +43,11 @@ public function renderAnnouncements(): array { '#cache' => [ 'context' => ['user.permissions'], ], '#title' => t('Announcements'), '#title' => $this->t('Announcements'), '#url' => Url::fromRoute('announcements_feed.announcement'), '#id' => Html::getId('toolbar-item-announcement'), '#attributes' => [ 'title' => t('Announcements'), 'title' => $this->t('Announcements'), 'data-drupal-announce-trigger' => '', 'class' => [ 'toolbar-icon', Loading core/modules/comment/src/CommentForm.php +1 −1 Original line number Diff line number Diff line Loading @@ -392,7 +392,7 @@ public function save(array $form, FormStateInterface $form_state) { // Add a log entry. $logger->info('Comment posted: %subject.', [ '%subject' => $comment->getSubject(), 'link' => Link::fromTextAndUrl(t('View'), $comment->toUrl()->setOption('fragment', 'comment-' . $comment->id()))->toString(), 'link' => Link::fromTextAndUrl($this->t('View'), $comment->toUrl()->setOption('fragment', 'comment-' . $comment->id()))->toString(), ]); // Add an appropriate message upon submitting the comment form. $this->messenger()->addStatus($this->getStatusMessage($comment, $is_new)); Loading core/modules/comment/src/CommentLazyBuilders.php +8 −5 Original line number Diff line number Diff line Loading @@ -11,6 +11,7 @@ use Drupal\Core\Security\TrustedCallbackInterface; use Drupal\Core\Render\RendererInterface; use Drupal\Core\Session\AccountInterface; use Drupal\Core\StringTranslation\StringTranslationTrait; use Drupal\Core\Url; /** Loading @@ -18,6 +19,8 @@ */ class CommentLazyBuilders implements TrustedCallbackInterface { use StringTranslationTrait; /** * The entity type manager service. * Loading Loading @@ -172,14 +175,14 @@ protected function buildLinks(CommentInterface $entity, EntityInterface $comment if ($status == CommentItemInterface::OPEN) { if ($entity->access('delete')) { $links['comment-delete'] = [ 'title' => t('Delete'), 'title' => $this->t('Delete'), 'url' => $entity->toUrl('delete-form'), ]; } if ($entity->access('update')) { $links['comment-edit'] = [ 'title' => t('Edit'), 'title' => $this->t('Edit'), 'url' => $entity->toUrl('edit-form'), ]; } Loading @@ -188,7 +191,7 @@ protected function buildLinks(CommentInterface $entity, EntityInterface $comment && $entity->access('create') && $field_definition->getSetting('default_mode') === CommentManagerInterface::COMMENT_MODE_THREADED) { $links['comment-reply'] = [ 'title' => t('Reply'), 'title' => $this->t('Reply'), 'url' => Url::fromRoute('comment.reply', [ 'entity_type' => $entity->getCommentedEntityTypeId(), 'entity' => $entity->getCommentedEntityId(), Loading @@ -199,7 +202,7 @@ protected function buildLinks(CommentInterface $entity, EntityInterface $comment } if (!$entity->isPublished() && $entity->access('approve')) { $links['comment-approve'] = [ 'title' => t('Approve'), 'title' => $this->t('Approve'), 'url' => Url::fromRoute('comment.approve', ['comment' => $entity->id()]), ]; } Loading @@ -211,7 +214,7 @@ protected function buildLinks(CommentInterface $entity, EntityInterface $comment // Add translations link for translation-enabled comment bundles. if ($this->moduleHandler->moduleExists('content_translation') && $this->access($entity)->isAllowed()) { $links['comment-translations'] = [ 'title' => t('Translate'), 'title' => $this->t('Translate'), 'url' => $entity->toUrl('drupal:content-translation-overview'), ]; } Loading core/modules/comment/src/CommentStatistics.php +4 −1 Original line number Diff line number Diff line Loading @@ -10,10 +10,13 @@ use Drupal\Core\Entity\EntityInterface; use Drupal\Core\State\StateInterface; use Drupal\Core\Session\AccountInterface; use Drupal\Core\StringTranslation\StringTranslationTrait; use Drupal\user\EntityOwnerInterface; class CommentStatistics implements CommentStatisticsInterface { use StringTranslationTrait; /** * The current database connection. * Loading Loading @@ -173,7 +176,7 @@ public function getMaximumCount($entity_type) { public function getRankingInfo() { return [ 'comments' => [ 'title' => t('Number of comments'), 'title' => $this->t('Number of comments'), 'join' => [ 'type' => 'LEFT', 'table' => 'comment_entity_statistics', Loading core/modules/comment/src/CommentTranslationHandler.php +1 −1 Original line number Diff line number Diff line Loading @@ -30,7 +30,7 @@ public function entityFormAlter(array &$form, FormStateInterface $form_state, En * {@inheritdoc} */ protected function entityFormTitle(EntityInterface $entity) { return t('Edit comment @subject', ['@subject' => $entity->label()]); return $this->t('Edit comment @subject', ['@subject' => $entity->label()]); } /** Loading Loading
core/modules/announcements_feed/src/LazyBuilders.php +5 −2 Original line number Diff line number Diff line Loading @@ -8,6 +8,7 @@ use Drupal\Component\Utility\Html; use Drupal\Core\Render\ElementInfoManagerInterface; use Drupal\Core\Security\TrustedCallbackInterface; use Drupal\Core\StringTranslation\StringTranslationTrait; use Drupal\Core\Url; /** Loading @@ -17,6 +18,8 @@ */ final class LazyBuilders implements TrustedCallbackInterface { use StringTranslationTrait; /** * Constructs LazyBuilders object. * Loading @@ -40,11 +43,11 @@ public function renderAnnouncements(): array { '#cache' => [ 'context' => ['user.permissions'], ], '#title' => t('Announcements'), '#title' => $this->t('Announcements'), '#url' => Url::fromRoute('announcements_feed.announcement'), '#id' => Html::getId('toolbar-item-announcement'), '#attributes' => [ 'title' => t('Announcements'), 'title' => $this->t('Announcements'), 'data-drupal-announce-trigger' => '', 'class' => [ 'toolbar-icon', Loading
core/modules/comment/src/CommentForm.php +1 −1 Original line number Diff line number Diff line Loading @@ -392,7 +392,7 @@ public function save(array $form, FormStateInterface $form_state) { // Add a log entry. $logger->info('Comment posted: %subject.', [ '%subject' => $comment->getSubject(), 'link' => Link::fromTextAndUrl(t('View'), $comment->toUrl()->setOption('fragment', 'comment-' . $comment->id()))->toString(), 'link' => Link::fromTextAndUrl($this->t('View'), $comment->toUrl()->setOption('fragment', 'comment-' . $comment->id()))->toString(), ]); // Add an appropriate message upon submitting the comment form. $this->messenger()->addStatus($this->getStatusMessage($comment, $is_new)); Loading
core/modules/comment/src/CommentLazyBuilders.php +8 −5 Original line number Diff line number Diff line Loading @@ -11,6 +11,7 @@ use Drupal\Core\Security\TrustedCallbackInterface; use Drupal\Core\Render\RendererInterface; use Drupal\Core\Session\AccountInterface; use Drupal\Core\StringTranslation\StringTranslationTrait; use Drupal\Core\Url; /** Loading @@ -18,6 +19,8 @@ */ class CommentLazyBuilders implements TrustedCallbackInterface { use StringTranslationTrait; /** * The entity type manager service. * Loading Loading @@ -172,14 +175,14 @@ protected function buildLinks(CommentInterface $entity, EntityInterface $comment if ($status == CommentItemInterface::OPEN) { if ($entity->access('delete')) { $links['comment-delete'] = [ 'title' => t('Delete'), 'title' => $this->t('Delete'), 'url' => $entity->toUrl('delete-form'), ]; } if ($entity->access('update')) { $links['comment-edit'] = [ 'title' => t('Edit'), 'title' => $this->t('Edit'), 'url' => $entity->toUrl('edit-form'), ]; } Loading @@ -188,7 +191,7 @@ protected function buildLinks(CommentInterface $entity, EntityInterface $comment && $entity->access('create') && $field_definition->getSetting('default_mode') === CommentManagerInterface::COMMENT_MODE_THREADED) { $links['comment-reply'] = [ 'title' => t('Reply'), 'title' => $this->t('Reply'), 'url' => Url::fromRoute('comment.reply', [ 'entity_type' => $entity->getCommentedEntityTypeId(), 'entity' => $entity->getCommentedEntityId(), Loading @@ -199,7 +202,7 @@ protected function buildLinks(CommentInterface $entity, EntityInterface $comment } if (!$entity->isPublished() && $entity->access('approve')) { $links['comment-approve'] = [ 'title' => t('Approve'), 'title' => $this->t('Approve'), 'url' => Url::fromRoute('comment.approve', ['comment' => $entity->id()]), ]; } Loading @@ -211,7 +214,7 @@ protected function buildLinks(CommentInterface $entity, EntityInterface $comment // Add translations link for translation-enabled comment bundles. if ($this->moduleHandler->moduleExists('content_translation') && $this->access($entity)->isAllowed()) { $links['comment-translations'] = [ 'title' => t('Translate'), 'title' => $this->t('Translate'), 'url' => $entity->toUrl('drupal:content-translation-overview'), ]; } Loading
core/modules/comment/src/CommentStatistics.php +4 −1 Original line number Diff line number Diff line Loading @@ -10,10 +10,13 @@ use Drupal\Core\Entity\EntityInterface; use Drupal\Core\State\StateInterface; use Drupal\Core\Session\AccountInterface; use Drupal\Core\StringTranslation\StringTranslationTrait; use Drupal\user\EntityOwnerInterface; class CommentStatistics implements CommentStatisticsInterface { use StringTranslationTrait; /** * The current database connection. * Loading Loading @@ -173,7 +176,7 @@ public function getMaximumCount($entity_type) { public function getRankingInfo() { return [ 'comments' => [ 'title' => t('Number of comments'), 'title' => $this->t('Number of comments'), 'join' => [ 'type' => 'LEFT', 'table' => 'comment_entity_statistics', Loading
core/modules/comment/src/CommentTranslationHandler.php +1 −1 Original line number Diff line number Diff line Loading @@ -30,7 +30,7 @@ public function entityFormAlter(array &$form, FormStateInterface $form_state, En * {@inheritdoc} */ protected function entityFormTitle(EntityInterface $entity) { return t('Edit comment @subject', ['@subject' => $entity->label()]); return $this->t('Edit comment @subject', ['@subject' => $entity->label()]); } /** Loading