From 1811d659f26a78d781b42f2579ce93893cf74774 Mon Sep 17 00:00:00 2001 From: Angie Byron Date: Sat, 14 Mar 2009 02:28:05 +0000 Subject: #372914 by chx: Fix link titles when using a non-t() callback. --- includes/menu.inc | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/includes/menu.inc b/includes/menu.inc index 816b535ef..cff3ef5d8 100644 --- a/includes/menu.inc +++ b/includes/menu.inc @@ -536,9 +536,13 @@ function _menu_check_access(&$item, $map) { function _menu_item_localize(&$item, $map, $link_translate = FALSE) { $callback = $item['title_callback']; $item['localized_options'] = $item['options']; - // If we are not doing link translation or if the title matches the - // link title of its router item, localize it. - if (!$link_translate || (!empty($item['title']) && ($item['title'] == $item['link_title']))) { + // If we are translating the title of a menu link, and its title is the same + // as the corresponding router item, then we can use the title information + // from the router. If it's customized, then we need to use the link title + // itself; can't localize. + // If we are translating a router item (tabs, page, breadcrumb), then we + // can always use the information from the router item. + if (!$link_translate || ($item['title'] == $item['link_title'])) { // t() is a special case. Since it is used very close to all the time, // we handle it directly instead of using indirect, slower methods. if ($callback == 't') { -- cgit v1.2.3