Le dimanche 29 mars 2009 à 16:14:09, Guillaume Lelarge a écrit :
> Le dimanche 29 mars 2009 à 16:06:44, Magnus Hagander a écrit :
> > Guillaume Lelarge wrote:
> > > [...]
> > > This patch enables the use of translated manuals for pgAdmin on the
> > > official website. It simply checks the availability of the displayed
> > > file for the choosen lang and defaults to en_US if it doesn't.
> >
> > Was there supposed to be a patch attached? :-)
>
> Yes, I forgot it.
>
New patch on this mail.
> > > It seems to work on this URL:
> > > http://wwwdevel.pgadmin.org/docs/dev/bugreport.html?lang=fr_FR
> >
> > Um, that link gives me a bunch of PHP error messages. but the messages
> > are in french, so that part worked :-D
>
> Well, it seems a script fetches the new pages from the SVN repo, but gives
> them a 660 rights, for user and group root. So it doesn't seem to be
> readable. The en_US docs are 644, which is way better. But I don't know how
> to change this, I don't think I have the right.
>
In fact, I have the right with sudo. Done, it should be better and all the
french manual is now available on wwwdevel.
--
Guillaume.
http://www.postgresqlfr.org
http://dalibo.com
Index: include/doc.php
===================================================================
--- include/doc.php (révision 7767)
+++ include/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,8 @@
exit();
}
+ $docrawcontent = file_get_contents($docfile);
+
// 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);
--
Sent via pgadmin-hackers mailing list ([email protected])
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgadmin-hackers