Problem/Motivation

t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead.
Remove uses of t() in assertions has been done in the issue https://www.drupal.org/project/drupal/issues/3133726.
Remove all calls to t() wrapped in calls to drupalPostForm() will be done in the issue https://www.drupal.org/project/drupal/issues/3145005.

Steps to reproduce

Proposed resolution

Remaining tasks

Replace all remaning occurance of t() calls with $this->t() in classes.

User interface changes

API changes

Data model changes

CommentFileSizeAuthor
#2 3165164-2.patch6.71 KBsiddhant.bhosale

Comments

siddhant.bhosale created an issue. See original summary.

siddhant.bhosale’s picture

Assigned: siddhant.bhosale » Unassigned
Status: Active » Needs review
StatusFileSize
new6.71 KB

Hi, I have uploaded the patch, Please review.

siddhant.bhosale’s picture

Issue summary: View changes
shetpooja04’s picture

Status: Needs review » Reviewed & tested by the community

Patch is applying successfully.

Used the below command which is not returning any warning or error. Moving to RTBC

phpcs --standard=DrupalPractice --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,yml core/modules/text

Status: Reviewed & tested by the community » Needs work

The last submitted patch, 2: 3165164-2.patch, failed testing. View results

mohit.bansal623’s picture

Assigned: Unassigned » mohit.bansal623
anmolgoyal74’s picture

Status: Needs work » Reviewed & tested by the community

Unrelated failure. Marking back to RTBC.

xjm’s picture

Status: Reviewed & tested by the community » Closed (duplicate)

Thank you for your work on cleaning up Drupal core's code style!

In order to fix core coding standards in a maintainable way, all our coding standards issues should be done on a per-concept basis across all of core, rather than fixing standards in individual modules or files. See #3145418: [November 9, 2020] Remove uses of t() in assertText() calls for an example of proper issue scope.

For background information on why we usually will not commit coding standards fixes that aren't scoped in that way, see the core issue scope guidelines, especially the note about coding standards cleanups. That document also includes numerous suggestions for scoping issues including documentation coding standards cleanups.

Contributing to the overall plan above will help ensure that your fixes for core's coding standards remain in core the long term.

Closing as a duplicate of #3145418: [November 9, 2020] Remove uses of t() in assertText() calls and appropriate conceptually scoped followups.