Index: potx.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/potx/Attic/potx.inc,v
retrieving revision 1.1.2.17.2.7.2.11
diff -u -p -r1.1.2.17.2.7.2.11 potx.inc
--- potx.inc	24 Sep 2008 19:08:04 -0000	1.1.2.17.2.7.2.11
+++ potx.inc	25 Sep 2008 06:12:49 -0000
@@ -545,8 +545,10 @@ function _potx_format_quoted_string($str
  *   Function name with which the error was identified
  * @param $ti
  *   Index on the token array
+ * @param $error
+ *   Helpful error message for users.
  */
-function _potx_marker_error($file, $line, $marker, $ti) {
+function _potx_marker_error($file, $line, $marker, $ti, $error) {
   global $_potx_tokens;
   
   $tokens = '';
@@ -568,7 +570,7 @@ function _potx_marker_error($file, $line
     }
     $ti++;
   }
-  potx_status('error', t('Invalid localization code: %marker%tokens', array('%marker' => $marker, '%tokens' => '('. $tokens)), $file, $line);
+  potx_status('error', $error .': '. theme('placeholder', $marker .'('. $tokens) .'.', $file, $line);
 }
 
 /**
@@ -679,7 +681,7 @@ function _potx_find_t_calls($file, $save
         }
         else {
           // $function_name() found, but inside is something which is not a string literal.
-          _potx_marker_error($file, $line, $function_name, $ti);
+          _potx_marker_error($file, $line, $function_name, $ti, t('The first paramter to @function() should be a literal string. There should be no variables, concatenation, constants or other non-literal strings there', array('@function' => $function_name)));
         }
       }
     }
@@ -716,7 +718,7 @@ function _potx_find_watchdog_calls($file
         }
         else {
           // watchdog() found, but inside is something which is not a string literal.
-          _potx_marker_error($file, $line, 'watchdog', $ti);
+          _potx_marker_error($file, $line, 'watchdog', $ti, t('The first two watchdog() parameters should be literal strings. There should be no variables, concatenation, constants or even a t() call there'));
         }
       }
     }
@@ -771,7 +773,7 @@ function _potx_find_format_plural_calls(
         }
         else {
           // format_plural() found, but the parameters are not correct.
-          _potx_marker_error($file, $line, "format_plural", $ti);
+          _potx_marker_error($file, $line, "format_plural", $ti, t('In format_plural(), the singular and plural strings should be literal strings. There should be no variables, concatenation, constants or even a t() call there'));
         }
       }
     }
@@ -817,7 +819,7 @@ function _potx_find_perm_hook($file, $fi
         }
       }
       if (!$count) {
-        potx_status('error', t('Found a hook_perm() implementation, but there were no literally provided permissions to record.'), $file);
+        potx_status('error', t('%hook should have an array of literal string permission names.', array('%hook' => $filebase .'_perm()')), $file);
       }
     }
   }
@@ -881,7 +883,7 @@ function _potx_find_menu_hook($file, $fi
             $tn+=2; // Jump forward by 2.
           }
           else {
-            potx_status('error', t('Invalid menu %element definition found in %hook.', array('%element' => $_potx_tokens[$tn][1], '%hook' => $filebase .'_menu()')), $file, $_potx_tokens[$tn][2]);
+            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]);
           }
         }
         $tn++;
@@ -1102,7 +1104,9 @@ function _potx_parse_js_file($code, $fil
   preg_match_all('~[^\w]Drupal\s*\.\s*(t|formatPlural)\s*\([^)]+\)~s', $code, $faulty_matches, PREG_SET_ORDER);
   if (isset($faulty_matches) && count($faulty_matches)) {
     foreach($faulty_matches as $index => $match) {
-      potx_status('error', t('Invalid localization code: %marker.', array('%marker' => $match[0])), $file);
+      $marker = array('%marker' => $match[0]);
+      $message = ($match[1] == 't') ? t('Drupal.t() calls should have a single literal string as their first parameter: %marker.', $marker) : t('The singular and plural string parameters on Drupal.formatPlural() calls should be literal strings, plural containing a @count placeholder: %marker.', $marker);
+      potx_status('error', $message, $file);
     }
   }
 }
