Welcome Guest, Not a member yet? Register   Sign In
Change language globally

[eluser]Sander Versluys[/eluser]
How to change the language globally for your codeigniter application?

Setting it like following doesn't work:

$this->config->set_item('language', 'nl');

The language files are present, i've changed the the full names to shorter ones. When i set the config file manually, it works.

function MY_Language()
    * Makes switching between languages easier
    *  example : http://ellislab.com/forums/viewreply/339962/
    function switch_to($idiom)
        $CI =& get_instance();
        if(is_string($idiom) && $idiom != $CI->config->item('language'))
            $loaded = $this->is_loaded;
            $this->is_loaded = array();
            foreach($loaded as $file)
Something i added to the wiki many moons ago, this gets you started i think Wink

[eluser]Sander Versluys[/eluser]
Thanks... good stuff, exactly what i needed!

Theme © iAndrew 2016 - Forum software by © MyBB