Maybe this will help, you can use it in any library Class.
PHP Code:
// Your lang file - Created under language folder language-name
<<?php
defined('BASEPATH') OR exit('No direct script access allowed');
$lang['your key'] = "Your Message.";
// End of lang file
// Your Class
class Your_Class
{
/**
* @var CI_Controller - The CI Super Object
*/
protected $CI;
/**
* constructor.
* -------------------------------------------------------------------
*
*/
public function __construct()
{
$this->CI =& get_instance();
$this->CI->lang->load('your lang file', 'english');
}
/**
* Your Method.
* -------------------------------------------------------------------
*
*/
public function test()
{
show_error($this->CI->lang->line('your message'));
// or
echo $this->CI->lang->line('your message');
}
}
When working outside of a controller you need to get the CodeIgniter Super Object.
Also SEE: The CodeIgniter Documentation on Language files etc;
What did you Try? What did you Get? What did you Expect?
Joined CodeIgniter Community 2009. ( Skype: insitfx )