Tuesday, 6 September 2011

cakephp1.3 multilingual validation

Cakephp1.3 Multilingual  Validation

Website which is multilingual, messages will be also multilingual. To set the different error message follow the below some simple steps.

Paste following code in app_model.php
        function invalidate($field, $value = null) { 

        if (!is_array($this->validationErrors)) { 

            $this->validationErrors = array(); 


        if(empty($value)) { 

            $value = true; 


        $this->validationErrors[$field] = __($value,  true);         


field collation in database must be "utf8_unicode_ci"  


siddharth said...

After 3-4 hrs of google search, finally this work worked fine for me.
Thanks a lot

ARUN KUMAR said...

Yes, its working...

Post a Comment