You are here

function _i18nmenu_get_item_description in Internationalization 6

Optionally insert/update and return a localized menu item description.

3 calls to _i18nmenu_get_item_description()
i18nmenu_localize_tree in i18nmenu/i18nmenu.module
Localize menu tree.
i18nmenu_translated_menu_link_alter in i18nmenu/i18nmenu.module
Implementation of hook_translated_menu_link_alter().
_i18nmenu_update_item in i18nmenu/i18nmenu.module
Update the translation data for a menu item that has been inserted or updated.

File

i18nmenu/i18nmenu.module, line 218
Internationalization (i18n) submodule: Menu translation.

Code

function _i18nmenu_get_item_description($link, $update = FALSE, $langcode = NULL) {
  if (empty($link['options']['attributes']['title'])) {
    return;
  }
  $key = 'menu:item:' . $link['mlid'] . ':description';
  $description = $link['options']['attributes']['title'];
  if ($update) {
    i18nstrings_update($key, $description);
  }
  return i18nstrings($key, $description, $langcode);
}