I have implement the Multiple Language using the Language Helper.I am loading the helper on drop-down change, means when user select any language then I load library according then. My problem is that if no language file found then it shows error
Unable to load the requested language file: language/abc/abc_lang.php
I want that if no file found then Simple English select. So I try this code but getting same error
$language = $_POST['language'];
if(($this->lang->load($language,$language)) == 1){
$this->lang->load($language,$language);
}
else{
$this->lang->load('english','english');
}
Anyone can tell me how to solve it.
empty($_POST['language'])check on that value and setting a default value for if 1 as not been set. You could do something like $language = (! empty($_POST['language'])) ? $_POST['language'] : 'default-language';` to make it easier to read