it doesn’t work, the language won’t be loaded. Because i need it quickly, I just create override method in DM_Lang just like this:
function load($langfile, $lang = '', $return = FALSE, $add_suffix = TRUE, $alt_path = '') {
if (is_array($langfile)) {
foreach ($langfile as $_lang)
$this->load($_lang);
return $this->language;
}
$deft_lang = CI::$APP->config->item('language');
$idiom = ($lang == '') ? $deft_lang : $lang;
if (in_array($langfile . '_lang' . EXT, $this->is_loaded, TRUE))
return $this->language;
$_module = CI::$APP->router->fetch_module();
list($path, $_langfile) = Modules::find($langfile . '_lang', $_module, 'language/' . $idiom . '/');
if($path === FALSE) {
foreach(DataMapper::get_loaded_model_path() as $path_on) {
list($path, $_langfile) = Modules::find($langfile. '_lang', rtrim(str_replace(APPPATH.'modules/', '', $path_on), '/'), 'language/'.$idiom. '/');
if($path !== FALSE) {
break;
}
}
}
if ($path === FALSE) {
if (($lang = parent::load($langfile, $lang, $return, $add_suffix, $alt_path)))
return $lang;
} else {
if (($lang = Modules::load_file($_langfile, $path, 'lang'))) {
if ($return)
return $lang;
$this->language = array_merge($this->language, $lang);
$this->is_loaded[] = $langfile . '_lang' . EXT;
unset($lang);
}
}
return $this->language;
}
You see that I add these lines:
if($path === FALSE) {
foreach(DataMapper::get_loaded_model_path() as $path_on) {
list($path, $_langfile) = Modules::find($langfile. '_lang', rtrim(str_replace(APPPATH.'modules/', '', $path_on), '/'), 'language/'.$idiom. '/');
if($path !== FALSE) {
break;
}
}
}
in case if the first try won’t return good result. Of course it will make the process longer, but I really need it quickly. If you have any other better options, I will be glad using it.