Problem/Motivation
Replace usage of t() with $this->t()

Proposed resolution
Replace existing calls to the t() with $this->t()

Remaining tasks

  1. Write a patch
  2. Review
  3. Commit

User interface changes
None.

API changes
None.
Data model changes
None.

Comments

subson created an issue. See original summary.

Sourabhagouda SP’s picture

Replaced t() with $this->t() please check the patch

Sourabhagouda SP’s picture

Status: Active » Needs review
adamps’s picture

Status: Needs review » Needs work

Thanks @Sourabhagouda SP. Here are my comments:

1. You have changed simplenews.api.php, but $this is not valid here

2. After I applied your patch, I ran a regular expression search in all php files for [^>a-z]t\(. I found 27 entries you didn't change and most likely could change.

adamps’s picture

3. I found bugs where you have added $this inside a static function.

ggh’s picture

Status: Needs work » Needs review
StatusFileSize
new179.9 KB

Updated patch with requested changes, Please verify

Status: Needs review » Needs work

The last submitted patch, 6: replace-usage-of-t-function-3002237-6.patch, failed testing. View results
- codesniffer_fixes.patch Interdiff of automated coding standards fixes only.

ggh’s picture

Status: Needs work » Needs review
StatusFileSize
new176.88 KB

Status: Needs review » Needs work

The last submitted patch, 8: replace-usage-of-t-function-3002237-7.patch, failed testing. View results
- codesniffer_fixes.patch Interdiff of automated coding standards fixes only.

ggh’s picture

Status: Needs work » Needs review
StatusFileSize
new60.19 KB

Status: Needs review » Needs work

The last submitted patch, 10: replace-usage-of-t-function-3002237-10.patch, failed testing. View results
- codesniffer_fixes.patch Interdiff of automated coding standards fixes only.

adamps’s picture

Status: Needs work » Closed (duplicate)
Related issues: +#2856182: $this->t() should be used instead of t() for Drupal 8 version.

This is a duplicate of #2856182: $this->t() should be used instead of t() for Drupal 8 version.. The patch here still fails testing so I guess it's not finished. If you create a new patch, please post it on the other issue instead.