I'd like to change the title of a menu item that is defined in a core module (specifically in taxonomy.module). I want to change the "Add term" local task to "Add category". Is there a (right) way to do this without changing it directly in the module? I think I could probably use i18n to solve this issue, but I don't believe this is how i18n is meant to be used, plus that is overkill for changing a single title.

I have tried creating a custom menu item through the menu administration; this does actually change the name but causes two tabs to appear (both with the right title). Disabling the item has no affect, both tabs still appear.

I have also tried redefining the menu item in a custom module (with the proper title), but it this gets overwritten by the menu item defined in the taxonomy module.

Any help is appreciated. Thanks!

Comments

Jody Lynn’s picture

I need to do a similar thing. I think I'm going to try implementing a theme_menu_item_link in template.php and having it doing something like if ($item['title'] == 'old-title') {$item['title'] = 'new-title'; }

--Zivtech--

Jody Lynn’s picture

In my case the local task I wanted to override was called 'Orders' and I changed both its title and description.

function phptemplate_menu_item_link($item, $link_item) {
  if ($item['title'] == 'Orders' && $item['description'] == t('View your order history.')) {
    $item['title'] = 'Credits';
    $item['description'] = t('Buy credits and view your order history.');	
  }
  return l($item['title'], $link_item['path'], !empty($item['description']) ? array('title' => $item['description']) : array(), isset($item['query']) ? $item['query'] : NULL);
}

--Zivtech--

lee20’s picture

It's not pretty but it does the trick and prevents hacking the core. Thanks for the help!

Jody Lynn’s picture

There is a brand new awesome way to override all kinds of strings like this now: http://drupal.org/project/stringoverrides

--Zivtech--