Actually, in the mean time I (almost) solved it by extending the MY_language library with a reload function:
function reload($langfile = '', $idiom = '', $return = FALSE)
{
$complete_langfile = str_replace(EXT, '', str_replace('_lang.', '', $langfile)).'_lang'.EXT;
if (in_array($complete_langfile, $this->is_loaded, TRUE))
{
// Remove the language file to be unloaded from the is_loaded array (otherwise it won't reload)
$lang_index = array_search($complete_langfile,$this->is_loaded);
unset($this->is_loaded[$lang_index]);
// Reshuffle the values inside is_loaded so that there is no "empty" key
$this->is_loaded = array_values($this->is_loaded);
log_message('debug', 'Language '.$complete_langfile. ' unloaded');
}
// Load the language
return $this->load($langfile, $idiom, $return);
}
After setting the language preferences, I simply run this function for each language file in use.
Now there’s still one glitch: reloading the language for the status and userlib isn’t working yet.