- Patch #4950 by Stefan (and Morbus): made watchdog messages translatable.

4.5.x
Dries Buytaert 2004-06-02 19:01:40 +00:00
parent dfef5164b4
commit c0b85a5721
22 changed files with 64 additions and 64 deletions

View File

@ -18,5 +18,5 @@ if (!ini_get("safe_mode")) {
module_invoke_all("cron"); module_invoke_all("cron");
watchdog("regular", "cron run completed"); watchdog('regular', t('cron run completed'));
?> ?>

View File

@ -4,7 +4,7 @@
/** /**
* @defgroup common Core functions * @defgroup common Core functions
*/ */
/** /**
* @name Page title * @name Page title
* @ingroup common * @ingroup common
@ -263,7 +263,7 @@ function drupal_goto($url = NULL, $query = NULL, $fragment = NULL) {
*/ */
function drupal_not_found() { function drupal_not_found() {
header('HTTP/1.0 404 Not Found'); header('HTTP/1.0 404 Not Found');
watchdog('httpd', '404 error: "'. check_query($_GET['q']) .'" not found'); watchdog('httpd', t('404 error: "%page" not found', array('%page' => check_query($_GET["q"]))));
$path = drupal_get_normal_path(variable_get('site_404', '')); $path = drupal_get_normal_path(variable_get('site_404', ''));
$status = MENU_FALLTHROUGH; $status = MENU_FALLTHROUGH;
@ -424,7 +424,7 @@ function error_handler($errno, $message, $filename, $line, $variables) {
$entry = $types[$errno] .": $message in $filename on line $line."; $entry = $types[$errno] .": $message in $filename on line $line.";
if ($errno & E_ALL ^ E_NOTICE) { if ($errno & E_ALL ^ E_NOTICE) {
watchdog("error", $types[$errno] .": $message in $filename on line $line."); watchdog('error', t('%error: %message in %file on line %line.', array('%error' => $types[$errno], '%message' => $message, '%file' => $filename, '%line' => $line)));
if (error_reporting()) { if (error_reporting()) {
print "<pre>$entry</pre>"; print "<pre>$entry</pre>";
} }
@ -631,7 +631,7 @@ function valid_input_data($data) {
$match += preg_match("/<\s*(applet|script|object|style|embed|form|blink|meta|html|frame|iframe|layer|ilayer|head|frameset|xml)/i", $data); $match += preg_match("/<\s*(applet|script|object|style|embed|form|blink|meta|html|frame|iframe|layer|ilayer|head|frameset|xml)/i", $data);
if ($match) { if ($match) {
watchdog("warning", "terminated request because of suspicious input data: ". drupal_specialchars($data)); watchdog('warning', t('terminated request because of suspicious input data: %data', array('%data' => drupal_specialchars($data))));
return 0; return 0;
} }
} }

View File

@ -130,7 +130,7 @@ function db_next_id($name) {
$name = db_prefix_tables($name); $name = db_prefix_tables($name);
$result = $active_db->nextID($name); $result = $active_db->nextID($name);
if (DB::isError($result)) { if (DB::isError($result)) {
watchdog("error", "database: ". $result->getMessage() ."\nsequence table: $name"); watchdog('error', t('database: %db\nsequence table: %name', array('%db' => $result->getMessage(), '%name' => $name)));
} }
else { else {
return $result; return $result;
@ -183,7 +183,7 @@ function db_query_range($query) {
} }
if (DB::isError($result)) { if (DB::isError($result)) {
watchdog("error", "database: ". $result->getMessage() ."\nquery: ". htmlspecialchars($query)); watchdog('error', t('database: %db\nquery: %query', array('%db' => $result->getMessage(), '%query' => htmlspecialchars($query))));
} }
else { else {
return $result; return $result;

View File

@ -290,7 +290,7 @@ function aggregator_refresh($feed) {
break; break;
case 301: case 301:
$feed['url'] = $result->redirect_url; $feed['url'] = $result->redirect_url;
watchdog('special', "aggregator: updated URL for feed \"$feed[title]\" to $feed[url]"); watchdog('special', t('aggregator: updated URL for feed "%title" to %url', array('%title' => $feed[title], '%url' => $feed[url])));
case 200: case 200:
case 302: case 302:
case 307: case 307:
@ -328,14 +328,14 @@ function aggregator_refresh($feed) {
cache_clear_all(); cache_clear_all();
watchdog('regular', t('aggregator: syndicated content from "%site"', array('%site' => $feed[title])));
$message = t('syndicated content from "%site".', array('%site' => $feed['title'])); $message = t('syndicated content from "%site".', array('%site' => $feed['title']));
watchdog('regular', "aggregator: $message");
drupal_set_message($message); drupal_set_message($message);
} }
break; break;
default: default:
watchdog('error', t('aggregator: failed to parse RSS feed "%site": %error', array('%site' => $feed['title'], '%error' => $result->code .' '. $result->error)));
$message = t('failed to parse RSS feed "%site": %error.', array('%site' => $feed['title'], '%error' => $result->code .' '. $result->error)); $message = t('failed to parse RSS feed "%site": %error.', array('%site' => $feed['title'], '%error' => $result->code .' '. $result->error));
watchdog('error', "aggregator: $message");
drupal_set_message($message); drupal_set_message($message);
} }
} }
@ -355,8 +355,8 @@ function aggregator_parse_feed(&$data, $feed) {
xml_set_character_data_handler($xml_parser, 'aggregator_element_data'); xml_set_character_data_handler($xml_parser, 'aggregator_element_data');
if (!xml_parse($xml_parser, $data, 1)) { if (!xml_parse($xml_parser, $data, 1)) {
watchdog('error', t('aggregator: failed to parse RSS feed "%site": %error at line %line.', array('%site' => $feed['title'], '%error' => xml_error_string(xml_get_error_code($xml_parser)), '%line' => xml_get_current_line_number($xml_parser))));
$message = t('failed to parse RSS feed "%site": %error at line %line.', array('%site' => $feed['title'], '%error' => xml_error_string(xml_get_error_code($xml_parser)), '%line' => xml_get_current_line_number($xml_parser))); $message = t('failed to parse RSS feed "%site": %error at line %line.', array('%site' => $feed['title'], '%error' => xml_error_string(xml_get_error_code($xml_parser)), '%line' => xml_get_current_line_number($xml_parser)));
watchdog('error', "aggregator: $message");
drupal_set_message($message, 'error'); drupal_set_message($message, 'error');
return 0; return 0;
} }

View File

@ -290,7 +290,7 @@ function aggregator_refresh($feed) {
break; break;
case 301: case 301:
$feed['url'] = $result->redirect_url; $feed['url'] = $result->redirect_url;
watchdog('special', "aggregator: updated URL for feed \"$feed[title]\" to $feed[url]"); watchdog('special', t('aggregator: updated URL for feed "%title" to %url', array('%title' => $feed[title], '%url' => $feed[url])));
case 200: case 200:
case 302: case 302:
case 307: case 307:
@ -328,14 +328,14 @@ function aggregator_refresh($feed) {
cache_clear_all(); cache_clear_all();
watchdog('regular', t('aggregator: syndicated content from "%site"', array('%site' => $feed[title])));
$message = t('syndicated content from "%site".', array('%site' => $feed['title'])); $message = t('syndicated content from "%site".', array('%site' => $feed['title']));
watchdog('regular', "aggregator: $message");
drupal_set_message($message); drupal_set_message($message);
} }
break; break;
default: default:
watchdog('error', t('aggregator: failed to parse RSS feed "%site": %error', array('%site' => $feed['title'], '%error' => $result->code .' '. $result->error)));
$message = t('failed to parse RSS feed "%site": %error.', array('%site' => $feed['title'], '%error' => $result->code .' '. $result->error)); $message = t('failed to parse RSS feed "%site": %error.', array('%site' => $feed['title'], '%error' => $result->code .' '. $result->error));
watchdog('error', "aggregator: $message");
drupal_set_message($message); drupal_set_message($message);
} }
} }
@ -355,8 +355,8 @@ function aggregator_parse_feed(&$data, $feed) {
xml_set_character_data_handler($xml_parser, 'aggregator_element_data'); xml_set_character_data_handler($xml_parser, 'aggregator_element_data');
if (!xml_parse($xml_parser, $data, 1)) { if (!xml_parse($xml_parser, $data, 1)) {
watchdog('error', t('aggregator: failed to parse RSS feed "%site": %error at line %line.', array('%site' => $feed['title'], '%error' => xml_error_string(xml_get_error_code($xml_parser)), '%line' => xml_get_current_line_number($xml_parser))));
$message = t('failed to parse RSS feed "%site": %error at line %line.', array('%site' => $feed['title'], '%error' => xml_error_string(xml_get_error_code($xml_parser)), '%line' => xml_get_current_line_number($xml_parser))); $message = t('failed to parse RSS feed "%site": %error at line %line.', array('%site' => $feed['title'], '%error' => xml_error_string(xml_get_error_code($xml_parser)), '%line' => xml_get_current_line_number($xml_parser)));
watchdog('error', "aggregator: $message");
drupal_set_message($message, 'error'); drupal_set_message($message, 'error');
return 0; return 0;
} }

View File

@ -142,7 +142,7 @@ function blogapi_new_post($req_params) {
$nid = node_save($node); $nid = node_save($node);
if ($nid) { if ($nid) {
watchdog('special', "$node->type: added '$node->title' using blog API", l(t('view post'), "node/view/$nid")); watchdog('special', t('%node-type: added "%node-title" using blog API', array('%node-type' => t("$node->type"), '%node-title' => $node->title)), l(t('view post'), "node/view/$nid"));
return new xmlrpcresp(new xmlrpcval($nid, 'string')); return new xmlrpcresp(new xmlrpcval($nid, 'string'));
} }
@ -202,7 +202,7 @@ function blogapi_edit_post($req_params) {
} }
$nid = node_save($node); $nid = node_save($node);
if ($nid) { if ($nid) {
watchdog('special', "$node->type: updated '$node->title' using blog API", l(t('view post'), "node/view/$nid")); watchdog('special', t('%node-type: updated "%node-title" using blog API', array('%node-type' => t("$node->type"), '%node-title' => $node->title)), l(t('view post'), "node/view/$nid"));
return new xmlrpcresp(new xmlrpcval(true, 'boolean')); return new xmlrpcresp(new xmlrpcval(true, 'boolean'));
} }

View File

@ -142,7 +142,7 @@ function blogapi_new_post($req_params) {
$nid = node_save($node); $nid = node_save($node);
if ($nid) { if ($nid) {
watchdog('special', "$node->type: added '$node->title' using blog API", l(t('view post'), "node/view/$nid")); watchdog('special', t('%node-type: added "%node-title" using blog API', array('%node-type' => t("$node->type"), '%node-title' => $node->title)), l(t('view post'), "node/view/$nid"));
return new xmlrpcresp(new xmlrpcval($nid, 'string')); return new xmlrpcresp(new xmlrpcval($nid, 'string'));
} }
@ -202,7 +202,7 @@ function blogapi_edit_post($req_params) {
} }
$nid = node_save($node); $nid = node_save($node);
if ($nid) { if ($nid) {
watchdog('special', "$node->type: updated '$node->title' using blog API", l(t('view post'), "node/view/$nid")); watchdog('special', t('%node-type: updated "%node-title" using blog API', array('%node-type' => t("$node->type"), '%node-title' => $node->title)), l(t('view post'), "node/view/$nid"));
return new xmlrpcresp(new xmlrpcval(true, 'boolean')); return new xmlrpcresp(new xmlrpcval(true, 'boolean'));
} }

View File

@ -837,8 +837,8 @@ function book_admin_save($nid, $edit = array()) {
} }
} }
$message = t("updated book '%title'", array("%title" => $book->title)); $message = t('updated book "%title"', array('%title' => $book->title));
watchdog("special", $message); watchdog('special', $message);
return $message; return $message;
} }

