The admin forms and the redirect controller are occasionally still using the global t() function:

FILE: openid_connect/src/Controller/RedirectController.php
--------------------------------------------------------------------------
 152 | WARNING | t() calls should be avoided in classes, use dependency
     |         | injection and $this->t() instead
 162 | WARNING | t() calls should be avoided in classes, use dependency
     |         | injection and $this->t() instead
 174 | WARNING | t() calls should be avoided in classes, use dependency
     |         | injection and $this->t() instead
--------------------------------------------------------------------------

FILE: openid_connect/src/Form/AccountsForm.php
--------------------------------------------------------------------------
 122 | WARNING | t() calls should be avoided in classes, use dependency
     |         | injection and $this->t() instead
 126 | WARNING | t() calls should be avoided in classes, use dependency
     |         | injection and $this->t() instead
 151 | WARNING | t() calls should be avoided in classes, use dependency
     |         | injection and $this->t() instead
 161 | WARNING | t() calls should be avoided in classes, use dependency
     |         | injection and $this->t() instead
 182 | WARNING | t() calls should be avoided in classes, use dependency
     |         | injection and $this->t() instead
--------------------------------------------------------------------------

FILE: openid_connect/src/Form/SettingsForm.php
--------------------------------------------------------------------------
 202 | WARNING | t() calls should be avoided in classes, use dependency
     |         | injection and $this->t() instead
--------------------------------------------------------------------------

FILE: openid_connect/src/Form/LoginForm.php
--------------------------------------------------------------------------
 80 | WARNING | t() calls should be avoided in classes, use dependency
    |         | injection and $this->t() instead
--------------------------------------------------------------------------

According to Drupal 8 best practices, the string translation trait should be used instead.

CommentFileSizeAuthor
#2 openid_connect-2960883.patch5.31 KBmario steinitz

Comments

Mario Steinitz created an issue. See original summary.

mario steinitz’s picture

Status: Active » Needs review
StatusFileSize
new5.31 KB

This patch fixes the above t() calls.

mario steinitz’s picture

Assigned: mario steinitz » Unassigned

  • Mario Steinitz committed 44737f3 on 8.x-1.x
    Issue #2960883 by Mario Steinitz: Consistent use of the string...
mario steinitz’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.