Problem/Motivation

Some of the classes implemented by this project use code similar to the following one.

    if ($result['result']) {
      $log_message = $this->t('@type message sent to @email.', [
        '@type' => ucfirst($type),
        '@email' => $to,
      ]);
      $this->logger->notice($log_message);
    }

The first parameter of ::notice() and similar log methods is not a translatable string; it is a literal string.

Proposed resolution

Fix the code that logs a message.

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

avpaderno created an issue. See original summary.

avpaderno’s picture

Title: The first parameter of log method is not a translatable string » The first parameter of log methods is not a translatable string

avpaderno’s picture

Status: Active » Needs review

  • avpaderno committed deac5a76 on 3.x
    Issue #3564863: The first parameter of log methods is not a translatable...
avpaderno’s picture

Assigned: avpaderno » Unassigned
Status: Needs review » Fixed

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

Status: Fixed » Closed (fixed)

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