How can I make my main menu link text dynamic? How can I make my main menu link text dynamic?

My solution:

I tried to use Felix's answer, below, but it would not work for me. Obviously, the method suggested by Felix has worked for others and it is used in core (user.module, for example). However, I was able to conditionally alter my main menu link text at the theme level. I added this to template.php:

/**
 * Conditionally alters preprocess links variables.
 */
function MY_THEME_preprocess_links(&amp;$variables) {
  if (MY_FUNCTION()) {
    if (isset($variables['links']['menu-562 active-trail']['title'])) {
      $variables['links']['menu-562 active-trail']['title'] = 'New blog';
    } elseif (isset($variables['links']['menu-562']['title'])) {
      $variables['links']['menu-562']['title'] = 'New blog';
    }
    if (isset($variables['links']['menu-563 active-trail']['title'])) {
      $variables['links']['menu-563 active-trail']['title'] = 'New notes';
    } elseif (isset($variables['links']['menu-563']['title'])) {
      $variables['links']['menu-563']['title'] = 'New notes';
    }
  }
}
Drupal menu's are cached and this makes it hard to change then on the fly when the page is rendered. It is possible though using the functions aimed at translating menu items: see hook_translated_menu_link_alter.

This hook is called before every menu item is rendered IF it has the property ['options']['alter'] = TRUE.

You can set this property to menu items using hook_menu_link_alter.

Example code would be:

function MY_MODULE_menu_link_alter(&amp;$item) {
    // add in an if statement here to just target the links you want to change on the fly
    $item['options']['alter'] = TRUE;
}

function MY_MODULE_translated_menu_link_alter(&amp;$item, $map) {
    if($item['mlid']==89) {
        // this line is actually to change the link however if you inspect the $item
        // variable then you will be able to see the other property that you can change.
        $item['link_path'] .= 'my-new-path';
    }
}