Index: pathologic.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/pathologic/pathologic.module,v
retrieving revision 1.13
diff -u -r1.13 pathologic.module
--- pathologic.module	17 Jun 2010 01:41:59 -0000	1.13
+++ pathologic.module	25 Sep 2010 22:58:10 -0000
@@ -110,7 +110,7 @@
 function _pathologic_replace($matches, $absolute) {
   // Build the full URL, then take it apart
   $parts = parse_url('http://example.com/' . urldecode($matches[3]));
-  if ($parts['path'] === '/' | $parts['path'] === '//') {
+  if ($parts['path'] === '/' || $parts['path'] === '//') {
     // '//' will be the case if the original path was just a slash
     $parts['path'] = '<front>';
   }
@@ -118,7 +118,7 @@
     // Trim initial slash off path.
     $parts['path'] = drupal_substr($parts['path'], 1);
   }
-  
+
   // Need to parse the query parts
   if (isset($parts['query'])) {
     parse_str($parts['query'], $qparts);
@@ -130,7 +130,24 @@
   else {
     $qparts = array();
   }
-  return $matches[1] . '="' . url($parts['path'], array('query' => $qparts, 'fragment' => isset($parts['fragment']) ? $parts['fragment'] : NULL, 'absolute' => $absolute)) . '"';
+  
+  // Check if this is a menu item. If yes, we want to try to translate the path.
+  if (menu_get_item($parts['path'])) {
+    global $language;
+  }
+  else {
+    $language = NULL;
+  }
+ 
+  return $matches[1] . '="' . url(
+    $parts['path'],
+    array(
+      'query' => $qparts,
+      'fragment' => isset($parts['fragment']) ? $parts['fragment'] : NULL,
+      'absolute' => $absolute,
+      'language' => $language,
+    )
+  ) . '"';
 }
 
 /**
@@ -141,4 +158,4 @@
   // Apparently the special characters in the preg_replace below need to be
   // double-escaped…?
   return preg_replace(array('/(?<!\\\)\\\\\*/', '/^https?/'), array('[^/]*', 'https?'), preg_quote($path, '~'));
-}
\ No newline at end of file
+}
