summaryrefslogtreecommitdiff
path: root/includes/menu.inc
diff options
context:
space:
mode:
Diffstat (limited to 'includes/menu.inc')
-rw-r--r--includes/menu.inc10
1 files 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') {