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
Comment #1
sutharsan commentedThis patch should fix it. Needs testing.
Comment #2
erikwebb commentedLooks good. Thanks!
http://drupalcode.org/project/password_policy.git/commit/c82cca4