[eluser]alrightythen[/eluser]
Hi
I'm building a multilingual site using cookies to retrieve language preferences, the cookies aren't the problem.
I have added a folder in the system/language folder called dutch in wich I've added dutch language files from the codeigniter wiki.
Also I've created 2 files both called 'site_lang.php' and put one in 'english' folder and one in 'dutch'.
my controller looks like this...
Code:
class Home extends Controller {
function __construct()
{
parent::Controller();
}
function index()
{
if($this->session->userdata('language')){
$language = $this->session->userdata('language');
}else{
$language = 'dutch';
}
$this->load->helper('language');
$this->lang->load('site', $language);
$data['header'] = 'Hello World!';
$data['main_content'] = 'homepage';
$this->load->view('inc/template', $data);
}
}
But this doesn't work. Does anyone have a better way to use multilingual sites? I've looked at the wiki of MY_language but that code is just too complicated for me.