From: Carsten K. <car...@us...> - 2001-12-28 09:53:38
|
Update of /cvsroot/phpwiki/phpwiki/lib In directory usw-pr-cvs1:/tmp/cvs-serv13928/phpwiki/lib Modified Files: ziplib.php Log Message: Found more strings needing gettext _() and sprintf. Error strings containing function names now use sprintf. Some debugging strings intentionally left alone. Index: ziplib.php =================================================================== RCS file: /cvsroot/phpwiki/phpwiki/lib/ziplib.php,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -r1.12 -r1.13 *** ziplib.php 2001/12/19 12:08:04 1.12 --- ziplib.php 2001/12/28 09:53:34 1.13 *************** *** 33,49 **** $filename = gzip_tempnam(); if (!($fp = gzopen($filename, "wb"))) ! ExitWiki("gzopen failed"); gzwrite($fp, $data, strlen($data)); if (!gzclose($fp)) ! ExitWiki("gzclose failed"); $size = filesize($filename); if (!($fp = fopen($filename, "rb"))) ! ExitWiki("fopen failed"); if (!($z = fread($fp, $size)) || strlen($z) != $size) ! ExitWiki("fread failed"); if (!fclose($fp)) ! ExitWiki("fclose failed"); unlink($filename); --- 33,49 ---- $filename = gzip_tempnam(); if (!($fp = gzopen($filename, "wb"))) ! ExitWiki(sprintf(_("%s failed"),'gzopen')); gzwrite($fp, $data, strlen($data)); if (!gzclose($fp)) ! ExitWiki(sprintf(_("%s failed"),'gzclose')); $size = filesize($filename); if (!($fp = fopen($filename, "rb"))) ! ExitWiki(sprintf(_("%s failed"),'fopen')); if (!($z = fread($fp, $size)) || strlen($z) != $size) ! ExitWiki(sprintf(_("%s failed"),'fread')); if (!fclose($fp)) ! ExitWiki(sprintf(_("%s failed"),'fclose')); unlink($filename); *************** *** 54,69 **** $filename = gzip_tempnam(); if (!($fp = fopen($filename, "wb"))) ! ExitWiki("fopen failed"); fwrite($fp, $data, strlen($data)); if (!fclose($fp)) ! ExitWiki("fclose failed"); if (!($fp = gzopen($filename, "rb"))) ! ExitWiki("gzopen failed"); $unz = ''; while ($buf = gzread($fp, 4096)) $unz .= $buf; if (!gzclose($fp)) ! ExitWiki("gzclose failed"); unlink($filename); --- 54,69 ---- $filename = gzip_tempnam(); if (!($fp = fopen($filename, "wb"))) ! ExitWiki(sprintf(_("%s failed"),'fopen')); fwrite($fp, $data, strlen($data)); if (!fclose($fp)) ! ExitWiki(sprintf(_("%s failed"),'fclose')); if (!($fp = gzopen($filename, "rb"))) ! ExitWiki(sprintf(_("%s failed"),'gzopen')); $unz = ''; while ($buf = gzread($fp, 4096)) $unz .= $buf; if (!gzclose($fp)) ! ExitWiki(sprintf(_("%s failed"),'gzclose')); unlink($filename); *************** *** 159,167 **** if ($magic != GZIP_MAGIC) ! ExitWiki("Bad gzip magic"); if ($comp_type != GZIP_DEFLATE) ! ExitWiki("Bad gzip comp type"); if (($flags & 0x3e) != 0) ! ExitWiki(sprintf("Bad flags (0x%02x)", $flags)); $gz_header_len = 10; --- 159,167 ---- if ($magic != GZIP_MAGIC) ! ExitWiki(sprintf(_("Bad %s"),"gzip magic")); if ($comp_type != GZIP_DEFLATE) ! ExitWiki(sprintf(_("Bad %s"),"gzip comp type")); if (($flags & 0x3e) != 0) ! ExitWiki(sprintf(_("Bad %s"),sprintf("flags (0x%02x)", $flags))); $gz_header_len = 10; *************** *** 181,185 **** { if (!function_exists('gzopen')) ! ExitWiki("Can't inflate data: zlib support not enabled in this PHP"); // Reconstruct gzip header and ungzip the data. --- 181,185 ---- { if (!function_exists('gzopen')) ! ExitWiki(_("Can't inflate data: zlib support not enabled in this PHP")); // Reconstruct gzip header and ungzip the data. *************** *** 359,363 **** $this->fp = $zipfile; // File already open else if (!($this->fp = fopen($zipfile, "rb"))) ! ExitWiki("Can't open zip file '$zipfile' for reading"); } --- 359,363 ---- $this->fp = $zipfile; // File already open else if (!($this->fp = fopen($zipfile, "rb"))) ! ExitWiki(sprintf(_("Can't open zip file '%s' for reading"),$zipfile)); } *************** *** 365,369 **** $chunk = fread($this->fp, $nbytes); if (strlen($chunk) != $nbytes) ! ExitWiki("Unexpected EOF in zip file"); return $chunk; } --- 365,369 ---- $chunk = fread($this->fp, $nbytes); if (strlen($chunk) != $nbytes) ! ExitWiki(_("Unexpected EOF in zip file")); return $chunk; } *************** *** 389,399 **** { if ($magic != ZIP_CENTHEAD_MAGIC) ! ExitWiki("Bad header type: " . htmlspecialchars($magic)); // FIXME: better message? return $this->done(); } if (($flags & 0x21) != 0) ! ExitWiki("Encryption and/or zip patches not supported."); if (($flags & 0x08) != 0) ! ExitWiki("Postponed CRC not yet supported."); // FIXME: ??? $filename = $this->_read($filename_len); --- 389,399 ---- { if ($magic != ZIP_CENTHEAD_MAGIC) ! ExitWiki(sprintf(_("Bad header type: %s"),htmlspecialchars($magic))); // FIXME: better message? return $this->done(); } if (($flags & 0x21) != 0) ! ExitWiki(_("Encryption and/or zip patches not supported.")); if (($flags & 0x08) != 0) ! ExitWiki(_("Postponed CRC not yet supported.")); // FIXME: ??? $filename = $this->_read($filename_len); *************** *** 414,421 **** } else ! ExitWiki("Compression method $comp_method unsupported"); if (strlen($data) != $uncomp_size) ! ExitWiki(sprintf("Uncompressed size mismatch %d != %d", strlen($data), $uncomp_size)); --- 414,421 ---- } else ! ExitWiki(sprintf(_("Compression method %s unsupported"),$comp_method)); if (strlen($data) != $uncomp_size) ! ExitWiki(sprintf(_("Uncompressed size mismatch")."%d != %d", strlen($data), $uncomp_size)); *************** *** 561,565 **** . '\s*(' . MIME_TOKEN_REGEXP . ')\s*:x', $string, $match)) ! ExitWiki ("Bad MIME content-type"); $type = strtolower($match[1]); --- 561,565 ---- . '\s*(' . MIME_TOKEN_REGEXP . ')\s*:x', $string, $match)) ! ExitWiki(sprintf(_("Bad %s"),'MIME content-type')); $type = strtolower($match[1]); *************** *** 579,583 **** $param[strtolower($match[1])] = $val; ! $string = substr($string, strlen($match[0])); } --- 579,583 ---- $param[strtolower($match[1])] = $val; ! $string = substr($string, strlen($match[0])); } *************** *** 620,624 **** { if (preg_match('/^ref([1-9][0-9]*)$/', $p, $m)) ! $footnotes[$m[1]] = sprintf(gettext ("[%d] See [%s]"), $m[1], rawurldecode($reference)); } --- 620,624 ---- { if (preg_match('/^ref([1-9][0-9]*)$/', $p, $m)) ! $footnotes[$m[1]] = sprintf(_("[%d] See [%s]"), $m[1], rawurldecode($reference)); } *************** *** 628,632 **** ksort($footnotes); return "-----\n" ! . gettext ("!References") . "\n" . join("\n%%%\n", $footnotes) . "\n"; } --- 628,632 ---- ksort($footnotes); return "-----\n" ! . "!" ._("References") . "\n" . join("\n%%%\n", $footnotes) . "\n"; } |