1

I have set two languages in codeigniter, it works fine in my libraries, models and other files.

I have two folders in application/language/ english and french, and I put in witch one form_validation_lang.php take from system/language

I use form_validation library from system whitch load the language file like this

$this->CI->lang->load('form_validation')

It not have the second parameter and it load just the english language file from application/language/english/ witch is default language.

How can I pass current language to Form_validation.php from system/libraries or how can I make this work?

Florin
  • 11
  • 2

2 Answers2

0

Load it with second param which is actual language:

$this->lang->load('form_validation', $language);
// or like this if you get instance of CI
$this->CI->lang->load('form_validation', $language);

where $language is a variable holding currently used language.

Jarek Tkaczyk
  • 78,987
  • 25
  • 159
  • 157
0

I fixed it. In my controller I put this line

$this->lang->load('form_validation', $language);

before

$this->form_validation->set_rules (......)

and now it works.

You have right deczo, but you dont tell me where to put this line.

Matteo Alessani
  • 10,264
  • 4
  • 40
  • 57
Florin
  • 11
  • 2