Bug Report #2191
Validate::errors() doesn't use placeholders for error messages when $translate === FALSE
| Status: | Closed | Start date: | 10/01/2009 | |
|---|---|---|---|---|
| Priority: | Normal | Due date: | ||
| Assignee: | % Done: | 0% |
||
| Category: | Core | |||
| Target version: | v3.0.1 | |||
| Resolution: | fixed | Points: |
Description
When $translate === FALSE, __() function doesn't call, its OK. We doesn't need translating, but placeholders like :field and :param{X} should be replaced with current fieldname and rule params.
I think, errors() method use something be like this:
...
if ($translate == TRUE)
{
if (is_string($translate))
{
// Translate the message using specified language
$message = __($message, $values, $translate);
}
else
{
// Translate the message using the default language
$message = __($message, $values);
}
}
else
{
// Replace message keys with fieldname and rule params
$message = strtr($message, $values);
}
...
Associated revisions
Updated Validate::errors(), even when not translating error messages, the placeholder values should still be replaced. Fixes #2191
History
Updated by Woody Gilk over 2 years ago
- Status changed from New to Assigned
Updated by Woody Gilk over 2 years ago
- Status changed from Assigned to Closed
- Resolution set to fixed