Re: i18n in 1.2 model validation message

2008-01-07 Thread Robby Anderson
I might not understand fully, but couldn't you do both? Set the message key for each validation in the model, then wrap the message key in the __() function in the view. Best of both worlds. --~--~-~--~~~---~--~~ You received this message because you are subscrib

Re: i18n in 1.2 model validation message

2008-01-07 Thread francky06l
Yes, indeed it's the correct MVC way ..However, in case of multiple views it's convenient to be able to set the messages in model (I know, it breaks a bit the MVC rules)... On Jan 7, 1:20 pm, "Amit Badkas" <[EMAIL PROTECTED]> wrote: > The correct way to show error message is like, in view, $form

Re: i18n in 1.2 model validation message

2008-01-07 Thread Amit Badkas
The correct way to show error message is like, in view, input('username', array('error' => array('alphanumeric' => __('Username must contain alpha-numeric characters', true), 'between' => __('Username must be between 8 to 20 characters', true; ?> On Jan 5, 2008 5:12 AM, [EMAIL PROTECTED] <[EMA

Re: i18n in 1.2 model validation message

2008-01-06 Thread Dr. Tarique Sani
If you want localization of your validation error messages then it is best to define them in the views rather than the model - model just gives the type of error to the view and view sorts out what it needs to show for that error - that is the proposed 'CakePHP' way to do it. HTH Tarique On J

Re: i18n in 1.2 model validation message

2008-01-06 Thread francky06l
This is the way I handled it : http://groups.google.com/group/cake-php/browse_thread/thread/fa32c81acc043eef/6a49c6d9fdc6f158?lnk=st&q=#6a49c6d9fdc6f158 On Jan 6, 3:57 pm, Jonas Roslund <[EMAIL PROTECTED]> wrote: > I have a very similar problem. I think it might have to to with the > fact that y

Re: i18n in 1.2 model validation message

2008-01-06 Thread Jonas Roslund
I have a very similar problem. I think it might have to to with the fact that you are using a function in the declaration of the variable. I also want to use i18n to create the message. Please let me know if you solve the problem. Regards, Jonas On Jan 5, 12:42 am, "[EMAIL PROTECTED]" <[EMAIL P