Autoload language codeigniter Autoload language codeigniter codeigniter codeigniter

Autoload language codeigniter


$config['language']

is the default folder used for loading language files, which is why your

fr_lang.php

is loaded from there.

Either change the value of:

$config['language']

when needed, like:

$this->config->set_item('language', 'value');

(Remember this has to be done before the languages load, so you would use a hook for that http://codeigniter.com/user_guide/general/hooks.html.)

Or else, load your language files on the fly:

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

You should definitely check out the core classes to get a better understanding of how things work. You can browse the code easily here: https://github.com/EllisLab/CodeIgniterFor instance, the languages are loaded with this class: https://github.com/EllisLab/CodeIgniter/blob/develop/system/core/Lang.php

If you need any more help, let me know.