Stathis G.
Stathis G.

Reputation: 247

cakephp validate translated field

I have a model ex. posts that acts as translate and I want to validate the title which is a translated field. How is this possible. The below does not work.

'title' => array(
    'notempty' => array(
    'rule' => array('notempty'),
    ),
));

Upvotes: 0

Views: 518

Answers (2)

mark
mark

Reputation: 21743

you translate your message in /Locale default.po

'title' => array(
    'notEmpty' => array(
        'rule' => array('notEmpty'),
        'message' => 'your translated message',
    ),
));

whats the big deal?

Upvotes: 0

kicaj
kicaj

Reputation: 2968

Change rule name to camelCase: notEmpty and add message

Upvotes: 1

Related Questions