Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
The PluginBase::t()
was introduced in #2087231: Add a PluginBase in the Core namespace with t() as a helper method. Similar to #2165427: Don't use t() in filter plugins anymore block plugins should also use $this->t()
.
Comment | File | Size | Author |
---|---|---|---|
#11 | drupal_2223435_11.patch | 17.94 KB | Xano |
Comments
Comment #1
Sutharsan CreditAttribution: Sutharsan commentedFirst attempt.
I've used this bash command to check for remaining t() usage:
Comment #2
Sutharsan CreditAttribution: Sutharsan commentedI continued with the script above and made a conversion script for ALL plugins changing all
t()
to$this->t()
:Notice that the script skips the Derivative and FieldType plugins, and BlockManager. They don't implement a t() method yet.
Resulting patch is attached.
Comment #3
robertdbailey CreditAttribution: robertdbailey commentedDerivative, FieldType, and BlockManager implementation of the t() function is a separate task #2225759: Derivative, FieldType, and BlockManager classes should implement the method t()
Comment #5
XanoRe-roll.
Comment #8
tim.plunkettRerolled from scratch.
Comment #11
XanoRe-roll.
Comment #12
dawehnerIt is green, let's get it in
Comment #13
alexpottChanging t() to $this->t() is a no op change and as far as possible we should not be using procedural functions in OO code. I consider this a bug. Committed a120969 and pushed to 8.0.x. Thanks!