Or you can define your invalidate() function in app_model:

public function invalidate($field, $value = true) {
    if (is_string($value)) {
        return parent::invalidate($field, __($value));
    }
    else {
        return parent::invalidate($field);
    }
}

Or you can try not use messages in model and keep them all in view.
But do not try to mix messages both in model in view - it's endless
field for mistakes.

On Sep 10, 4:36 am, Sanza <[email protected]> wrote:
> Hi I don't know if can help you, but to manage translation of error
> messages i use this system.
> I think is much clean and simply:
>
> I put the all declaration of validate array inside the constructor of
> the model:
>
>         function __construct($id = false, $table = null, $ds = null){
>                 parent::__construct($id, $table, $ds);
>                 $this->validate = array(
>                         'name' => array(
>                                 'notempty' => array(
>                                         'rule' => array('notempty'),
>                                         'message' => __('Error message 
> notEmpty', true),
>                                 )
>                         )
>                 );
>         }
> BR
> Massimo

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected] For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en

Reply via email to