Problem/Motivation

After running coder for Drupal best practices, I found the issues regarding t() calls:

WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead

Proposed resolution

Need to replace t() calls with $this->t() wherever required.

CommentFileSizeAuthor
#2 3134110-2.patch49.16 KBankithashetty

Comments

ankithashetty created an issue. See original summary.

ankithashetty’s picture

Status: Active » Needs review
StatusFileSize
new49.16 KB

Replaced t()calls with $this->t() and use \Drupal\Core\StringTranslation\StringTranslationTrait wherever needed in the following patch, please review.

Thank you.

aaronbauman’s picture

Status: Needs review » Fixed

works for me, thanks for the patch

ankithashetty’s picture

Thank you for reviewing! Glad I could help :)

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.