I try to change the language file for my form_validation_lang in my LanguageLoader.php in my hooks folder like this:
class LanguageLoader
{
function initialize() {
$ci =& get_instance();
$ci->load->helper('language');
$siteLang = $ci->session->userdata('site_lang');
if ($siteLang) {
$ci->lang->load('message',$siteLang);
$ci->lang->load('form_validation',$siteLang);
} else {
$ci->lang->load('message','english');
$ci->lang->load('form_validation','english');
}
}
}
For my message_lang.php file it works fine, but codeigniter does not load the form_validation_lang.php correctly after changing the language.
In my application folder:
-language
-- english
---message_lang.php
---form_validation_lang.php
--german
---message_lang.php
---form_validation_lang.php
It takes always the form_validation_lang.php file under english. When I change to german it takes the correct message_lang.php file but not the form_validation_lang.php file. What I am doing wrong?
Thanks for your help!
Best regards,
Yab86
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…