You are here

function _i18n_menu_link_localize in Internationalization 7

Localize menu item title and description.

This will be invoked always after _menu_item_localize()

Link properties to manage:

  • title, menu router title
  • link_title, menu link title
  • options.attributes.title, menu link description.
  • localized_options.attributes.title,

See also

_menu_item_localize()

_menu_link_translate()

2 calls to _i18n_menu_link_localize()
i18n_menu_localize_tree in i18n_menu/i18n_menu.module
Localize menu tree.
i18n_menu_translated_menu_link_alter in i18n_menu/i18n_menu.module
Implements hook_translated_menu_link_alter().

File

i18n_menu/i18n_menu.module, line 509
Internationalization (i18n) submodule: Menu translation.

Code

function _i18n_menu_link_localize(&$link, $langcode = NULL) {

  // Only translate title if it has no special callback.
  if (empty($link['title callback']) || $link['title callback'] === 't') {
    $link['title'] = _i18n_menu_link_title($link, $langcode);
  }
  if ($description = _i18n_menu_link_description($link, $langcode)) {
    $link['localized_options']['attributes']['title'] = $description;
  }
}