You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Version 0.5 (c) Wiredesignz 2008-04-08
**/
class Language
{
function parse($view, $data = array(), $lang_files = array(), $lang = 'english')
{
$this->load->language($lang_files, $lang);
//build the view normally
if ($template = $this->load->view($view, $data, TRUE))
{
//parse the language variables
while(preg_match('/\{(\w*)\}/siU', $template, $match))
{
//if no translation is found use the variable as a literal
if (($line = $this->lang->line("$match[1]")) === FALSE) $line = $match[1];
$template = str_replace($match[0], $line, $template);
}
return $template;
}