I'm trying to overwrite the validation message defaults, which from what I understand should be easy enough by just placing a file called:
application/language/english/MY_form_validation_lang.php
contents of this file are:
<?php
$lang['required'] = "required.";
I've done this, but it's just not overwriting the defaults, worse thing is that it WAS working, so not sure how I toggled this off.
I've also tried loading it directly from my custom libraries/MY_Form_validation.php class but still no luck there either.
<?php if (!defined('BASEPATH')) exit('No direct script access allowed.');
class MY_Form_validation extends CI_Form_validation {
function __construct()
{
parent::__construct();
$this->CI->lang->load('MY_form_validation');
}
}
The file is loading because I can see echo's from there, but none of the messages are being overwritten. I'm also noticing that my custom validation functions are loading either. So it's loading the files but not applying them or something weird.
you file name should be
form_validation_lang.php
not MY_form_validation_lang.php
check the codeiginter language class document
$this->form_validation->set_message('rule', 'Error Message');
to overwrite the rule in this controller not on the full app check http://codeigniter.com/userguide/libraries/formvalidation.html#settingerrorsZaher 2012-04-05 05:44