The main thing to remember if you don't want to have to pass the current language to every call to load a language file is to set the language before you load any language files:
PHP Code:
$this->config->set_item('language', $current_language);
Then you can get the individual language lines in your controller and pass them to your view, or echo them directly from your view:
PHP Code:
// Controller:
$data['line1'] = $this->lang->line('lang_line_1');
$this->load->view('home', $data);
// View:
?><a href=''><?php echo $line1; ?></a>
PHP Code:
<a href=''><?php echo $this->lang->line('lang_line_1'); ?></a>
Or you can load the language helper and use the lang() function:
PHP Code:
<a href=''><?php echo lang('lang_line_1'); ?></a>
I often use the lang() function from the language helper in my views when I am feeling too lazy to setup variables to pass the language lines from my controller to my view, or when the view might be shared by multiple controllers and I don't want to create a method in my base controller (or a library) to get all of the language lines and pass them through.