[eluser]xwero[/eluser]
i've made an extended language method for switching to another language even if you have autoloaded files
Code:
class MY_Language extends CI_Language
{
function MY_Language()
{
parent::CI_Language();
}
function switch_to($idiom)
{
$CI =& get_instance();
$CI->config->set_item('language',$idiom);
$loaded = $this->is_loaded;
$this->is_loaded = array();
foreach($loaded as $lang)
{
$this->load($lang);
}
}
}
It's easier to make multi language sites i think.
I just can't understand why autoloaded files would have to remain bound to the static language configuration when you switch to another language.