language_exists($language)) { die("LANGUAGE [$language] DOESN'T EXIST"); } $this->language = $language; require $this->path . $language . ".php"; $this->opts = $langopt; } //load the appropriate files now, falling back to english if possibl or needed function load($section) { $lang_file = $this->path . $this->language . "\language." . $section . ".php"; if(file_exists($lang_file)) { require_once $lang_file; } elseif(file_exists($this->path . "en\language." . $section . ".php")) { require_once $this->path . "en\language." . $section . ".php"; } // These shall not be edited! $dont_use = array('language', 'path', 'lang_options'); if(is_array($lang)) { foreach($lang as $one => $two) { if((empty($this->$one) || $this->$one != $two) && !in_array($one, $dont_use)) { $this->$one = $two; if (FIEME_DEV == 1) { global $dev_content; $dev_content .= "success load lang: $one
"; } } } } } function sprintf($string) { $arg_list = func_get_args(); $num_args = count($arg_list); for($i = 1; $i < $num_args; $i++) { $string = str_replace('{'.$i.'}', $arg_list[$i], $string); } return $string; } function language_exists($language) { if(file_exists($this->path . $language . ".php")) { return true; } else { echo $this->path . $language . ".php"; return false; } } } /* if ($handle = opendir("$cfg[script_root]includes/lang/en/")) { while (false !== ($file = readdir($handle))) { if ($file != "." && $file != "..") { if (preg_match('/\.php/', $file)) { include("lang/" . $cfg['lang_prefix'] . "/$file"); } } } } else { die("FATAL ERROR. COULD NOT LOAD LANGUAGE FILES"); } */