Problem/Motivation

I encountered a use of the t() function which is not according to the API documentation:

class PasswordPolicyConstraint extends PasswordPolicyItem {
  protected $pp_type = array('item', 'constraint');

  function message() {
    $mes_temp = is_array($this->info['message']) ? $this->info['message'] : array($this->info['message']);
    $messages = array();
    foreach ($mes_temp as $id => $message) {
      // Only show messages for constraints that have been configured.
      if ($this->config != $this->info['config']) {
        $messages[$id] = t($message, $this->config);
      }
    }
    return $messages;
  }
  ...

The problem is that the message string (below) is not passed through t() and will therefore not be recognized as translatable string and no translator will make a translation for it.

Proposed resolution

Pass the message string definitions through t().

Comments

sutharsan’s picture

Status: Active » Needs review
StatusFileSize
new5.41 KB

This patch should fix it. Needs testing.

erikwebb’s picture

Issue summary: View changes
Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

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