You are here

function _i18n_menu_link_localizable_properties in Internationalization 7

Get localizable properties for menu link checking against the router item.

2 calls to _i18n_menu_link_localizable_properties()
i18n_menu_link::build_properties in i18n_menu/i18n_menu.inc
Get translatable properties.
_i18n_menu_link_is_localizable in i18n_menu/i18n_menu.module
Check whether this link should be localized by i18n_menu.

File

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

Code

function _i18n_menu_link_localizable_properties($link) {
  $props = array();
  $router = !empty($link['router_path']) ? _i18n_menu_get_router($link['router_path']) : NULL;
  if (!empty($link['link_title'])) {

    // If the title callback is 't' and the link title matches the router title
    // it will be localized by core, not by i18n_menu.
    if (!$router || (empty($router['title_callback']) || ($router['title_callback'] != 't' || !empty($link['customized']))) || (empty($router['title']) || $router['title'] != $link['link_title'])) {
      $props[] = 'title';
    }
  }
  if (!empty($link['options']['attributes']['title'])) {

    // If the description matches the router description, it will be localized
    // by core.
    if (!$router || empty($router['description']) || $router['description'] != $link['options']['attributes']['title'] || !empty($link['customized'])) {
      $props[] = 'description';
    }
  }
  return $props;
}