[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] r2722 - GNUnet-docs/WWW
From: |
durner |
Subject: |
[GNUnet-SVN] r2722 - GNUnet-docs/WWW |
Date: |
Thu, 4 May 2006 08:58:10 -0700 (PDT) |
Author: durner
Date: 2006-05-04 08:58:03 -0700 (Thu, 04 May 2006)
New Revision: 2722
Modified:
GNUnet-docs/WWW/i18nhtml.inc.php
Log:
update
Modified: GNUnet-docs/WWW/i18nhtml.inc.php
===================================================================
--- GNUnet-docs/WWW/i18nhtml.inc.php 2006-05-03 20:12:47 UTC (rev 2721)
+++ GNUnet-docs/WWW/i18nhtml.inc.php 2006-05-04 15:58:03 UTC (rev 2722)
@@ -1,6 +1,6 @@
<?php
/*
- (C) 2003, 2004, 2005 Christian Grothoff and other contributing authors.
+ (C) 2003, 2004, 2005, 2006 Christian Grothoff and other contributing
authors.
This code is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published
@@ -42,9 +42,9 @@
// die('PHP misconfigured. Disable get_magic_quotes.');
// establish default connection to database server
-$connection = @mysql_connect($i18nHTMLsqlServer,
- $i18nHTMLsqlUser,
- $i18nHTMLsqlPass);
+$connection = mysql_connect($i18nHTMLsqlServer,
+ $i18nHTMLsqlUser,
+ $i18nHTMLsqlPass);
if (!$connection) {
die ('Failure connecting to ' . $i18nHTMLsqlServer . ' : ' . mysql_error());
}
@@ -116,7 +116,7 @@
}
// If no language is specified, use english.
if ( (! $lang) || ($lang=="") )
- $lang = "English";
+ $lang = $i18nHTMLsrcLang;
$xlang = $_REQUEST['xlang'];
if ($xlang)
$lang = $xlang;
@@ -192,9 +192,8 @@
. $lang
. "&text=" . urlencode(fix($a))
. "&back=" . urlencode($back)
- . "\" title=\""
- .fix($a)
- ."\">" . $i18nHTMLmarker . "</a>\n";
+ . "\" title=\"" . fix($a)
+ . "\">" . $i18nHTMLmarker . "</a>\n";
} else
return "";
}
@@ -589,7 +588,7 @@
return $a;
}
- if ("English" == $lang) {
+ if ($i18nHTMLsrcLang == $lang) {
// no need to translate english, that's the
// hard-wired source language!
if ($i18nHTMLrecordMode == 2) {
@@ -608,7 +607,8 @@
return $a;
}
// attempt to get translations, ranked for best
- $query = "SELECT translation FROM ".$i18nHTMLsqlPrefix."map WHERE
name=\"$a_sql\" AND lang=\"$lang\" ORDER BY ranking DESC";
+ $query = "SELECT translation FROM " . $i18nHTMLsqlPrefix .
+ "map WHERE name=\"$a_sql\" AND lang=\"$lang\" ORDER BY ranking
DESC";
$result = mysql_query($query, $connection);
$num = 0;
if ($result)
@@ -618,7 +618,8 @@
// either insert untranslated item into pending table or update
// referenced count; count is used to display more used strings
// during mass translation before less common ones.
- $query = "SELECT count FROM ".$i18nHTMLsqlPrefix."pending WHERE
c=\"$a_sql\" AND lang=\"$lang\"";
+ $query = "SELECT count FROM " . $i18nHTMLsqlPrefix .
+ "pending WHERE c=\"$a_sql\" AND lang=\"$lang\"";
$result = mysql_query($query, $connection);
$num = 0;
if ($result)
@@ -627,9 +628,11 @@
if ($num > 0) {
$row = mysql_fetch_array($result);
$count = $row["count"] + 1;
- $query = "UPDATE ".$i18nHTMLsqlPrefix."pending SET count=$count WHERE
c=\"$a_sql\" AND lang=\"$lang\"";
+ $query = "UPDATE " . $i18nHTMLsqlPrefix .
+ "pending SET count=$count WHERE c=\"$a_sql\" AND
lang=\"$lang\"";
} else {
- $query = "INSERT INTO ".$i18nHTMLsqlPrefix."pending VALUES(\"$a_sql\",
\"$lang\", 1)";
+ $query = "INSERT INTO " . $i18nHTMLsqlPrefix .
+ "pending VALUES(\"$a_sql\", \"$lang\", 1)";
}
mysql_query($query, $connection);
@@ -705,7 +708,20 @@
echo extlink_($a, $b);
}
+// create internationalized, external link to
+// $a with description $b and title $c
+function extlink_title_($a, $b) {
+ $ret = "<a href=\"" . $a . "\" title=\"" . TRANSLATE(c$) . "\">" .
TRANSLATE_($b) . "</a>" . translateLink_($b);
+ return $ret;
+}
+// create internationalized, external link to
+// $a with description $b and title $c
+function extlink_title($a, $b, $c) {
+ echo extlink_title_($a, $b, $c);
+}
+
+
// *************************************************
// global, call-once helper functions
// *************************************************
@@ -734,11 +750,13 @@
$mode = "Transitional";
}
if ($type == "XHTML1")
- echo "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 " . $mode . "//EN\"
\"http://www.w3.org/TR/xhtml1/DTD/xhtml1-" . $dtd . ".dtd\">\n";
+ echo "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 " . $mode .
+ "//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-" . $dtd .
".dtd\">\n";
else if ($type == "XHTML1.1")
echo "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.1//EN\"
\"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd\">\n";
else
- echo "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 " . $mode . "//EN\"
\"http://www.w3.org/TR/html4/" . $dtd . ".dtd\">\n";
+ echo "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 " . $mode .
+ "//EN\" \"http://www.w3.org/TR/html4/" . $dtd . ".dtd\">\n";
}
function TITLE($a,$b="") {
@@ -767,10 +785,10 @@
$num = 0;
if ($result)
$num = mysql_numrows($result);
- echo "<a href=\"?xlang=English\">";
- W("English");
+ echo "<a href=\"?xlang=" . $i18nHTMLsrcLang . "\">";
+ W($i18nHTMLsrcLang);
echo "</a>";
- $last = "English";
+ $last = $i18nHTMLsrcLang;
for ($i=0;$i<$num;$i++) {
$row = mysql_fetch_array($result);
$next = $row["lang"];
@@ -794,8 +812,8 @@
global $HTTP_SERVER_VARS;
P();
- echo "Translation engine based on <a
href=\"http://gnunet.org/i18nHTML/\">i18nHTML</a> (C) 2003, 2004, 2005 <a
href=\"http://grothoff.org/christian/\">Christian Grothoff</a>.<br />\n";
- if ( ($xlang) && ($xlang != "English") ) {
+ echo "Translation engine based on <a
href=\"http://gnunet.org/i18nHTML/\">i18nHTML</a> (C) 2003, 2004, 2005, 2006 <a
href=\"http://grothoff.org/christian/\">Christian Grothoff</a>.<br />\n";
+ if ( ($lang) && ($lang != $i18nHTMLsrcLang) ) {
$protocol = "http";
if ($HTTP_SERVER_VARS["HTTPS"] == "on") {
$protocol = "https"; // switch to https
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [GNUnet-SVN] r2722 - GNUnet-docs/WWW,
durner <=