[eluser]Unknown[/eluser]
With lot of googling, I was unable to reach at a working solution for changing form validation message language if the user changes the language of website display.
Here is the way I did it:
In CI_Form_validation class added a class level variable and a public set method which I call from my controller as soon as I store validation rules and before calling the run() method.
var $curr_lang = '';
public function set_curr_lang($lang = '')
{
$this->curr_lang = $lang;
}
Modified a line in the CI_Form_validation run() method:
$this->CI->lang->load('form_validation');
to
$this->CI->lang->load('form_validation', $this->curr_lang);
Share your thoughts...
Thanks!