Index: doc.php
===================================================================
--- doc.php	(révision 7767)
+++ doc.php	(copie de travail)
@@ -25,6 +25,7 @@
       break;
 
     case "dev":
+      $docroot_lang = $_SERVER['DOCUMENT_ROOT'] . "/svnrepo/pgadmin3/docs/".$_SESSION['xPGA']['lang'];
       $docroot = $_SERVER['DOCUMENT_ROOT'] . "/svnrepo/pgadmin3/docs/en_US";
       $docheader = sprintf(_("pgAdmin %s online documentation"), _("Development"));
       break;
@@ -37,11 +38,14 @@
 
   $docpage = $_GET['docpage'];
 
-  $docfile = $docroot . "/" . $docpage;
-  if (file_exists($docfile))
+  if (file_exists($docroot_lang . "/" . $docpage))
   {
-    $docrawcontent = file_get_contents($docfile);  
+    $docfile = $docroot_lang . "/" . $docpage;
   }
+  else if (file_exists($docroot . "/" . $docpage))
+  {
+    $docfile = $docroot . "/" . $docpage;
+  }
   else
   {
     header("HTTP/1.0 404 Not Found");
@@ -49,6 +53,13 @@
     exit();
   }
 
+  $docrawcontent = @file_get_contents($docfile);
+  if (!$docrawcontent)
+  {
+    www_page(_("Document cannot be read"), sprintf("<p>%s</p>", _("The document requested cannot be read!")), false);
+    exit();
+  }
+
   // Check the raw content for a charset. If there is one, convert from it to UTF-8
   if (preg_match('/<meta.*charset=([^"]*)/is', $docrawcontent, $matches) > 0)
     $dociconvcontent = iconv($matches[1], "UTF-8//TRANSLIT", $docrawcontent);
