Index: includes/menu.inc
===================================================================
RCS file: /cvs/drupal/drupal/includes/menu.inc,v
retrieving revision 1.404
diff -u -r1.404 menu.inc
--- includes/menu.inc	5 Aug 2010 07:56:50 -0000	1.404
+++ includes/menu.inc	8 Aug 2010 20:07:45 -0000
@@ -807,17 +807,22 @@
       return FALSE;
     }
     // menu_tree_check_access() may set this ahead of time for links to nodes.
-    if (!isset($item['access'])) {
+    if (!isset($item['access']) || $item['access']) {
+      // Load the menu objects for the access check and/or localization.
       if (!empty($item['load_functions']) && !_menu_load_objects($item, $map)) {
         // An error occurred loading an object.
         $item['access'] = FALSE;
         return FALSE;
       }
-      _menu_check_access($item, $map);
-    }
-    // For performance, don't localize a link the user can't access.
-    if ($item['access']) {
-      _menu_item_localize($item, $map, TRUE);
+      // Run an access check if one has not already been run.
+      if (!isset($item['access']))
+      {
+        _menu_check_access($item, $map);
+      }
+      // For performance, don't localize a link the user can't access.
+      if ($item['access']) {
+        _menu_item_localize($item, $map, TRUE);
+      }
     }
   }
 
