I'm trying to configure multilingual "home" breadcrumbs.

Using the latest dev version, I have added the $conf['i18n_variables'] code to settings.php (presumably it's required for Drupal 7). Other threads have suggested that's all there is to it, but the default English "Home" link appears for all languages (and subsequently points to the default English front page). I have examined the settings and configuration pages, but it's not exactly obvious what's required.

Can someone give me a nudge? I'm sure this information would be useful to a great number of people.

Members fund testing for the Drupal project. Drupal Association Learn more


MGN’s picture

Category: bug » support

I haven't started working with i18n in D7 yet so I would appreciate it if someone could look into this.

See also #504400: home reference and i18n for instructions on the way it was done it D6 - though I think this is also in the readme.txt file.

Marking this as a support request because its not specific to custom breadcrumbs. At least we didn't have to make any changes to custom breadcrumbs to use this approach in D6. Perhaps the process has changed in D7 - if so it might be a documentation issue.

LTech’s picture

Is there any way to translate custom breadcrumbs in drupal7? It is really important for my site.

ranx’s picture


setvik’s picture

Status: Active » Needs review
613 bytes

i18n for D7 requires the Variable module for variable translation.

Attached patch defines the needed HOOK_variable_info and supplies it with custom_breadcrumbs_home.

May also want to consider adding a dependency on the variable module as translation won't work without it and that may be confusing to some users setting up a i18n site.

NOTE: Users will also need to go to Configuration -> Multilingual settings -> Variables
and enable the now present "Home breadcrumb text" variable that appears in that list after applying this patch and enabling the variable module.

Once that's done, the variable can be translated on the Custom Breadcrumbs settings screen.

setvik’s picture

Status: Needs review » Needs work

Actually, it would probably be good to do full integration with the variable module and expose all of custom_breadcrumbs' variables to it in hook_variable_info()...

Setting back to needs work.

marktheshark’s picture

Any news on localization of the Home bread crumb in Drupal 7 via the variables?


orenroth’s picture

just go to:

search for the string: "Home" and edit this term with desired translation.

example Hebrew translation screenshots:


gaborpeter’s picture

Thank you very much, patch #4 is confirmed as working perfectly.

sinasalek’s picture

It seems that this patch is already applied, however there is a difference
here is the code currently in the latest version.
Also it doesn't work

 * Implements hook_variable_info().
function custom_breadcrumbs_variable_info($options) {

  $variables['custom_breadcrumb_home'] = array(
    'type' => 'string',
    'title' => t('Homepage breadcrumb', array(), $options),
    'description' => t('Specify the homepage breadcrumb text.', array(), $options),
    'default' => 'Home',
    'required' => TRUE,

  return $variables;
sinasalek’s picture

I added the following line to settings.php and still doesn't work

$conf['i18n_variables'] = array('custom_breadcrumb_home');
jooplaan’s picture

Work around for this could be:

In your themes template.php create a hook_breadcrumb function and do some preg_replace.

function YOUR_THEME_breadcrumb($variables) {
  $breadcrumb = $variables['breadcrumb'];

  // Make the string for Home in custom breadcrumbs translatable.
  if (arg(0) !== 'frontpage') {
    $custom_breadcrumb_home = variable_get('custom_breadcrumb_home', 'Home');
    $string = $breadcrumb[0];
    $pattern = '/' . $custom_breadcrumb_home . '/';
    $replacement = t($custom_breadcrumb_home);
    $breadcrumb[0] = preg_replace($pattern, $replacement, $string);

  $separator = "<span class='separator'>&rarr;</span>";

  if (theme_get_setting('breadcrumb_display') && !empty($breadcrumb) && (count($breadcrumb)>0)) {
    $output = '<h2 class="element-invisible">' . t('You are here') . '</h2>';
    $output .= implode($separator , $breadcrumb);
    if (theme_get_setting('breadcrumb_with_title')) {
      $output .=  $separator . '<span class="title">'. $title .'</span>';
    $output = '<div class="breadcrumb">'. $output .'</div>';
  else $output = '';
  return $output;

masipila’s picture

Issue summary: View changes

In case somebody finds this old thread like I just did. This works in 7.x-2.0-beta1 without any code changes. You can define the "Home" title in different languages as follows:

1. Go to admin/config/regional/i18n/variable
- Enable "Homepage breadcrumb" checkbox

2. Go to admin/config/user-interface/custom-breadcrumbs
- Define the "Home" text for the currently active language
- There is a language switcher on the top of the page. Change the language and define the "Home" text for other languages.