This is a very small language_helper extension that adds a $var parameter to the lang() function.
This will work with CodeIgniter 1.7.x and 2.0.
Copy the MY_language_helper.php file into your application/helpers folder.
In your language files you can now put variables inside your strings, prepended with a colon (:).
Example:
$lang['welcome'] = 'Hello :name, how are you? Today is :date!';
Then when you call the lang() helper function you send an array with the variable values.
Example:
<?php echo lang('welcome', array(':name' => 'Dan', ':date' => date('l'))); ?>
And this would output:
“Hello Dan, how are you? Today is Friday!”