mruz / base-app

The base application in PhalconPHP
63 stars 19 forks source link

Translate validator messages #2

Closed mruz closed 10 years ago

mruz commented 11 years ago

Be able to translate validation messages at one place, https://github.com/phalcon/cphalcon/issues/767

mruz commented 10 years ago

It is possible in Phalcon 2.0.0:

$overwrite = array(
    'PresenceOf' => 'Field :field must not be empty',
    'TooShort' => 'Field :field must be at least :min characters long',
);

$validation = new \Baseapp\Extension\Validation();
$validation->setDefaultMessages($overwrite);
//...

Also default messages are in /app/common/i18n/en.php