[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] r816 - doodle-docs/WWW
From: |
grothoff |
Subject: |
[GNUnet-SVN] r816 - doodle-docs/WWW |
Date: |
Wed, 25 May 2005 04:52:31 -0700 (PDT) |
Author: grothoff
Date: 2005-05-25 04:52:28 -0700 (Wed, 25 May 2005)
New Revision: 816
Removed:
doodle-docs/WWW/example.php
doodle-docs/WWW/example2.php
doodle-docs/WWW/update0_1_0.php
doodle-docs/WWW/update0_2_0.php
Log:
del
Deleted: doodle-docs/WWW/example.php
===================================================================
--- doodle-docs/WWW/example.php 2005-05-25 11:47:18 UTC (rev 815)
+++ doodle-docs/WWW/example.php 2005-05-25 11:52:28 UTC (rev 816)
@@ -1,29 +0,0 @@
-<?php
-include("i18nhtml.inc.php");
-DOCTYPE("HTML");
-echo "<html><head>";
-TITLE("Example page");
-echo "</head><body>";
-H1("Some document title");
-W("A sentence to translate.");
-W("A sentence with an argument '%s' that cannot be translated.",
- "foo");
-W("A sentence with two arguments '%s' and '%s' that cannot be translated.",
- ARRAY("foo", "bar"));
-P(); // <p>
-W("A sentence with a %s that CAN be translated.",
- extlink_("http://gnunet.org/i18nHTML/", "link text"));
-W("A %s to another translatable page.",
- intlink_("http://gnunet.org/i18nHTML/index", "link")); // .php is added
automatically!
-BR(); // <br>
-echo W_("A function returning the translation.");
-W("For more functions, look into i18nhtml.inc.");
-
-HR();
-W("And finally put the language selection bar somewhere:");
-generateLanguageBar(); // allow user to select other languages
-P();
-W("Oh, and put the footer to allow the editor mode:");
-generateFooter();
-echo "</body></html>";
-?>
\ No newline at end of file
Deleted: doodle-docs/WWW/example2.php
===================================================================
--- doodle-docs/WWW/example2.php 2005-05-25 11:47:18 UTC (rev 815)
+++ doodle-docs/WWW/example2.php 2005-05-25 11:52:28 UTC (rev 816)
@@ -1,61 +0,0 @@
-<?php
-include("i18nhtml.inc.php"); // do this 1st, add translation support
-DOCTYPE("HTML","Transitional"); // tell the user agent document format
-setTranslateLinkMarker("***"); // make translation marker more visible
-editOnlyUntranslatedText(); // restrict translations to
untranslated strings
-
-echo "<html><head>";
-TITLE("Another Example Page");
-echo "</head><body>";
-
-HR();
-generateLanguageBar(); // allow user to select other languages
-HR();
-
-H1("header1");
-H2("header2");
-H3("header3");
-H2("header2 again");
-H3("yet another sub header");
-H3("and again, I think you get the idea");
-P(); // <p>
-W("A sentence to translate.");
-W("A sentence with an argument '%s' that cannot be translated.",
- "foo");
-W("A sentence with two arguments '%s' and '%s' that cannot be translated.",
- ARRAY("foo", "bar"));
-P(); // <p>
-echo "This is untranslated text\n";
-BR(); // <br>
-echo "another way to translate text, note each W chunk represents a ";
-echo "single translatable chunk so similar to above, but split into ";
-echo "multiple translation chunks.<br>";
-$myvar = W_("A sentence with an argument ");
-$myvar = $myvar . "foo" . W_(" that cannot be translated.");
-echo $myvar;
-P(); // <p>
-echo "here we have text that is translated, but not easily edited";
-echo "unless it happens to match some other text.<br>";
-$myvar = TRANSLATE_("A sentence with an argument ");
-$myvar = $myvar . "foo" . TRANSLATE_(" that is not translatable.");
-echo $myvar;
-W("A sentence with a %s that CAN be translated.",
- extlink_("http://gnunet.org/i18nHTML/", "link text"));
-W("A %s to another translatable page.",
- intlink_("http://gnunet.org/i18nHTML/index", "link")); // .php is added
automatically!
-BR(); // <br>
-echo W_("A function returning the translation.");
-W("For more functions, look into i18nhtml.inc.");
-P();
-
-HR();
-$t = "Notice how we don't have to escape or quote(\") ampersands & nor other";
-$t = $t . "HTML entities. <<<--->>> and such even work. This looks like
&\n";
-W($t);
-HR();
-
-P();
-W("Insert footer to allow entering translation edit mode:");
-generateFooter();
-echo "</body></html>";
-?>
Deleted: doodle-docs/WWW/update0_1_0.php
===================================================================
--- doodle-docs/WWW/update0_1_0.php 2005-05-25 11:47:18 UTC (rev 815)
+++ doodle-docs/WWW/update0_1_0.php 2005-05-25 11:52:28 UTC (rev 816)
@@ -1,50 +0,0 @@
-<?php
-include("i18nhtml.inc");
-?>
-# This script merely generates the SQL statements<br>
-# to do the update. You'll have to run the SQL<br>
-# commands yourself to prevent accidental data loss.<br>
-# <pre>
-<?php
-echo "use $i18nHTMLsqlDB;\n";
-$query = "SELECT * FROM map";
-$result = mysql_query($query, $connection);
-$num = 0;
-$loss = 0;
-if ($result)
- $num = mysql_numrows($result);
-for ($ii=0;$ii<$num;$ii++) {
- $row = mysql_fetch_array($result);
- $la = mysql_real_escape_string($row["lang"]);
- $src = mysql_real_escape_string($row["name"]); // urlencoded
- $dst = $row["translation"]; // possibly urlencoded
- $rank = $row["ranking"];
- $rtrans = mysql_real_escape_string(to_unicode(urldecode($dst)));
- // detect "bad" translations (where conversion failed)
- // if more than 5 values in [0..9] follow => bad conversion
- $txtCnt = count_chars(urldecode($src), 1);
- $tCnt = count_chars($rtrans, 1);
-
- // 3426
- if (! ( ereg("&#[0-9]{6}", $rtrans) ||
- ($txtCnt[ord('%')] != $tCnt[ord('%')]) ||
- ( ( ($la != "Japanese") &&
- ($la != "Traditional chinese") &&
- ($la != "Russian") &&
- ($la != "Ukrainian") &&
- (ereg("&#[0-9]{4}", $rtrans)) ) ) ) ) {
- $dst = mysql_real_escape_string($dst);
- if ($rtrans != $dst) {
- $subquery = "UPDATE map SET translation=\"$rtrans\" WHERE name=\"$src\"
AND lang=\"$la\" AND translation=\"$dst\" AND ranking=$rank;\n";
- echo "$subquery\n";
- }
- } else {
- $subquery = "DELETE FROM map WHERE name=\"$src\" AND lang=\"$la\" AND
translation=\"$dst\" AND ranking=$rank;\n";
- echo "$subquery\n";
- $loss++;
- }
- }
-echo "# Lost $loss out of $num translations.\n";
-?>
-# </pre>
-# end of conversion
Deleted: doodle-docs/WWW/update0_2_0.php
===================================================================
--- doodle-docs/WWW/update0_2_0.php 2005-05-25 11:47:18 UTC (rev 815)
+++ doodle-docs/WWW/update0_2_0.php 2005-05-25 11:52:28 UTC (rev 816)
@@ -1,36 +0,0 @@
-<?php
-include("i18nhtml.inc");
-?>
-# This script merely generates the SQL statements<br>
-# to do the update. You'll have to run the SQL<br>
-# commands yourself to prevent accidental data loss.<br>
-# <pre>
-<?php
-echo "use $i18nHTMLsqlDB;\n";
-$query = "SELECT * FROM map";
-$result = mysql_query($query, $connection);
-$num = 0;
-$loss = 0;
-if ($result)
- $num = mysql_numrows($result);
-for ($ii=0;$ii<$num;$ii++) {
- $row = mysql_fetch_array($result);
- $la = mysql_real_escape_string($row["lang"]);
- $src = $row["name"]; // urlencoded
- $src_sql = mysql_real_escape_string($src);
- $dst_sql = mysql_real_escape_string($row["translation"]);
- $rank = $row["ranking"];
- $rname = fix(urldecode($src));
- $rname_sql = mysql_real_escape_string(fix(urldecode($src)));
- // detect "bad" translations (where conversion failed)
- // if more than 5 values in [0..9] follow => bad conversion
- $txtCnt = count_chars(urldecode($src), 1);
- $tCnt = count_chars($rtrans, 1);
-
- $dst = mysql_real_escape_string($dst);
- $subquery = "UPDATE map SET name=\"$rname_sql\" WHERE name=\"$src_sql\" AND
lang=\"$la\" AND translation=\"$dst_sql\" AND ranking=$rank;\n";
- echo "$subquery";
-}
-?>
-# </pre>
-# end of conversion
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [GNUnet-SVN] r816 - doodle-docs/WWW,
grothoff <=