From: Carsten K. <car...@us...> - 2001-12-19 08:54:04
|
Update of /cvsroot/phpwiki/phpwiki/lib/WikiDB/backend In directory usw-pr-cvs1:/tmp/cvs-serv19629/phpwiki/lib/WikiDB/backend Modified Files: cvs.php Log Message: gettext-ified error messages with sprintf(_("%s"),$v) Index: cvs.php =================================================================== RCS file: /cvsroot/phpwiki/phpwiki/lib/WikiDB/backend/cvs.php,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -r1.4 -r1.5 *** cvs.php 2001/11/26 09:25:36 1.4 --- cvs.php 2001/12/19 08:54:01 1.5 *************** *** 91,95 **** && is_dir( $this->_repository . "/" . $this->_module_name ))) { ! $this->_cvsDebug( "Creating new repository [$this->_repository]" ); // doesn't exist, need to create it and the replace the wiki --- 91,95 ---- && is_dir( $this->_repository . "/" . $this->_module_name ))) { ! $this->_cvsDebug( sprintf(_("Creating new repository [%s]"),$this->_repository) ); // doesn't exist, need to create it and the replace the wiki *************** *** 126,131 **** while ( $entry = readdir( $d ) ) { $filename = $dbparam[CVS_PAGE_SOURCE] . "/" . $entry; ! $this->_cvsDebug("Found [$entry] in [" ! . $dbparam[CVS_PAGE_SOURCE]."]"); if ( is_file( $filename ) ) { --- 126,130 ---- while ( $entry = readdir( $d ) ) { $filename = $dbparam[CVS_PAGE_SOURCE] . "/" . $entry; ! $this->_cvsDebug( sprintf(_("Found [%s] in [%s]"),$entry,$dbparam[CVS_PAGE_SOURCE]) ); if ( is_file( $filename ) ) { *************** *** 181,185 **** // check argument if ( ! is_array( $newdata ) ) { ! trigger_error("update_pagedata: Argument 'newdata' was not array", E_USER_WARNING); } --- 180,184 ---- // check argument if ( ! is_array( $newdata ) ) { ! trigger_error(_("update_pagedata: Argument 'newdata' was not array"), E_USER_WARNING); } *************** *** 189,193 **** if ( ! $metaData ) { ! $this->_cvsDebug( "update_pagedata: no meta data found" ); // this means that the page does not exist, we need to create // it. --- 188,192 ---- if ( ! $metaData ) { ! $this->_cvsDebug( _("update_pagedata: no meta data found") ); // this means that the page does not exist, we need to create // it. *************** *** 242,246 **** return $metaData[CMD_VERSION]; } else { ! $this->_cvsDebug( "get_latest_versioned FAILED for [$pagename]" ); return 0; } --- 241,245 ---- return $metaData[CMD_VERSION]; } else { ! $this->_cvsDebug( sprintf(_("get_latest_versioned FAILED for [%s]"),$pagename) ); return 0; } *************** *** 259,264 **** function get_versiondata($pagename, $version, $want_content = false) { ! $this->_cvsDebug( "get_versiondata: [$pagename] " ! . "[$version] [$want_content]" ); $filedata = ""; --- 258,262 ---- function get_versiondata($pagename, $version, $want_content = false) { ! $this->_cvsDebug( sprintf(_("get_versiondata: [%s] [%s] [%s]"),$pagename,$version,$want_content) ); $filedata = ""; *************** *** 315,319 **** function delete_page($pagename) { ! $this->_cvsDebug( "delete_page [$pagename]" ); $filename = $this->_docDir . "/" . $pagename; $metaFile = $this->_docDir . "/CVS/_" . $pagename; --- 313,317 ---- function delete_page($pagename) { ! $this->_cvsDebug( sprintf(_("delete_page [%s]"),$pagename) ; $filename = $this->_docDir . "/" . $pagename; $metaFile = $this->_docDir . "/CVS/_" . $pagename; *************** *** 337,341 **** // TODO: revision somewhere in the middle of a revision tree, and // TODO: this is basically not possible! ! trigger_error("delete_versiondata: Not Implemented", E_USER_WARNING); } --- 335,339 ---- // TODO: revision somewhere in the middle of a revision tree, and // TODO: this is basically not possible! ! trigger_error( _("delete_versiondata: Not Implemented"), E_USER_WARNING); } *************** *** 347,351 **** // TODO: file directly but i don't know of a way of doing it via // TODO: the cvs tools). ! trigger_error("set_versiondata: Not Implemented", E_USER_WARNING); } --- 345,349 ---- // TODO: file directly but i don't know of a way of doing it via // TODO: the cvs tools). ! trigger_error( _("set_versiondata: Not Implemented"), E_USER_WARNING); } *************** *** 450,454 **** { // TODO: to be implemented ! trigger_error("lock: Not Implemented", E_USER_WARNING); } --- 448,452 ---- { // TODO: to be implemented ! trigger_error(_("lock: Not Implemented"), E_USER_WARNING); } *************** *** 456,460 **** { // TODO: to be implemented ! trigger_error("unlock: Not Implemented", E_USER_WARNING); } --- 454,458 ---- { // TODO: to be implemented ! trigger_error(_("unlock: Not Implemented"), E_USER_WARNING); } *************** *** 520,524 **** // this is used as part of an array walk and therefore takes // the backend argument ! $backend->_cvsDebug( "Creating meta file for [$page_name]" ); $backend->update_pagedata( $page_name, array() ); } --- 518,522 ---- // this is used as part of an array walk and therefore takes // the backend argument ! $backend->_cvsDebug( sprintf(_("Creating meta file for [%s]"),$page_name) ); $backend->update_pagedata( $page_name, array() ); } *************** *** 614,626 **** $this->_cvsDebug( "CP: $cmdOutput" ); if ( isset( $revInfo[1] ) ) { ! $this->_cvsDebug( "CP: got revision information" ); return $revInfo[1]; } else { ereg( "\ninitial revision: 1[.]([0-9]+)", $cmdOutput, $revInfo ); if ( isset( $revInfo[1] ) ) { ! $this->_cvsDebug( "CP: is initial release" ); return 1; } ! $this->_cvsDebug( "CP: returning old version" ); return $meta_data[CMD_VERSION]; } --- 612,624 ---- $this->_cvsDebug( "CP: $cmdOutput" ); if ( isset( $revInfo[1] ) ) { ! $this->_cvsDebug( _("CP: got revision information") ); return $revInfo[1]; } else { ereg( "\ninitial revision: 1[.]([0-9]+)", $cmdOutput, $revInfo ); if ( isset( $revInfo[1] ) ) { ! $this->_cvsDebug( _("CP: is initial release") ); return 1; } ! $this->_cvsDebug( _("CP: returning old version") ); return $meta_data[CMD_VERSION]; } *************** *** 689,694 **** if (!$locked) { ! $this->_cvsError("Unable to delete file, " ! . "lock was not obtained.", __LINE__, $filename, EM_NOTICE_ERRORS ); } --- 687,691 ---- if (!$locked) { ! $this->_cvsError(_("Unable to delete file, lock was not obtained."), __LINE__, $filename, EM_NOTICE_ERRORS ); } *************** *** 700,704 **** return $rVal; } else { ! $this->_cvsError("deleteFile: Unable to open file", __LINE__, $filename, EM_NOTICE_ERRORS ); return false; --- 697,701 ---- return $rVal; } else { ! $this->_cvsError(_("deleteFile: Unable to open file"), __LINE__, $filename, EM_NOTICE_ERRORS ); return false; *************** *** 710,714 **** * fail. */ ! function _cvsError( $msg = "no message", $errline = 0, $errfile = "lib/WikiDB/backend/cvs.php", --- 707,711 ---- * fail. */ ! function _cvsError( $msg = _("no message"), $errline = 0, $errfile = "lib/WikiDB/backend/cvs.php", *************** *** 750,754 **** else { // TODO: this should be replaced ... ! print( "unable to locate/open [$filename], turning debug off\n" ); $this->_debug_file = ""; } --- 747,751 ---- else { // TODO: this should be replaced ... ! printf( _("unable to locate/open [%s], turning debug off"),$filename)."\n"; $this->_debug_file = ""; } *************** *** 761,774 **** function _execCommand( $cmdLine, &$cmdOutput, $exitOnNonZero ) { ! $this->_cvsDebug( "Preparing to execute [$cmdLine]" ); exec( $cmdLine, $cmdOutput, $cmdReturnVal ); if ( $exitOnNonZero && ($cmdReturnVal != 0) ) { ! $this->_cvsDebug( "Command failed [$cmdLine], Output: [" . join("\n",$cmdOutput) . "]" ); ! $this->_cvsError("Command failed [$cmdLine], " ! . "Return value: $cmdReturnVal", ! __LINE__ ); } ! $this->_cvsDebug( "Done execution [" . join("\n", $cmdOutput ) . "]" ); return $cmdReturnVal; --- 758,770 ---- function _execCommand( $cmdLine, &$cmdOutput, $exitOnNonZero ) { ! $this->_cvsDebug( sprintf(_("Preparing to execute [%s]"),$cmdLine) ); exec( $cmdLine, $cmdOutput, $cmdReturnVal ); if ( $exitOnNonZero && ($cmdReturnVal != 0) ) { ! $this->_cvsDebug( sprintf(_("Command failed [%s], Output: ["),$cmdLine) . join("\n",$cmdOutput) . "]" ); ! $this->_cvsError( sprintf(_("Command failed [%s], Return value: %s"),$cmdLine,$cmdReturnVal), ! __LINE__ ); } ! $this->_cvsDebug( _("Done execution")." [" . join("\n", $cmdOutput ) . "]" ); return $cmdReturnVal; *************** *** 784,788 **** if ( !$locked ) { fclose( $fd ); ! $this->_cvsError( "Unable to obtain read lock.",__LINE__); } --- 780,784 ---- if ( !$locked ) { fclose( $fd ); ! $this->_cvsError( _("Unable to obtain read lock."),__LINE__); } *************** *** 791,795 **** return $content; } else { ! $this->_cvsError( "Unable to open file '$filename' for reading", __LINE__ ); return false; --- 787,791 ---- return $content; } else { ! $this->_cvsError( sprintf(_("Unable to open file '%s' for reading"),$filename), __LINE__ ); return false; *************** *** 810,814 **** $locked = flock($fd,2); // Exclusive blocking lock if (!$locked) { ! $this->_cvsError("Timeout while obtaining lock.",__LINE__); } --- 806,810 ---- $locked = flock($fd,2); // Exclusive blocking lock if (!$locked) { ! $this->_cvsError( _("Timeout while obtaining lock."),__LINE__); } *************** *** 829,843 **** function _copyFilesFromDirectory( $src, $dest ) { ! $this->_cvsDebug( "Copying from [$src] to [$dest]" ); if ( is_dir( $src ) && is_dir( $dest ) ) { ! $this->_cvsDebug( "Copying " ); $d = opendir( $src ); while ( $entry = readdir( $d ) ) { if ( is_file( $src . "/" . $entry ) && copy( $src . "/" . $entry, $dest . "/" . $entry ) ) { ! $this->_cvsDebug( "Copied to [$dest/$entry]" ); } else { ! $this->_cvsDebug( "Failed to copy [$src/$entry]" ); } } --- 825,839 ---- function _copyFilesFromDirectory( $src, $dest ) { ! $this->_cvsDebug( sprintf(_("Copying from [%s] to [%s]"),$src,$dest) ); if ( is_dir( $src ) && is_dir( $dest ) ) { ! $this->_cvsDebug( _("Copying") ." " ); $d = opendir( $src ); while ( $entry = readdir( $d ) ) { if ( is_file( $src . "/" . $entry ) && copy( $src . "/" . $entry, $dest . "/" . $entry ) ) { ! $this->_cvsDebug( sprintf(_("Copied to [%s/%s]"),$dest,$entry) ); } else { ! $this->_cvsDebug( sprintf(_("Failed to copy [%s/%s]"),$src,$entry) ); } } *************** *** 845,849 **** return true; } else { ! $this->_cvsDebug( "Not copying" ); return false; } --- 841,845 ---- return true; } else { ! $this->_cvsDebug( _("Not copying") ); return false; } |