Update from SVN: '.$lang_dir.$file.''; while (!feof($fp)) { $line = fgets($fp, 4096); if (trim($line) == "") $headers = false; if (!$headers) fwrite($fl, $line); } fclose($fp); fclose($fl); } } if (is_file(LANGDIR."$lang_prefix$file")) return LANGDIR."$lang_prefix$file"; else return false; } function lang_selection($lang) { include(update_from_svn('', 'index.inc')); $out = ""; return $out; } function build_localization($lang, $file) { global $orig_values, $edit_values; $array = $file == "messages.inc" ? '$messages' : '$labels'; $fpath = $lang != "_NEW_" ? update_from_svn($lang, $file) : 'nope'; if (!strstr($fpath, 'http') && !is_file($fpath)) $fpath = realpath("./$file"); $out = ""; if ($fpath && ($fp = fopen($fpath, 'r'))) { while (!feof($fp)) { $line = trim(fgets($fp)); if (empty($line) && empty($out)) continue; $out .= str_replace('#lang', $lang, $line) . "\n"; // reached begin of php array if (strstr($line, $array)) break; } } else { $out .= ' $t_value) { $t_value = get_input_value('t_'.$t_key); if (empty($t_value) && isset($edit_values[$t_key])) $t_value = $edit_values[$t_key]; if (!empty($t_value)) $out .= $array . "['$t_key'] = '" . addslashes($t_value) . "';\n"; } $out .= "\n?>\n"; return $out; } // -------- EOF func --------// $header = array(); $orig_values = array(); $labels = $messages = null; $file = get_input_value('file'); $lang = get_input_value('lang'); $translated = !empty($_REQUEST['trans']); // read reference file if ($file && $lang) include(update_from_svn(ORIGINAL, $file)); if ($file == 'labels.inc' && $labels) $orig_values = $labels; else if ($file == 'messages.inc' && $messages) $orig_values = $messages; unset($labels, $messages); // read current localization file if (!empty($lang) && !empty($file)) { if ($lang != "_NEW_") @include(update_from_svn($lang, $file)); if (!empty($labels)) $edit_values = $labels; else if (!empty($messages)) $edit_values = $messages; else $edit_values = array(); unset($labels, $messages); } ?>