[pp-1] Address t() in new hook classes so they use StringTranslationTrait

Created on 20 January 2025, 4 months ago

Problem/Motivation

Postponed on πŸ“Œ Convert to OOP Hooks Active

Once that is in we can address all of the t() calls in hook classes and use the String Translation Trait.

Steps to reproduce

Remove `DrupalPractice.Objects.GlobalFunction.GlobalFunction` ignore rule in phpcs.xml
Run code sniff

Proposed resolution

Add the following:
use Drupal\Core\StringTranslation\StringTranslationTrait;
use StringTranslationTrait;
Convert t() to $this->t()

Remaining tasks

Change Hook.php classes

User interface changes

N/A

API changes

N/A

Data model changes

N/A

πŸ“Œ Task
Status

Active

Version

6.3

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States nicxvan

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

Comments & Activities

Production build 0.71.5 2024