Translate Drupal block titles

A simple snippet based on theme_block() and t() functions. (Tested on Drupal 5.x, Zen subtheme).

  1. Copy and paste this code into your template.php:

    function zen_block($block) {
    $output = “<div class=\”block block-$block->module\” id=\”block-$block->module-$block->delta\”>\n”;
    $output .= ” <h2 class=\”title\”>”.t($block->subject).”</h2>\n”;
    $output .= ” <div class=\”content\”>$block->content</div>\n”;
    $output .= “</div>\n”;
    return $output;
    }

  2. Go to admin/settings/locale/string/search and search the title to translate from English to your localization language.

0 Responses to “Translate Drupal block titles”



  1. No Comments Yet

Leave a Reply




IE6: Rust in Peace

Blog Stats

  • 105,701 hits
My Bookshelf

Texts double licensed under Creative Commons Attribution - Share Alike license and GNU Free Documentation License. Examples may contain software licensed under GNU General Public License. Images and comments texts aren't necessarily licensed under these terms.