Index: modules/shortcut/shortcut.test
===================================================================
RCS file: /cvs/drupal/drupal/modules/shortcut/shortcut.test,v
retrieving revision 1.5
diff -u -r1.5 shortcut.test
--- modules/shortcut/shortcut.test	5 Aug 2010 23:53:38 -0000	1.5
+++ modules/shortcut/shortcut.test	8 Aug 2010 20:07:45 -0000
@@ -74,7 +74,7 @@
 
   /**
    * Extracts information from shortcut set links.
-   * 
+   *
    * @param object $set
    *   The shortcut set object to extract information from.
    * @param string $key
@@ -121,11 +121,13 @@
     );
 
     // Check that each new shortcut links where it should.
+    // First test with "use default shortcut name" unchecked.
     foreach ($test_cases as $test) {
       $title = $this->randomName(10);
       $form_data = array(
         'shortcut_link[link_title]' => $title,
         'shortcut_link[link_path]'  => $test['path'],
+        'shortcut_link[default_title]' => FALSE,
       );
       $this->drupalPost('admin/config/user-interface/shortcut/' . $set->set_name . '/add-link', $form_data, t('Save'));
       $this->assertResponse(200);
@@ -134,6 +136,22 @@
       $this->assertTrue(in_array($test['path'], $paths), 'Shortcut created: '. $test['path']);
       $this->assertLink($title, 0, 'Shortcut link found on the page.');
     }
+
+    // Now test with "use default shortcut name" checked.
+    foreach ($test_cases as $test) {
+      $title = $this->randomName(10);
+      $form_data = array(
+        'shortcut_link[link_title]' => $title,
+        'shortcut_link[link_path]'  => $test['path'],
+        'shortcut_link[default_title]' => TRUE,
+      );
+      $this->drupalPost('admin/config/user-interface/shortcut/' . $set->set_name . '/add-link', $form_data, t('Save'));
+      $this->assertResponse(200);
+      $saved_set = shortcut_set_load($set->set_name);
+      $paths = $this->getShortcutInformation($saved_set, 'link_path');
+      $this->assertTrue(in_array($test['path'], $paths), 'Shortcut created: '. $test['path']);
+      $this->assertLink(_shortcut_link_default_title($test['path']), 0, 'Shortcut link using its default title found on the page.');
+    }
   }
 
   /**
@@ -283,7 +301,7 @@
    */
   function testShortcutSetRename() {
     $set = $this->set;
-    
+
     $new_title = $this->randomName(10);
     $this->drupalPost('admin/config/user-interface/shortcut/' . $set->set_name . '/edit', array('title' => $new_title), t('Save'));
     $set = shortcut_set_load($set->set_name);
Index: modules/shortcut/shortcut.admin.inc
===================================================================
RCS file: /cvs/drupal/drupal/modules/shortcut/shortcut.admin.inc,v
retrieving revision 1.14
diff -u -r1.14 shortcut.admin.inc
--- modules/shortcut/shortcut.admin.inc	30 Jun 2010 15:12:59 -0000	1.14
+++ modules/shortcut/shortcut.admin.inc	8 Aug 2010 20:07:45 -0000
@@ -273,7 +273,15 @@
   foreach ($shortcut_set->links as $link) {
     $mlid = $link['mlid'];
     $status = $link['hidden'] ? 'disabled' : 'enabled';
-    $form['shortcuts'][$status][$mlid]['name']['#markup'] = l($link['link_title'], $link['link_path']);
+    // Some dynamic shortcut links may have a blank static title.
+    // Use the dynamically generated title in this case.
+    $title = $link['link_title'];
+    if (!$title)
+    {
+      $item = menu_link_load($mlid);
+      $title = $item['title'];
+    }
+    $form['shortcuts'][$status][$mlid]['name']['#markup'] = l($title, $link['link_path']);
     $form['shortcuts'][$status][$mlid]['weight'] = array(
       '#type' => 'weight',
       '#title' => t('Weight'),
@@ -443,6 +451,19 @@
 }
 
 /**
+ * Retrieves the default title for a shortcut link.
+ *
+ * The default title will trigger the menu system to dynamically translate the title.
+ * For example, the "Unapproved comments" menu item will be translated to show the
+ * curent number of unapproved comments in parentheses after the original title.
+ * See _menu_item_localize().
+ */
+function _shortcut_link_default_title($path) {
+  $item = menu_get_item($path);
+  return (string)db_query("SELECT title FROM {menu_router} WHERE path = :path", array(':path' => $item['path']))->fetchField();
+}
+
+/**
  * Helper function for building a form for adding or editing shortcut links.
  *
  * @param $shortcut_link
@@ -460,6 +481,11 @@
     );
   }
 
+  // Check if we are using the default title.
+  // @todo Is there a better way to check for the default title? For example,
+  // if the default title changes, the stored shortcut title will no longer
+  // be recognized as the default title, even though it should be that.
+  $is_default_title = $shortcut_link['link_title'] == _shortcut_link_default_title($shortcut_link['link_path']);
   $form['shortcut_link']['#tree'] = TRUE;
   $form['shortcut_link']['link_title'] = array(
     '#type' => 'textfield',
@@ -467,7 +493,13 @@
     '#description' => t('The name of the shortcut.'),
     '#size' => 40,
     '#maxlength' => 255,
-    '#default_value' => $shortcut_link['link_title'],
+    '#default_value' => $is_default_title ? '' : $shortcut_link['link_title'],
+    '#weight' => 0,
+  );
+  $form['shortcut_link']['default_title'] = array(
+    '#type' => 'checkbox',
+    '#title' => t('Use the default shortcut name.'),
+    '#default_value' => $shortcut_link['link_path'] ? $is_default_title : TRUE,
   );
 
   $form['shortcut_link']['link_path'] = array(
@@ -501,9 +533,19 @@
 }
 
 /**
+ * Assigns a shortcut link a default title if necessary.
+ */
+function _shortcut_link_process_title(&$shortcut_link) {
+  if ($shortcut_link['default_title']) {
+    $shortcut_link['link_title'] = _shortcut_link_default_title($shortcut_link['link_path']);
+  }
+}
+
+/**
  * Submit handler for shortcut_link_edit().
  */
 function shortcut_link_edit_submit($form, &$form_state) {
+  _shortcut_link_process_title($form_state['values']['shortcut_link']);
   $shortcut_link = array_merge($form_state['values']['original_shortcut_link'], $form_state['values']['shortcut_link']);
   menu_link_save($shortcut_link);
   $form_state['redirect'] = 'admin/config/user-interface/shortcut/' . $shortcut_link['menu_name'];
@@ -515,6 +557,7 @@
  */
 function shortcut_link_add_submit($form, &$form_state) {
   // Add the shortcut link to the set.
+  _shortcut_link_process_title($form_state['values']['shortcut_link']);
   $shortcut_set = $form_state['values']['shortcut_set'];
   $shortcut_link = $form_state['values']['shortcut_link'];
   $shortcut_link['menu_name'] = $shortcut_set->set_name;
@@ -739,8 +782,8 @@
  */
 function shortcut_link_add_inline($shortcut_set) {
   if (isset($_REQUEST['token']) && drupal_valid_token($_REQUEST['token'], 'shortcut-add-link') && shortcut_valid_link($_GET['link'])) {
-    $item = menu_get_item($_GET['link']);
-    $title = ($item && $item['title']) ? $item['title'] : $_GET['name'];
+    $title = _shortcut_link_default_title($_GET['link']);
+    $title = $title ? $title : $_GET['name'];
     $link = array(
       'link_title' => $title,
       'link_path' => $_GET['link'],
