Welcome Guest, Not a member yet? Register   Sign In
Multilingual files through sessions
#1

[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.


Messages In This Thread
Multilingual files through sessions - by El Forum - 12-11-2009, 09:39 AM
Multilingual files through sessions - by El Forum - 12-11-2009, 09:41 AM
Multilingual files through sessions - by El Forum - 12-11-2009, 09:42 AM
Multilingual files through sessions - by El Forum - 12-11-2009, 09:50 AM
Multilingual files through sessions - by El Forum - 12-11-2009, 09:57 AM



Theme © iAndrew 2016 - Forum software by © MyBB