From dfb3c3aec4f6171b814a4055635937e9d7109ab3 Mon Sep 17 00:00:00 2001 From: Dries Buytaert <dries@buytaert.net> Date: Fri, 15 Oct 2004 05:10:35 +0000 Subject: [PATCH] - Patch #11577 by drumm: changed t('ago') -> t('%time ago', ...) to make it translatable in languages such as Spanish. --- modules/comment.module | 2 +- modules/comment/comment.module | 2 +- modules/taxonomy.module | 8 ++++---- modules/taxonomy/taxonomy.module | 8 ++++---- modules/tracker.module | 2 +- modules/tracker/tracker.module | 2 +- 6 files changed, 12 insertions(+), 12 deletions(-) diff --git a/modules/comment.module b/modules/comment.module index 1fa60180e224..1432ae8194db 100644 --- a/modules/comment.module +++ b/modules/comment.module @@ -161,7 +161,7 @@ function comment_block($op = 'list', $delta = 0) { $result = db_query_range('SELECT * FROM {comments} WHERE status = 0 ORDER BY timestamp DESC', 0, 10); $items = array(); while ($comment = db_fetch_object($result)) { - $items[] = l($comment->subject, "node/$comment->nid", NULL, NULL, "comment-$comment->cid") .'<br />'. format_interval(time() - $comment->timestamp) .' '. t('ago'); + $items[] = l($comment->subject, 'node/'. $comment->nid, NULL, NULL, 'comment-'. $comment->cid) .'<br />'. t('%time ago', array('%time' => format_interval(time() - $comment->timestamp))); } $block['subject'] = t('Recent comments'); diff --git a/modules/comment/comment.module b/modules/comment/comment.module index 1fa60180e224..1432ae8194db 100644 --- a/modules/comment/comment.module +++ b/modules/comment/comment.module @@ -161,7 +161,7 @@ function comment_block($op = 'list', $delta = 0) { $result = db_query_range('SELECT * FROM {comments} WHERE status = 0 ORDER BY timestamp DESC', 0, 10); $items = array(); while ($comment = db_fetch_object($result)) { - $items[] = l($comment->subject, "node/$comment->nid", NULL, NULL, "comment-$comment->cid") .'<br />'. format_interval(time() - $comment->timestamp) .' '. t('ago'); + $items[] = l($comment->subject, 'node/'. $comment->nid, NULL, NULL, 'comment-'. $comment->cid) .'<br />'. t('%time ago', array('%time' => format_interval(time() - $comment->timestamp))); } $block['subject'] = t('Recent comments'); diff --git a/modules/taxonomy.module b/modules/taxonomy.module index f802df531607..91d33f980bb8 100644 --- a/modules/taxonomy.module +++ b/modules/taxonomy.module @@ -106,7 +106,7 @@ function taxonomy_block($op = 'list', $delta = 0) { $result = db_query("SELECT d.tid, d.name, MAX(n.created) AS updated, COUNT(*) AS count FROM {term_data} d INNER JOIN {term_node} USING (tid) INNER JOIN {node} n USING (nid) WHERE n.status = 1 GROUP BY d.tid, d.name ORDER BY updated DESC, d.name"); $items = array(); while ($category = db_fetch_object($result)) { - $items[] = l("$category->name ($category->count)", 'taxonomy/term/'. $category->tid) .'<br />'. format_interval(time() - $category->updated) .' '. t('ago'); + $items[] = l($category->name .' ('. $category->count .')', 'taxonomy/term/'. $category->tid) .'<br />'. t('%time ago', array('%time' => format_interval(time() - $category->updated))); } $block['subject'] = t('Categories'); @@ -309,17 +309,17 @@ function taxonomy_del_term($tid) { } $term = taxonomy_get_term($tid); - + db_query('DELETE FROM {term_data} WHERE tid = %d', $tid); db_query('DELETE FROM {term_hierarchy} WHERE tid = %d', $tid); db_query('DELETE FROM {term_relation} WHERE tid1 = %d OR tid2 = %d', $tid, $tid); db_query('DELETE FROM {term_synonym} WHERE tid = %d', $tid); db_query('DELETE FROM {term_node} WHERE tid = %d', $tid); - + module_invoke_all('taxonomy', 'delete', 'term', $term); drupal_set_message(t('deleted term "%name".', array('%name' => $term->name))); } - + $tids = $orphans; } diff --git a/modules/taxonomy/taxonomy.module b/modules/taxonomy/taxonomy.module index f802df531607..91d33f980bb8 100644 --- a/modules/taxonomy/taxonomy.module +++ b/modules/taxonomy/taxonomy.module @@ -106,7 +106,7 @@ function taxonomy_block($op = 'list', $delta = 0) { $result = db_query("SELECT d.tid, d.name, MAX(n.created) AS updated, COUNT(*) AS count FROM {term_data} d INNER JOIN {term_node} USING (tid) INNER JOIN {node} n USING (nid) WHERE n.status = 1 GROUP BY d.tid, d.name ORDER BY updated DESC, d.name"); $items = array(); while ($category = db_fetch_object($result)) { - $items[] = l("$category->name ($category->count)", 'taxonomy/term/'. $category->tid) .'<br />'. format_interval(time() - $category->updated) .' '. t('ago'); + $items[] = l($category->name .' ('. $category->count .')', 'taxonomy/term/'. $category->tid) .'<br />'. t('%time ago', array('%time' => format_interval(time() - $category->updated))); } $block['subject'] = t('Categories'); @@ -309,17 +309,17 @@ function taxonomy_del_term($tid) { } $term = taxonomy_get_term($tid); - + db_query('DELETE FROM {term_data} WHERE tid = %d', $tid); db_query('DELETE FROM {term_hierarchy} WHERE tid = %d', $tid); db_query('DELETE FROM {term_relation} WHERE tid1 = %d OR tid2 = %d', $tid, $tid); db_query('DELETE FROM {term_synonym} WHERE tid = %d', $tid); db_query('DELETE FROM {term_node} WHERE tid = %d', $tid); - + module_invoke_all('taxonomy', 'delete', 'term', $term); drupal_set_message(t('deleted term "%name".', array('%name' => $term->name))); } - + $tids = $orphans; } diff --git a/modules/tracker.module b/modules/tracker.module index f4ad028ae471..c0a1098bed63 100644 --- a/modules/tracker.module +++ b/modules/tracker.module @@ -90,7 +90,7 @@ function tracker_page($uid = 0) { l($node->title, "node/$node->nid") .' '. (node_is_new($node->nid, $node->changed) ? theme('mark') : ''), format_name($node), array('class' => 'replies', 'data' => $comments), - format_interval(time() - $node->last_post) .' '. t('ago') + t('%time ago', array('%time' => format_interval(time() - $node->last_post))) ); } diff --git a/modules/tracker/tracker.module b/modules/tracker/tracker.module index f4ad028ae471..c0a1098bed63 100644 --- a/modules/tracker/tracker.module +++ b/modules/tracker/tracker.module @@ -90,7 +90,7 @@ function tracker_page($uid = 0) { l($node->title, "node/$node->nid") .' '. (node_is_new($node->nid, $node->changed) ? theme('mark') : ''), format_name($node), array('class' => 'replies', 'data' => $comments), - format_interval(time() - $node->last_post) .' '. t('ago') + t('%time ago', array('%time' => format_interval(time() - $node->last_post))) ); } -- GitLab