Index: custom_breadcrumbs.admin.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/custom_breadcrumbs/custom_breadcrumbs.admin.inc,v
retrieving revision 1.1.2.1
diff -u -F^function -r1.1.2.1 custom_breadcrumbs.admin.inc
--- custom_breadcrumbs.admin.inc	29 Jan 2008 08:39:23 -0000	1.1.2.1
+++ custom_breadcrumbs.admin.inc	15 Sep 2008 05:15:45 -0000
@@ -4,21 +4,29 @@
 // Lists all current custom breadcrumbs, and provides a link to the edit page.
 function custom_breadcrumbs_page() {
   $breadcrumbs = _custom_breadcrumbs_load_all_breadcrumbs(TRUE);
+  $multilingual = _custom_breadcrumbs_multilingual();
 
-  $header = array(t('Node type'), '');
-
+  $header[] = t('Node type');
+  if ($multilingual) {
+    $header[] = t('Language');
+  }
+  $header[] = t('Operations');
+  
   $rows = array();
   foreach ($breadcrumbs as $breadcrumb) {
     $row = array();
     $row[] = $breadcrumb->node_type . (!empty($breadcrumb->visibility_php) ? t(' with PHP snippet') : '');
-    $row[] =  l(t('edit'), 'admin/build/custom_breadcrumbs/edit/'. $breadcrumb->bid);
+    if ($multilingual) {
+      $row[] = module_invoke('locale', 'language_name', $breadcrumb->language);
+    }
+    $row[] =  l(t('edit'), 'admin/build/custom_breadcrumbs/edit/' . $breadcrumb->bid);
     $rows[] = $row;
   }
   if (count($rows) == 0) {
-    $rows[] = array(array('data' => t('No custom breadcrumbs have been defined.'), 'colspan' => 2));
+    $rows[] = array(array('data' => t('No custom breadcrumbs have been defined.'), 'colspan' => 2 + (int)$multilingual));
   }
 
-  $rows[] = array(array('data' => l(t('Add a new custom breadcrumb'), 'admin/build/custom_breadcrumbs/add'), 'colspan' => 2));
+  $rows[] = array(array('data' => l(t('Add a new custom breadcrumb'), 'admin/build/custom_breadcrumbs/add'), 'colspan' => 2 + (int)$multilingual));
 
   return theme('table', $header, $rows);
 }
@@ -26,6 +34,8 @@ function custom_breadcrumbs_page() {
 
 // Displays an edit form for a custom breadcrumb record.
 function custom_breadcrumbs_form() {
+  $multilingual = _custom_breadcrumbs_multilingual();
+  
   $bid = arg(4);
   if (isset($bid)) {
     $breadcrumb = _custom_breadcrumbs_load_breadcrumb($bid);
@@ -40,6 +50,22 @@ function custom_breadcrumbs_form() {
     $options[$type] = $name;
   }
 
+  if ($multilingual) {
+    $form['language'] = array(
+      '#type' => 'select',
+      '#title' => t('Language'),
+      '#options' => array('' => t('All languages')) + locale_language_list('name'),
+      '#default_value' => '',
+      '#description' => t('A breadcrumb set for a specific language will always be used when displaying a node in that language, and takes precedence over breadcrumbs set for <am>All languages</em>.'),
+    );
+  }
+  else {
+    $form['language'] = array(
+      '#type' => 'value',
+      '#value' => '',
+    );
+  }
+  
   $form['node_type'] = array(
     '#type' => 'select',
     '#title' => t('Node type'),
@@ -125,3 +151,10 @@ function custom_breadcrumbs_form_delete(
   _custom_breadcrumbs_delete_breadcrumb($form_state['values']['bid']);
   $form_state['redirect'] = 'admin/build/custom_breadcrumbs';
 }
+
+/**
+ * Check whether the administration interface should show multilingual features.
+ */
+function _custom_breadcrumbs_multilingual() {
+  return module_exists('locale') || db_result(db_query("SELECT COUNT(*) FROM {custom_breadcrumb} WHERE language != ''"));
+}
Index: custom_breadcrumbs.install
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/custom_breadcrumbs/custom_breadcrumbs.install,v
retrieving revision 1.3
diff -u -F^function -r1.3 custom_breadcrumbs.install
--- custom_breadcrumbs.install	27 Jan 2008 08:30:15 -0000	1.3
+++ custom_breadcrumbs.install	15 Sep 2008 05:16:33 -0000
@@ -45,6 +45,13 @@ function custom_breadcrumbs_schema() {
         'default' => 'AND',
         'description' => t("Node types the {custom_breadcrumb} should apply to."),
       ),
+      'language' => array(
+        'type' => 'varchar',
+        'length' => 12,
+        'not null' => TRUE,
+        'default' => '',
+        'description' => t('The language this breadcrumb is for; if blank, the breadcrumb will be used for unknown languages.'),
+      ),
     ),
     'primary key' => array('bid'),
   );
@@ -106,6 +113,32 @@ function custom_breadcrumbs_update_2() {
   return $ret;
 }
 
+/**
+ * @defgroup updates-6.x Updates for the 6.x versions.
+ * @{
+ */
+
+/**
+ * Add language support to breadcrumbs.
+ */
+function custom_breadcrumbs_update_6000() {
+  $ret = array();
+  switch ($GLOBALS['db_type']) {
+    case 'pgsql':
+      db_add_column($ret, 'custom_breadcrumb', 'language', 'varchar(12)', array('default' => "''", 'not null' => TRUE));
+      break;
+    case 'mysql':
+    case 'mysqli':
+      $ret[] = update_sql("ALTER TABLE {custom_breadcrumb} ADD language varchar(12) NOT NULL default ''");
+      break;
+  }
+  return $ret;
+}
+
+/**
+ * @} End of "defgroup updates-6.x"
+ */
+
 function custom_breadcrumbs_uninstall() {
   drupal_uninstall_schema('custom_breadcrumbs');
 }
Index: custom_breadcrumbs.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/custom_breadcrumbs/custom_breadcrumbs.module,v
retrieving revision 1.6.2.1
diff -u -F^function -r1.6.2.1 custom_breadcrumbs.module
--- custom_breadcrumbs.module	29 Jan 2008 08:39:23 -0000	1.6.2.1
+++ custom_breadcrumbs.module	15 Sep 2008 05:16:51 -0000
@@ -79,9 +79,16 @@ function _custom_breadcrumbs_load_breadc
   return $breadcrumb;
 }
 
+/**
+ * Load the breadcrumb for a given node type.
+ *
+ * Looks for a breadcrumb in the current language. If there's no breadcrumb
+ * defined for that language it will search for one without language.
+ */
 function _custom_breadcrumbs_load_for_type($node) {
-  $sql = "SELECT * FROM {custom_breadcrumb} WHERE node_type = '%s'";
-  $result = db_query($sql, $node->type);
+  global $language;
+  $sql = "SELECT * FROM {custom_breadcrumb} WHERE node_type = '%s' AND language IN ('%s', '') ORDER BY language DESC";
+  $result = db_query($sql, $node->type, $language->language);
   while ($breadcrumb = db_fetch_object($result)) {
     if (!empty($breadcrumb->visibility_php)) {
       // Use PHP code to check the visibility.
