You are here

function admin_language_translated_menu_link_alter in Administration Language 6

Same name and namespace in other branches
  1. 7 admin_language.module \admin_language_translated_menu_link_alter()

Implementation of hook_translated_menu_link_alter().

File

./admin_language.module, line 54
Makes sure all admin pages are displayed in the preferred language of the administrator.

Code

function admin_language_translated_menu_link_alter(&$item, $map) {

  // we only want to modify the administration menu
  if ($item['menu_name'] != 'admin_menu') {
    return;
  }
  if (variable_get('admin_language_translate_admin_menu', 0)) {
    global $language, $_admin_language;

    // save the current language and activate the administration language...
    $current_language = $language;
    $language = $_admin_language;

    // ...modify the menu item...
    _menu_item_localize($item, $map, TRUE);

    // ...and restore the previous language
    $language = $current_language;
  }
}