Welcome Guest, Not a member yet? Register   Sign In
validation errors multi-lingual
#5

[eluser]xwero[/eluser]
The hardest part about changing languages at runtime is loading the choosen language files. I've made a method for this a while ago
Code:
/**
    * 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));    
            }
        }
    }
How you do the switch that is up to you, there are some solutions floating around the on the forum and wiki.


Messages In This Thread
validation errors multi-lingual - by El Forum - 08-24-2008, 07:37 AM
validation errors multi-lingual - by El Forum - 08-24-2008, 12:46 PM
validation errors multi-lingual - by El Forum - 08-24-2008, 08:55 PM
validation errors multi-lingual - by El Forum - 08-25-2008, 01:12 AM
validation errors multi-lingual - by El Forum - 08-25-2008, 01:33 AM
validation errors multi-lingual - by El Forum - 08-25-2008, 02:41 AM
validation errors multi-lingual - by El Forum - 02-14-2009, 11:56 AM
validation errors multi-lingual - by El Forum - 07-07-2009, 04:13 AM
validation errors multi-lingual - by El Forum - 07-07-2009, 09:54 AM
validation errors multi-lingual - by El Forum - 02-05-2012, 09:26 PM



Theme © iAndrew 2016 - Forum software by © MyBB