t() calls should be avoided in classes

Created on 29 June 2023, over 1 year ago
Updated 30 June 2023, over 1 year ago

Problem/Motivation

t() calls should be avoided in classes, use $this->t() instead

Proposed resolution

Need to replace the t() wherever found in the code in the module.

Please look at the screenshot attach for your reference.

📌 Task
Status

Needs review

Version

1.0

Component

Code

Created by

🇮🇳India Prachi6824

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @Prachi6824
  • Issue was unassigned.
  • Status changed to Needs review over 1 year ago
  • 🇮🇳India Prachi6824

    Hello,

    I have created a patch to solve the issue related to t() calls .

    Please review and apply it .

  • @prachi6824 opened merge request.
  • 🇮🇳India Raveen Kumar

    @Prachii, Your Merge Request is empty. Please re-view it. Thanks

  • 🇮🇳India Raveen Kumar

    @Prachi,
    a) I have reviewed the code in the patch. By using $this->t() instead of t(), you ensure that the translation is handled correctly within the Drupal ecosystem. The $this->t() method is aware of the current context and can apply the appropriate translation logic, such as using the active language and considering the translation settings of the site.

    I am creating MR! for your patch.

    Your Patch is good to go. And Thank you.

  • @raveen-thakur opened merge request.
  • 🇮🇳India Prachi6824

    Thank you @Raveen Thakur for reviewing my patch.

Production build 0.71.5 2024