title: CodeIgniter dynamic language functionality
body: <p>I am Codeigniter and i need dynamic language for users.</p>
  
  <p>I have added drop-down at the header and i want to allow users to change language of site at the frontend.</p>
  
  <p>i tried to change language with below code in one controller</p>
  
  <pre><code>$this-&gt;config-&gt;set_item('language','spanish');
  </code></pre>
  
  <p>but its not working its not changing language</p>
  
  <p>i also tried with taking session with below code in one of my controller</p>
  
  <pre><code>$mylanguage = $this-&gt;session-&gt;set_userdata(array('my_language',$dynamiclang));
  </code></pre>
  
  <p>and tried to access this variable in config file but its also not working.</p>
  
  <p>help me to make this work.</p>