View File

@ -837,8 +837,8 @@ function book_admin_save($nid, $edit = array()) {
} }
} }
$message = t("updated book '%title'", array("%title" => $book->title)); $message = t('updated book "%title"', array('%title' => $book->title));
watchdog("special", $message); watchdog('special', $message);
return $message; return $message;
} }

View File

@ -332,7 +332,7 @@ function comment_post($edit) {
$duplicate = db_result(db_query("SELECT COUNT(cid) FROM {comments} WHERE pid = %d AND nid = %d AND subject = '%s' AND comment = '%s'", $edit["pid"], $edit["nid"], $edit['subject'], $edit['comment']), 0); $duplicate = db_result(db_query("SELECT COUNT(cid) FROM {comments} WHERE pid = %d AND nid = %d AND subject = '%s' AND comment = '%s'", $edit["pid"], $edit["nid"], $edit['subject'], $edit['comment']), 0);
if ($duplicate != 0) { if ($duplicate != 0) {
watchdog("warning", "comment: duplicate '". $edit['subject'] ."'"); watchdog('warning', t('comment: duplicate "%comment-subject"', array('%comment-subject' => $edit["subject"])));
} }
if ($edit["cid"]) { if ($edit["cid"]) {
@ -354,7 +354,7 @@ function comment_post($edit) {
** Add entry to the watchdog log: ** Add entry to the watchdog log:
*/ */
watchdog("special", "comment: updated '". $edit['subject'] ."'", l(t("view comment"), "node/view/". $edit["nid"], NULL, NULL, "comment-". $edit["cid"])); watchdog('special', t('comment: updated "%comment-subject"', array('%comment-subject' => $edit["subject"])), l(t("view comment"), "node/view/". $edit["nid"], NULL, NULL, "comment-". $edit["cid"]));
} }
else { else {
/* /*
@ -472,7 +472,7 @@ function comment_post($edit) {
** Add entry to the watchdog log: ** Add entry to the watchdog log:
*/ */
watchdog("special", "comment: added '". $edit['subject'] ."'", l(t("view comment"), "node/view/". $edit["nid"], NULL, NULL, "comment-". $edit["cid"])); watchdog('special', t('comment: added "%comment-subject"', array('%comment-subject' => $edit["subject"])), l(t("view comment"), "node/view/". $edit["nid"], NULL, NULL, "comment-". $edit["cid"]));
} }
@ -500,7 +500,7 @@ function comment_post($edit) {
} }
} }
else { else {
watchdog("error", "comment: unauthorized comment submitted or comment submitted to a closed node '". $edit['subject'] ."'"); watchdog('error', t('comment: unauthorized comment submitted or comment submitted to a closed node "%comment-subject"', array('%comment-subject' => $edit["subject"])));
} }
} }
@ -947,7 +947,7 @@ function comment_admin_edit($id) {
function _comment_delete_thread($comment) { function _comment_delete_thread($comment) {
// Delete the comment: // Delete the comment:
db_query("DELETE FROM {comments} WHERE cid = %d", $comment->cid); db_query("DELETE FROM {comments} WHERE cid = %d", $comment->cid);
watchdog("special", "comment: deleted '$comment->subject'"); watchdog('special', t('comment: deleted "%comment-subject"', array('%comment-subject' => $comment->subject)));
// Delete the comment's replies: // Delete the comment's replies:
$result = db_query("SELECT cid, subject FROM {comments} WHERE pid = %d", $comment->cid); $result = db_query("SELECT cid, subject FROM {comments} WHERE pid = %d", $comment->cid);
@ -997,7 +997,7 @@ function comment_delete($cid, $confirmed = 0) {
function comment_save($id, $edit) { function comment_save($id, $edit) {
db_query("UPDATE {comments} SET subject = '%s', comment = '%s', status = %d WHERE cid = %d", $edit['subject'], $edit['comment'], $edit['status'], $id); db_query("UPDATE {comments} SET subject = '%s', comment = '%s', status = %d WHERE cid = %d", $edit['subject'], $edit['comment'], $edit['status'], $id);
watchdog("special", "comment: modified '". $edit['subject'] ."'"); watchdog('special', t('comment: modified "%comment-subject"', array('%comment-subject' => $edit["subject"])));
drupal_set_message(t("the comment has been saved.")); drupal_set_message(t("the comment has been saved."));
} }

View File

@ -332,7 +332,7 @@ function comment_post($edit) {
$duplicate = db_result(db_query("SELECT COUNT(cid) FROM {comments} WHERE pid = %d AND nid = %d AND subject = '%s' AND comment = '%s'", $edit["pid"], $edit["nid"], $edit['subject'], $edit['comment']), 0); $duplicate = db_result(db_query("SELECT COUNT(cid) FROM {comments} WHERE pid = %d AND nid = %d AND subject = '%s' AND comment = '%s'", $edit["pid"], $edit["nid"], $edit['subject'], $edit['comment']), 0);
if ($duplicate != 0) { if ($duplicate != 0) {
watchdog("warning", "comment: duplicate '". $edit['subject'] ."'"); watchdog('warning', t('comment: duplicate "%comment-subject"', array('%comment-subject' => $edit["subject"])));
} }
if ($edit["cid"]) { if ($edit["cid"]) {
@ -354,7 +354,7 @@ function comment_post($edit) {
** Add entry to the watchdog log: ** Add entry to the watchdog log:
*/ */
watchdog("special", "comment: updated '". $edit['subject'] ."'", l(t("view comment"), "node/view/". $edit["nid"], NULL, NULL, "comment-". $edit["cid"])); watchdog('special', t('comment: updated "%comment-subject"', array('%comment-subject' => $edit["subject"])), l(t("view comment"), "node/view/". $edit["nid"], NULL, NULL, "comment-". $edit["cid"]));
} }
else { else {
/* /*
@ -472,7 +472,7 @@ function comment_post($edit) {
** Add entry to the watchdog log: ** Add entry to the watchdog log:
*/ */
watchdog("special", "comment: added '". $edit['subject'] ."'", l(t("view comment"), "node/view/". $edit["nid"], NULL, NULL, "comment-". $edit["cid"])); watchdog('special', t('comment: added "%comment-subject"', array('%comment-subject' => $edit["subject"])), l(t("view comment"), "node/view/". $edit["nid"], NULL, NULL, "comment-". $edit["cid"]));
} }
@ -500,7 +500,7 @@ function comment_post($edit) {
} }
} }
else { else {
watchdog("error", "comment: unauthorized comment submitted or comment submitted to a closed node '". $edit['subject'] ."'"); watchdog('error', t('comment: unauthorized comment submitted or comment submitted to a closed node "%comment-subject"', array('%comment-subject' => $edit["subject"])));
} }
} }
@ -947,7 +947,7 @@ function comment_admin_edit($id) {
function _comment_delete_thread($comment) { function _comment_delete_thread($comment) {
// Delete the comment: // Delete the comment:
db_query("DELETE FROM {comments} WHERE cid = %d", $comment->cid); db_query("DELETE FROM {comments} WHERE cid = %d", $comment->cid);
watchdog("special", "comment: deleted '$comment->subject'"); watchdog('special', t('comment: deleted "%comment-subject"', array('%comment-subject' => $comment->subject)));
// Delete the comment's replies: // Delete the comment's replies:
$result = db_query("SELECT cid, subject FROM {comments} WHERE pid = %d", $comment->cid); $result = db_query("SELECT cid, subject FROM {comments} WHERE pid = %d", $comment->cid);
@ -997,7 +997,7 @@ function comment_delete($cid, $confirmed = 0) {
function comment_save($id, $edit) { function comment_save($id, $edit) {
db_query("UPDATE {comments} SET subject = '%s', comment = '%s', status = %d WHERE cid = %d", $edit['subject'], $edit['comment'], $edit['status'], $id); db_query("UPDATE {comments} SET subject = '%s', comment = '%s', status = %d WHERE cid = %d", $edit['subject'], $edit['comment'], $edit['status'], $id);
watchdog("special", "comment: modified '". $edit['subject'] ."'"); watchdog('special', t('comment: modified "%comment-subject"', array('%comment-subject' => $edit["subject"])));
drupal_set_message(t("the comment has been saved.")); drupal_set_message(t("the comment has been saved."));
} }

View File

@ -90,7 +90,7 @@ function drupal_directory_ping($arguments) {
db_query("DELETE FROM {directory} WHERE link = '%s' OR mail = '%s'", $link, $mail); db_query("DELETE FROM {directory} WHERE link = '%s' OR mail = '%s'", $link, $mail);
db_query("INSERT INTO {directory} (link, name, mail, slogan, mission, timestamp) VALUES ('%s', '%s', '%s', '%s', '%s', %d)", $link, $name, $mail, $slogan, $mission, time()); db_query("INSERT INTO {directory} (link, name, mail, slogan, mission, timestamp) VALUES ('%s', '%s', '%s', '%s', '%s', %d)", $link, $name, $mail, $slogan, $mission, time());
watchdog('regular', "directory: ping from \"$name\" ($link)"); watchdog('regular', t('directory: ping from "%name" (%link)', array('%name' => $name, '%link' => $link)));
return new xmlrpcresp(new xmlrpcval(1, 'int')); return new xmlrpcresp(new xmlrpcval(1, 'int'));
} }
@ -138,7 +138,7 @@ function drupal_notify($server) {
$result = $client->send($message, 5); $result = $client->send($message, 5);
if (!$result || $result->faultCode()) { if (!$result || $result->faultCode()) {
watchdog('error', 'failed to notify "'. $url['host'] .'" at "'. $url['path'] .'": '. $result->faultString()); watchdog('error', t('failed to notify "%url" at "%path": %error', array('%url' => $url["host"], '%path' => $url["path"], '%error' => $result->faultString())));
} }
} }

View File

@ -90,7 +90,7 @@ function drupal_directory_ping($arguments) {
db_query("DELETE FROM {directory} WHERE link = '%s' OR mail = '%s'", $link, $mail); db_query("DELETE FROM {directory} WHERE link = '%s' OR mail = '%s'", $link, $mail);
db_query("INSERT INTO {directory} (link, name, mail, slogan, mission, timestamp) VALUES ('%s', '%s', '%s', '%s', '%s', %d)", $link, $name, $mail, $slogan, $mission, time()); db_query("INSERT INTO {directory} (link, name, mail, slogan, mission, timestamp) VALUES ('%s', '%s', '%s', '%s', '%s', %d)", $link, $name, $mail, $slogan, $mission, time());
watchdog('regular', "directory: ping from \"$name\" ($link)"); watchdog('regular', t('directory: ping from "%name" (%link)', array('%name' => $name, '%link' => $link)));
return new xmlrpcresp(new xmlrpcval(1, 'int')); return new xmlrpcresp(new xmlrpcval(1, 'int'));
} }
@ -138,7 +138,7 @@ function drupal_notify($server) {
$result = $client->send($message, 5); $result = $client->send($message, 5);
if (!$result || $result->faultCode()) { if (!$result || $result->faultCode()) {
watchdog('error', 'failed to notify "'. $url['host'] .'" at "'. $url['path'] .'": '. $result->faultString()); watchdog('error', t('failed to notify "%url" at "%path": %error', array('%url' => $url["host"], '%path' => $url["path"], '%error' => $result->faultString())));
} }
} }

View File

@ -1422,7 +1422,7 @@ function node_submit($node) {
if (node_access('update', $node)) { if (node_access('update', $node)) {
$node->nid = node_save($node); $node->nid = node_save($node);
watchdog('special', "$node->type: updated '$node->title'", l(t('view post'), "node/view/$node->nid")); watchdog('special', t('%node-type: updated "%node-title"', array('%node-type' => t("$node->type"), '%node-title' => $node->title)), l(t('view post'), "node/view/$node->nid"));
$msg = t('the %name was updated.', array ('%name' => node_invoke($node, 'node_name'))); $msg = t('the %name was updated.', array ('%name' => node_invoke($node, 'node_name')));
} }
} }
@ -1435,7 +1435,7 @@ function node_submit($node) {
if (node_access('create', $node)) { if (node_access('create', $node)) {
$node->nid = node_save($node); $node->nid = node_save($node);
watchdog('special', "$node->type: added '$node->title'", l(t('view post'), "node/view/$node->nid")); watchdog('special', t('%node-type: added "%node-title"', array('%node-type' => t("$node->type"), '%node->title' => $node->title)), l(t('view post'), "node/view/$node->nid"));
$msg = t('your %name was created.', array ('%name' => node_invoke($node, 'node_name'))); $msg = t('your %name was created.', array ('%name' => node_invoke($node, 'node_name')));
} }
} }
@ -1474,7 +1474,7 @@ function node_delete($edit) {
cache_clear_all(); cache_clear_all();
watchdog('special', "$node->type: deleted '$node->title'"); watchdog('special', t('%node-type: deleted "%node-title"', array('%node-type' => t("$node->type"), '%node-title' => $node->title)));
$output = t('The node has been deleted.'); $output = t('The node has been deleted.');
} }
else { else {

View File

@ -1422,7 +1422,7 @@ function node_submit($node) {
if (node_access('update', $node)) { if (node_access('update', $node)) {
$node->nid = node_save($node); $node->nid = node_save($node);
watchdog('special', "$node->type: updated '$node->title'", l(t('view post'), "node/view/$node->nid")); watchdog('special', t('%node-type: updated "%node-title"', array('%node-type' => t("$node->type"), '%node-title' => $node->title)), l(t('view post'), "node/view/$node->nid"));
$msg = t('the %name was updated.', array ('%name' => node_invoke($node, 'node_name'))); $msg = t('the %name was updated.', array ('%name' => node_invoke($node, 'node_name')));
} }
} }
@ -1435,7 +1435,7 @@ function node_submit($node) {
if (node_access('create', $node)) { if (node_access('create', $node)) {
$node->nid = node_save($node); $node->nid = node_save($node);
watchdog('special', "$node->type: added '$node->title'", l(t('view post'), "node/view/$node->nid")); watchdog('special', t('%node-type: added "%node-title"', array('%node-type' => t("$node->type"), '%node->title' => $node->title)), l(t('view post'), "node/view/$node->nid"));
$msg = t('your %name was created.', array ('%name' => node_invoke($node, 'node_name'))); $msg = t('your %name was created.', array ('%name' => node_invoke($node, 'node_name')));
} }
} }
@ -1474,7 +1474,7 @@ function node_delete($edit) {
cache_clear_all(); cache_clear_all();
watchdog('special', "$node->type: deleted '$node->title'"); watchdog('special', t('%node-type: deleted "%node-title"', array('%node-type' => t("$node->type"), '%node-title' => $node->title)));
$output = t('The node has been deleted.'); $output = t('The node has been deleted.');
} }
else { else {

View File

@ -63,7 +63,7 @@ function ping_ping($name = '', $url = '') {
$result = $client->send($message); $result = $client->send($message);
if (!$result || $result->faultCode()) { if (!$result || $result->faultCode()) {
watchdog('error', 'failed to notify "weblogs.com" (site)'); watchdog('error', t('failed to notify "weblogs.com" (site)'));
} }
unset($client); unset($client);
@ -75,7 +75,7 @@ function ping_ping($name = '', $url = '') {
$result = $client->send($message); $result = $client->send($message);
if (!$result || $result->faultCode()) { if (!$result || $result->faultCode()) {
watchdog('error', 'failed to notify "weblogs.com" (RSS)'); watchdog('error', t('failed to notify "weblogs.com" (RSS)'));
} }
unset($client); unset($client);
@ -87,7 +87,7 @@ function ping_ping($name = '', $url = '') {
$result = $client->send($message); $result = $client->send($message);
if (!$result || $result->faultCode()) { if (!$result || $result->faultCode()) {
watchdog('error', 'failed to notify "blo.gs" '); watchdog('error', t('failed to notify "blo.gs"'));
} }
unset($client); unset($client);
@ -99,7 +99,7 @@ function ping_ping($name = '', $url = '') {
$result = $client->send($message); $result = $client->send($message);
if (!$result || $result->faultCode()) { if (!$result || $result->faultCode()) {
watchdog('error', 'failed to notify "technorati.com"'); watchdog('error', t('failed to notify "technorati.com"'));
} }
} }
?> ?>

View File

@ -63,7 +63,7 @@ function ping_ping($name = '', $url = '') {
$result = $client->send($message); $result = $client->send($message);
if (!$result || $result->faultCode()) { if (!$result || $result->faultCode()) {
watchdog('error', 'failed to notify "weblogs.com" (site)'); watchdog('error', t('failed to notify "weblogs.com" (site)'));
} }
unset($client); unset($client);
@ -75,7 +75,7 @@ function ping_ping($name = '', $url = '') {
$result = $client->send($message); $result = $client->send($message);
if (!$result || $result->faultCode()) { if (!$result || $result->faultCode()) {
watchdog('error', 'failed to notify "weblogs.com" (RSS)'); watchdog('error', t('failed to notify "weblogs.com" (RSS)'));
} }
unset($client); unset($client);
@ -87,7 +87,7 @@ function ping_ping($name = '', $url = '') {
$result = $client->send($message); $result = $client->send($message);
if (!$result || $result->faultCode()) { if (!$result || $result->faultCode()) {
watchdog('error', 'failed to notify "blo.gs" '); watchdog('error', t('failed to notify "blo.gs"'));
} }
unset($client); unset($client);
@ -99,7 +99,7 @@ function ping_ping($name = '', $url = '') {
$result = $client->send($message); $result = $client->send($message);
if (!$result || $result->faultCode()) { if (!$result || $result->faultCode()) {
watchdog('error', 'failed to notify "technorati.com"'); watchdog('error', t('failed to notify "technorati.com"'));
} }
} }
?> ?>

View File

@ -73,30 +73,30 @@ function queue_vote($node, $vote) {
$node->moderate = 0; $node->moderate = 0;
$node->promote = 1; $node->promote = 1;
node_save($node); node_save($node);
watchdog("special", "moderation: approved '$node->title'"); watchdog('special', t('moderation: approved "%node-title"', array('%node-title' => $node->title)));
} }
else if (variable_get("queue_threshold_dump", -2) >= $node->score) { else if (variable_get("queue_threshold_dump", -2) >= $node->score) {
if ($node->revisions) { if ($node->revisions) {
node_revision_rollback($node, end(node_revision_list($node))); node_revision_rollback($node, end(node_revision_list($node)));
watchdog("special", "moderation: declined '$node->title' (rollback)"); watchdog('special', t('moderation: declined "%node-title" (rollback)', array('%node-title' => $node->title)));
} }
else { else {
$node->moderate = 0; $node->moderate = 0;
$node->status = 0; $node->status = 0;
node_save($node); node_save($node);
watchdog("special", "moderation: declined '$node->title'"); watchdog('special', t('moderation: declined "%node-title"', array('%node-title' => $node->title)));
} }
} }
else if (variable_get("queue_threshold_expire", 8) <= $node->votes) { else if (variable_get("queue_threshold_expire", 8) <= $node->votes) {
if ($node->revisions) { if ($node->revisions) {
node_revision_rollback($node, end(node_revision_list($node))); node_revision_rollback($node, end(node_revision_list($node)));
watchdog("special", "moderation: expired '$node->title' (rollback)"); watchdog('special', t('moderation: expired "%node-title" (rollback)', array('%node-title' => $node->title)));
} }
else { else {
$node->moderate = 0; $node->moderate = 0;
$node->status = 0; $node->status = 0;
node_save($node); node_save($node);
watchdog("special", "moderation: expired '$node->title'"); watchdog('special', t('moderation: expired "%node-title"', array('%node-title' => $node->title)));
} }
} }
} }

View File

@ -342,7 +342,7 @@ function search_view($keys) {
// Only perform search if there is non-whitespace search term: // Only perform search if there is non-whitespace search term:
if (trim($keys)) { if (trim($keys)) {
// Log the search keys: // Log the search keys:
watchdog("search", "search: '$keys'", l("view results", "search", NULL, "keys=". urlencode($keys))); watchdog('search', t('search: "%keys"', array('%keys' => $keys)), l("view results", "search", NULL, "keys=". urlencode($keys)));
// Collect the search results: // Collect the search results:
$results = search_data($keys); $results = search_data($keys);

View File

@ -342,7 +342,7 @@ function search_view($keys) {
// Only perform search if there is non-whitespace search term: // Only perform search if there is non-whitespace search term:
if (trim($keys)) { if (trim($keys)) {
// Log the search keys: // Log the search keys:
watchdog("search", "search: '$keys'", l("view results", "search", NULL, "keys=". urlencode($keys))); watchdog('search', t('search: "%keys"', array('%keys' => $keys)), l("view results", "search", NULL, "keys=". urlencode($keys)));
// Collect the search results: // Collect the search results:
$results = search_data($keys); $results = search_data($keys);

View File

@ -175,11 +175,11 @@ function _throttle_update($hits) {
// log the change // log the change
if ($throttle_new < $throttle) { if ($throttle_new < $throttle) {
variable_set('throttle_level', $throttle - 1); variable_set('throttle_level', $throttle - 1);
watchdog($type, 'throttle: $hits hits in past minute; throttle decreased to level '. ($throttle - 1)); watchdog($type, t('throttle: %hits hits in past minute; throttle decreased to level %level', array('%hits' => $hits, '%level' => ($throttle - 1))));
} }
if ($throttle_new > $throttle) { if ($throttle_new > $throttle) {
variable_set('throttle_level', $throttle + 1); variable_set('throttle_level', $throttle + 1);
watchdog($type, 'throttle: $hits hits in past minute; throttle increased to level '. ($throttle + 1)); watchdog($type, t('throttle: %hits hits in past minute; throttle increased to level %level', array('%hits' => $hits, '%level' => ($throttle + 1))));
} }
} }

View File

@ -175,11 +175,11 @@ function _throttle_update($hits) {
// log the change // log the change
if ($throttle_new < $throttle) { if ($throttle_new < $throttle) {
variable_set('throttle_level', $throttle - 1); variable_set('throttle_level', $throttle - 1);
watchdog($type, 'throttle: $hits hits in past minute; throttle decreased to level '. ($throttle - 1)); watchdog($type, t('throttle: %hits hits in past minute; throttle decreased to level %level', array('%hits' => $hits, '%level' => ($throttle - 1))));
} }
if ($throttle_new > $throttle) { if ($throttle_new > $throttle) {
variable_set('throttle_level', $throttle + 1); variable_set('throttle_level', $throttle + 1);
watchdog($type, 'throttle: $hits hits in past minute; throttle increased to level '. ($throttle + 1)); watchdog($type, t('throttle: %hits hits in past minute; throttle increased to level %level', array('%hits' => $hits, '%level' => ($throttle + 1))));
} }
} }