title: localization in codeigniter, different view on different language
body: <p>I'm using <a href="http://jeromejaglale.com/doc/php/codeigniter_i18n" rel="nofollow">this approach</a> to localize my codeigniter web app.
  Now everything works fine, except that I want to remove this repetitive code, to localize I have to put inside every controller action following</p>
  
  <pre><code>public function history() 
      {            
          $selectedLang = $this-&gt;lang-&gt;lang();
          switch ($selectedLang)
          {
              case "en":
                  $data['switchLang'] = "fr";  
                  $langView = "company/historyEN";
                  break;
              case "sr":
                  $data['switchLang'] = "en";                                
                  $langView = "company/history";
                  break;
              default:
                 $data['switchLang'] = "en";                       
                  $langView = "company/history";
          }          
  
          $this-&gt;lang-&gt;load("content");
          $this-&gt;load-&gt;view($langView, $data);
      }
  </code></pre>
  
  <p>Is it possible to move this inside CI_Controller class which will be available for all controllers than? if so how? </p>
  
  <p>or something else, please advise me into right direction</p>