Index: potx.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/potx/Attic/potx.inc,v
retrieving revision 1.1.2.17.2.7.2.19.2.14
diff -u -p -r1.1.2.17.2.7.2.19.2.14 potx.inc
--- potx.inc	10 Jan 2011 22:40:50 -0000	1.1.2.17.2.7.2.19.2.14
+++ potx.inc	24 Jan 2011 15:51:51 -0000
@@ -219,7 +219,7 @@ function _potx_process_file($file_path, 
       _potx_find_perm_hook($file_name, $name_parts['filename'], $save_callback);
     }
     if ($api_version > POTX_API_5) {
-      _potx_find_menu_hook($file_name, $name_parts['filename'], $save_callback);
+      _potx_find_menu_hooks($file_name, $name_parts['filename'], $save_callback);
     }
   }
 
@@ -1083,32 +1083,57 @@ function _potx_find_context($tf, $ti, $f
  * @param $save_callback
  *   Callback function used to save strings.
  */
-function _potx_find_menu_hook($file, $filebase, $save_callback) {
+function _potx_find_menu_hooks($file, $filebase, $save_callback) {
   global $_potx_tokens, $_potx_lookup;
 
-  if (isset($_potx_lookup[$filebase .'_menu']) && is_array($_potx_lookup[$filebase .'_menu'])) {
-    // We have a menu hook in this file.
-    foreach ($_potx_lookup[$filebase .'_menu'] as $ti) {
-      $end = _potx_find_end_of_function($ti);
-      $tn = $ti;
-      while ($tn < $end) {
-        // Look through the code until the end of the function.
-        if ($_potx_tokens[$tn][0] == T_CONSTANT_ENCAPSED_STRING && in_array($_potx_tokens[$tn][1], array("'title'", '"title"', "'description'", '"description"')) && $_potx_tokens[$tn+1][0] == T_DOUBLE_ARROW) {
-          if ($_potx_tokens[$tn+2][0] == T_CONSTANT_ENCAPSED_STRING) {
-            // Menu items support no context.
-            $save_callback(
-              _potx_format_quoted_string($_potx_tokens[$tn+2][1]),
-              POTX_CONTEXT_NONE,
-              $file,
-              $_potx_tokens[$tn+2][2]
-            );
-            $tn+=2; // Jump forward by 2.
+  $hooks = array('_menu', '_menu_alter');
+  $keys = array("'title'", '"title"', "'description'", '"description"');
+  
+  foreach ($hooks as $hook) {
+    if (isset($_potx_lookup[$filebase . $hook]) && is_array($_potx_lookup[$filebase . $hook])) {
+      // We have this menu hook in this file.
+      foreach ($_potx_lookup[$filebase . $hook] as $ti) {
+        $end = _potx_find_end_of_function($ti);
+        $tn = $ti;
+        while ($tn < $end) {
+
+          // Support for array syntax more commonly used in menu hooks:
+          // $items = array('node/add' => array('title' => 'Add content'));
+          if ($_potx_tokens[$tn][0] == T_CONSTANT_ENCAPSED_STRING && in_array($_potx_tokens[$tn][1], $keys) && $_potx_tokens[$tn+1][0] == T_DOUBLE_ARROW) {
+            if ($_potx_tokens[$tn+2][0] == T_CONSTANT_ENCAPSED_STRING) {
+              // We cannot export menu item context.
+              $save_callback(
+                _potx_format_quoted_string($_potx_tokens[$tn+2][1]),
+                POTX_CONTEXT_NONE,
+                $file,
+                $_potx_tokens[$tn+2][2]
+              );
+              $tn+=2; // Jump forward by 2.
+            }
+            else {
+              potx_status('error', t('Invalid menu %element definition found in %hook. Title and description keys of the menu array should be literal strings.', array('%element' => $_potx_tokens[$tn][1], '%hook' => $filebase . $hook .'()')), $file, $_potx_tokens[$tn][2], NULL, 'http://drupal.org/node/323101');
+            }
           }
-          else {
-            potx_status('error', t('Invalid menu %element definition found in %hook. Title and description keys of the menu array should be literal strings.', array('%element' => $_potx_tokens[$tn][1], '%hook' => $filebase .'_menu()')), $file, $_potx_tokens[$tn][2], NULL, 'http://drupal.org/node/323101');
+          
+          // Support for array syntax more commonly used in menu alters:
+          // $items['node/add']['title'] = 'Add content here';
+          if (is_string($_potx_tokens[$tn]) && $_potx_tokens[$tn] == '[' && $_potx_tokens[$tn+1][0] == T_CONSTANT_ENCAPSED_STRING && in_array($_potx_tokens[$tn+1][1], $keys) && is_string($_potx_tokens[$tn+2]) && $_potx_tokens[$tn+2] == ']') {
+            if (is_string($_potx_tokens[$tn+3]) && $_potx_tokens[$tn+3] == '=' && $_potx_tokens[$tn+4][0] == T_CONSTANT_ENCAPSED_STRING) {
+              // We cannot export menu item context.
+              $save_callback(
+                _potx_format_quoted_string($_potx_tokens[$tn+4][1]),
+                POTX_CONTEXT_NONE,
+                $file,
+                $_potx_tokens[$tn+4][2]
+              );
+              $tn+=4; // Jump forward by 4.
+            }
+            else {
+              potx_status('error', t('Invalid menu %element definition found in %hook. Title and description keys of the menu array should be literal strings.', array('%element' => $_potx_tokens[$tn+1][1], '%hook' => $filebase . $hook .'()')), $file, $_potx_tokens[$tn+1][2], NULL, 'http://drupal.org/node/323101');
+            }
           }
+          $tn++;
         }
-        $tn++;
       }
     }
   }
Index: tests/potx.test
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/potx/tests/Attic/potx.test,v
retrieving revision 1.1.4.6
diff -u -p -r1.1.4.6 potx.test
--- tests/potx.test	15 Feb 2010 10:50:21 -0000	1.1.4.6
+++ tests/potx.test	24 Jan 2011 15:51:51 -0000
@@ -17,10 +17,8 @@ class PotxTestCase extends DrupalWebTest
   }
 
   public function setUp() {
-    // Set up required modules for l10n_community. @todo: figure out why we
-    // need to comment this out to make the tests work. Otherwise we get
-    // "Exception thrown without a stack frame".
-    //parent::setUp('locale', 'potx');
+    // Set up required modules for potx.
+    parent::setUp('locale', 'potx');
 
     // Add potx.inc which we test for its functionality.
     include_once(drupal_get_path('module', 'potx') .'/potx.inc');
@@ -87,6 +85,9 @@ class PotxTestCase extends DrupalWebTest
     $this->assertMsgID('one more test potx permission');
     $this->assertMsgID('1 test string');
     $this->assertPluralID('@count test strings');
+    $this->assertMsgID('Test menu item description');
+    $this->assertMsgID('Test menu item description altered');
+    $this->assertMsgID('Test menu item title altered');
 
     // Installer string should not appear in runtime output.
     $this->assertNoMsgID('Installer only test string');
@@ -135,6 +136,10 @@ class PotxTestCase extends DrupalWebTest
     $this->assertMsgID('1 test string');
     $this->assertPluralID('@count test strings');
 
+    $this->assertMsgID('Test menu item description');
+    $this->assertMsgID('Test menu item description altered');
+    $this->assertMsgID('Test menu item title altered');
+
     $this->assertNoMsgID('Installer only test string');
     $this->assertMsgID('Dynamic callback test string');
 
Index: tests/potx_test_6.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/potx/tests/Attic/potx_test_6.module,v
retrieving revision 1.1.4.3
diff -u -p -r1.1.4.3 potx_test_6.module
--- tests/potx_test_6.module	17 Nov 2009 12:35:09 -0000	1.1.4.3
+++ tests/potx_test_6.module	24 Jan 2011 15:51:51 -0000
@@ -19,9 +19,23 @@ function potx_test_6_menu() {
   $items['translate/test-empty'] = array(
     'title' => '',
   );
+  $items['translate/test-empty']['description'] = 'Test menu item description';
   return $items;
 }
 
+/**
+ * Implementation of hook_menu_alter()
+ */
+function potx_test_6_menu_alter(&$items) {
+  $items['translate/test-empty']['description'] = 'Test menu item description altered';
+  $items['translate/test-empty'] = array_merge(
+    $items['translate/test-empty'],
+    array(
+      'title' => 'Test menu item title altered'
+    )
+  );
+}
+
 function potx_test_6_page() {
   t('This is a test string.');
   format_plural($count, '1 test string', '@count test strings');
Index: tests/potx_test_7.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/potx/tests/Attic/potx_test_7.module,v
retrieving revision 1.1.4.3
diff -u -p -r1.1.4.3 potx_test_7.module
--- tests/potx_test_7.module	17 Nov 2009 12:35:09 -0000	1.1.4.3
+++ tests/potx_test_7.module	24 Jan 2011 15:51:51 -0000
@@ -19,9 +19,23 @@ function potx_test_7_menu() {
   $items['translate/test-empty'] = array(
     'title' => '',
   );
+  $items['translate/test-empty']['description'] = 'Test menu item description';
   return $items;
 }
 
+/**
+ * Implementation of hook_menu_alter()
+ */
+function potx_test_7_menu_alter(&$items) {
+  $items['translate/test-empty']['description'] = 'Test menu item description altered';
+  $items['translate/test-empty'] = array_merge(
+    $items['translate/test-empty'],
+    array(
+      'title' => 'Test menu item title altered'
+    )
+  );
+}
+
 function potx_test_7_page() {
   t('This is a test string.');
   format_plural($count, '1 test string', '@count test strings');
