Email Frequency not translating in email

Created on 7 February 2025, 2 months ago

Problem/Motivation

When you send an email with the footer with a users notification settings the whole string except the frequency gets translated, even if the frequency string is translated in drupal.

This is the code with the issue
social/modules/custom/activity_send/modules/activity_send_email/src/Plugin/EmailFrequency/Immediately.php
line 141

// Translating frequency instance in the language of the user.
    $frequency_translated = $this->t('@frequency_name', [
      '@frequency_name' => $this->getName()->getUntranslatedString(),
    ],
      ['langcode' => $langcode]
    );

Steps to reproduce

  • Translate the string 'Immediatly' into another language, for German for example into 'Sofort'
  • Have a user with your email address where certain email notifications on
  • trigger that notification
  • Trigger cron to go through the created queue items
  • Check email footer.

Proposed resolution

change code to this:

    // Translating frequency instance in the language of the user.
    $frequency_translated = $this->t($this->getName()->getUntranslatedString(), [],
      ['langcode' => $langcode]
    );

Remaining tasks

  • Someone check the code

User interface changes

API changes

Data model changes

🐛 Bug report
Status

Active

Version

11.9

Component

Code (back-end)

Created by

🇦🇹Austria eameyers

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

Merge Requests

Comments & Activities

Production build 0.71.5 2024