Skip to content
Snippets Groups Projects
Commit 1811d659 authored by Angie Byron's avatar Angie Byron
Browse files

#372914 by chx: Fix link titles when using a non-t() callback.

parent b77475ba
No related branches found
No related tags found
No related merge requests found
......@@ -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') {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment