Index: i18nblocks/i18nblocks.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/i18n/i18nblocks/i18nblocks.module,v
retrieving revision 1.7.2.17
diff -u -p -r1.7.2.17 i18nblocks.module
--- i18nblocks/i18nblocks.module	29 Aug 2009 21:08:25 -0000	1.7.2.17
+++ i18nblocks/i18nblocks.module	17 Sep 2009 12:14:29 -0000
@@ -151,10 +151,11 @@ function i18nblocks_form_alter(&$form, $
         '#weight' => 0,
       );
       // Language options will depend on block type.
-      $options = array('' => t('All languages'));
-      if ($module == 'block') {
-        $options[I18N_BLOCK_LOCALIZE] = t('All languages (Translatable)');
-      }
+      $options = array('' => t('All languages'));                             
+
+      // allow all blocks to have translatable title - only custom (module == 'block') blocks will generate a translatable content string
+      $options[I18N_BLOCK_LOCALIZE] = t('All languages (Translatable)');
+
       $options += locale_language_list('name');
 
       $form['i18n']['language'] = array(
@@ -180,14 +181,13 @@ function i18nblocks_form_submit($form, &
     // The last insert id will return a different value in mysql
     //$values['delta'] = db_last_insert_id('boxes', 'bid');
     $values['delta'] = db_result(db_query("SELECT MAX(bid) FROM {boxes}"));
-  }
+  }              
   switch ($values['language']) {
     case I18N_BLOCK_LOCALIZE:
       // Translatable block.
-      $values['language'] = '';
+      $values['language'] = '';          
       i18nblocks_save($values);
       break;
-
     case '':
       // No language, delete all i18n information.
       if ($values['ibid']) {
@@ -220,7 +220,7 @@ function i18nblocks_load($module, $delta
  *   Array of block parameters: module, delata, ibid (internal i18nblocks delta).
  */
 function i18nblocks_save($block) {
-  // Update strings for localizable blocks.
+  // Update strings for localizable blocks.    
   if ($block['ibid']) {
     db_query("UPDATE {i18n_blocks} SET language = '%s' WHERE ibid = %d", $block['language'], $block['ibid']);
   }
@@ -231,8 +231,10 @@ function i18nblocks_save($block) {
   if (!$block['language']) {
     // We use ibid property instead of block's delta as block id for strings
     $delta = $block['ibid'];
-    tt("blocks:block:$delta:title", $block['title'], NULL, TRUE);
-    tt("blocks:block:$delta:content", $block['body'], NULL, TRUE);
+    tt("blocks:block:$delta:title", $block['title'], NULL, TRUE);    
+    if($block['module'] == 'block') {
+      tt("blocks:block:$delta:content", $block['body'], NULL, TRUE);      
+    }
   }
 }
 
@@ -259,7 +261,10 @@ function i18nblocks_get_block($delta, $l
     elseif (!empty($block['subject'])) {
       $block['subject'] = tt("blocks:block:$delta:title", $block['subject'], $language);
     }
-    $block['content'] = tt("blocks:block:$delta:content", $block['content'], $language);
+                                                                                          
+    if($meta->module == 'block') {
+      $block['content'] = tt("blocks:block:$delta:content", $block['content'], $language);      
+    }
     return $block;
   }
 }
@@ -272,7 +277,7 @@ function i18nblocks_get_block($delta, $l
  * @param $info
  *   Translation info from i18n
  */
-function i18nblocks_translate_block($block, $info) {
+function i18nblocks_translate_block($block, $info) {       
   // The block id will be i18n's ibid instead of block delta
   $bid = $info->ibid;
   if ($block->title) {
@@ -281,8 +286,11 @@ function i18nblocks_translate_block($blo
   }
   elseif (!empty($block->subject)) {
     $block->subject = tt("blocks:block:$bid:title", $block->subject);
+  }                 
+  
+  if($block->module == 'block') {
+    $block->content = tt("blocks:block:$bid:content", $block->content);
   }
-  $block->content = tt("blocks:block:$bid:content", $block->content);
   return $block;
 }
 
@@ -322,12 +330,7 @@ function i18nblocks_theme_blocks($region
   if ($list = block_list($region)) {
     foreach ($list as $key => $block) {
       // Configurable blocks, may be localizable.
-      if ($block->module == 'block') {
-        if (isset($i18nblocks['block'][$block->delta])) {
-          $block = i18nblocks_translate_block($block, $i18nblocks['block'][$block->delta]);
-        }
-      }
-      elseif ($i18nmenu) {
+      if ($i18nmenu) {
         // Replace menu blocks by their translated version.
         if ($block->module == 'menu') {
           $block->content = i18nmenu_translated_tree($block->delta);
@@ -336,6 +339,12 @@ function i18nblocks_theme_blocks($region
           $block->content = i18nmenu_translated_tree('navigation');
         }
       }
+                                                       
+      // translate titles for all block sources and content for custom blocks
+      if (isset($i18nblocks[$block->module][$block->delta])) {
+        $block = i18nblocks_translate_block($block, $i18nblocks[$block->module][$block->delta]);
+      }
+
       // Finally, render the block using standard theming.
       $output .= theme('block', $block);
     }
@@ -361,7 +370,7 @@ function _i18nblocks_list($langcode = ''
     $result = db_query("SELECT * FROM {i18n_blocks} WHERE language = '%s'", $langcode);
     while ($info = db_fetch_object($result)) {
       $list[$index][$info->module][$info->delta] = $info;
-    }
+    }    
   }
   return $list[$index];
 }
