From f73610bec64dbc81b8e5031ac6778c5f539cb730 Mon Sep 17 00:00:00 2001 From: Dries Buytaert Date: Tue, 24 Apr 2007 13:53:15 +0000 Subject: - Patch #76588 by Gabor: made log messages translatable. Yay. --- modules/system/system.install | 24 ++++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) (limited to 'modules/system') diff --git a/modules/system/system.install b/modules/system/system.install index ab3bb09ba..334ff08c6 100644 --- a/modules/system/system.install +++ b/modules/system/system.install @@ -2353,7 +2353,7 @@ function system_update_159() { } else { db_query('UPDATE {old_revisions} SET done = 1 WHERE nid = %d', $node->nid); - watchdog('php', "Recovering old revisions for node $node->nid failed.", WATCHDOG_WARNING); + watchdog('php', "Recovering old revisions for node %nid failed.", array('%nid' => $node->nid), WATCHDOG_WARNING); } } } @@ -2583,7 +2583,7 @@ function system_update_169() { $encoding = db_result(db_query('SHOW server_encoding')); if (!in_array(strtolower($encoding), array('unicode', 'utf8'))) { $msg = 'Your PostgreSQL database is set up with the wrong character encoding ('. $encoding .'). It is possible it will not work as expected. It is advised to recreate it with UTF-8/Unicode encoding. More information can be found in the PostgreSQL documentation.'; - watchdog('php', $msg, WATCHDOG_WARNING); + watchdog('php', $msg, array(), WATCHDOG_WARNING); drupal_set_message($msg, 'status'); } } @@ -3777,6 +3777,26 @@ function system_update_6009() { return $ret; } +/** + * Add variable replacement for watchdog messages. + */ +function system_update_6009() { + $ret = array(); + switch ($GLOBALS['db_type']) { + case 'pgsql': + db_add_column($ret, 'watchdog', 'variables', 'text', array('not null' => TRUE)); + break; + case 'mysql': + case 'mysqli': + $ret[] = update_sql("ALTER TABLE {watchdog} ADD variables longtext NOT NULL"); + break; + } + // Ensure we have 'N;' (serialize(NULL)) as the default, so existing + // log messages will not get translated in the new system. + $ret[] = update_sql("UPDATE {watchdog} SET variables = 'N;'"); + return $ret; +} + /** * @} End of "defgroup updates-5.x-to-6.x" * The next series of updates should start at 7000. -- cgit v1.2.3