• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Change language globally

#2
[eluser]xwero[/eluser]
Code:
function MY_Language()
    {
        parent::CI_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'))
        {
            $CI->config->set_item('language',$idiom);
            $loaded = $this->is_loaded;
            $this->is_loaded = array();
                
            foreach($loaded as $file)
            {
                $this->load(str_replace('_lang.php','',$file));    
            }
        }
    }
Something i added to the wiki many moons ago, this gets you started i think Wink


Messages In This Thread
Change language globally - by El Forum - 12-02-2008, 10:24 AM
Change language globally - by El Forum - 12-02-2008, 10:34 AM
Change language globally - by El Forum - 12-02-2008, 10:55 AM

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2020 MyBB Group.