### Eclipse Workspace Patch 1.0 #P taxonomy_blocks Index: taxonomy_blocks.module =================================================================== RCS file: /cvs/drupal-contrib/contributions/modules/taxonomy_blocks/taxonomy_blocks.module,v retrieving revision 1.5 diff -u -r1.5 taxonomy_blocks.module --- taxonomy_blocks.module 18 Dec 2009 17:34:25 -0000 1.5 +++ taxonomy_blocks.module 7 Oct 2010 13:18:27 -0000 @@ -90,11 +90,18 @@ elseif ($op == 'view') { $bits = explode('-', $delta); $vid = $bits[0]; - $index = $bits[1]; + $index = $bits[1]; $vocab = taxonomy_vocabulary_load($vid); + if (module_exists("i18n")) { + $subject = i18nstrings("taxonomy:vocabulary:" . $vid . ":name", $vocab->name); + } + else { + $subject = t($vocab->name); + } + $blocks = array( - 'subject' => $vocab->name . ($index ? " [$index]" : ""), + 'subject' => $subject . ($index ? " [$index]" : ""), 'content' => theme('taxonomy_blocks_block_content', $vid, $index) ); } @@ -103,10 +110,10 @@ /** * Render a list of terms inside a block. - * + * * @param $vid * ID of the rendered vocabulary. - * + * * @return HTML unordered list of terms. */ function theme_taxonomy_blocks_block_content($vid, $index) { @@ -157,8 +164,17 @@ $output .= '
  • '; $path = 'taxonomy/term/' . $term->tid; - - $output .= l(t($term->name), $path); + + if (module_exists("i18n")) { + $term_name = i18nstrings("taxonomy:term:" . $term->tid . ":name", $term->name); + $term_desc = i18nstrings("taxonomy:term:" . $term->tid . ":description", $term->description); + } + else { + $term_name = t($term->name); + $term_desc = t($term->description); + } + + $output .= l($term_name, $path, array('attributes' => array('title' => $term_desc))); if ($show_node_count == 1) { $output .= theme('taxonomy_blocks_node_count', $count); @@ -262,9 +278,9 @@ /** * Theme the count of nodes shown beside a term link. - * + * * @param $count - * + * * @return HTML representation of node count. */ function theme_taxonomy_blocks_node_count($count) {