[eluser]bubbafoley[/eluser]
The config gets loaded way before the database ever will be. The easiest way to do it would probably be set up a MY_Controller and change the config language there.
Code:
<?php
class MY_Controller extends CI_Controller {
public function __construct()
{
parent::__construct();
$lang = $this->lang_model->get_lang_from_db();
$this->config->set_item('language', $lang);
}
}
Then in your controllers you can load lang files normally
Code:
class Welcome extends MY_Controller {
function index()
{
$this->lang->load('my_custom');
}
}