Index: forum_banishment_vote.php
===================================================================
--- forum_banishment_vote.php	(Revision 24007)
+++ forum_banishment_vote.php	(Arbeitskopie)
@@ -32,59 +32,55 @@
 }
 if (!$logged_in_user->prefs->privilege(S_MODERATOR)) {
     // Can't moderate without being moderator
-    error_page("You are not authorized to banish users.");
+    error_page(tra("You are not authorized to banish users."));
 }    
 
 $userid = get_int('userid');
 $user = BoincUser::lookup_id($userid);
 
-page_head('Banishment Vote');
+page_head(tra("Banishment Vote"));
 
 echo "<form action=\"forum_banishment_vote_action.php?userid=".$userid."\" method=\"POST\">\n";
 echo form_tokens($logged_in_user->authenticator);
 start_table();
-row1("Banishment Vote");
+row1(tra("Banishment Vote"));
 
 if (get_str('action')=="start") {
     if (!$user) {
-        error_page("no user");
+        error_page(tra("No user with this ID found."));
     }
     $x = $user->banished_until;
     if ($x>time()) {
-        error_page("User is already banished");
+        error_page(tra("User is already banished"));
     }
     //display input that selects reason
     echo "<input type=hidden name=action value=start>";
     echo "<input type=\"hidden\" name=\"userid\" value=\"".$userid."\">\n";
-    row1("Are you sure you want to banish ".$user->name."?
-        This will prevent ".$user->name." from posting for chosen time period.<br />
-        It should be done only if ".$user->name."
-        has consistently exhibited trollish behavior.");
+    row1(tra("Are you sure you want to banish %1?<br/>This will prevent %1 from posting for chosen time period.<br/>It should be done only if %1 has consistently exhibited trollish behavior.", $user->name));
     row2("",
-    "Select the reason category, optionally write a longer description of why the user should be banished.");
-    row2("Category",
+    tra("Select the reason category, optionally write a longer description of why the user should be banished."));
+    row2(tra("Category"),
     "<select name=\"category\">
-    <option value=\"1\">Obscene</option>
-    <option value=\"2\">Flame/Hate mail</option>
-    <option value=\"3\">User Request</option>
-    <option value=\"4\">Other</option>
+    <option value=\"1\">".tra("Obscene")."</option>
+    <option value=\"2\">".tra("Flame/Hate mail")."</option>
+    <option value=\"3\">".tra("User Request")."</option>
+    <option value=\"4\">".tra("Other")."</option>
 </select>");
-row2("Reason<br>Mailed if nonempty",
+row2(tra("Reason")."<br>".tra("Mailed if nonempty"),
     "<textarea name=\"reason\" rows=\"10\" cols=\"80\"></textarea>");
 
 row2(
     "",
-    "<input type=\"submit\" name=\"submit\" value=\"Proceed with vote\">"
+    "<input type=\"submit\" name=\"submit\" value=\"".tra("Proceed with vote")."\">"
 );
 } elseif (get_str('action')=="yes") {
     vote_yes($config,$logged_in_user,$user);
 } elseif (get_str('action')=="no") {
     vote_no($config,$logged_in_user,$user);
 } else {
-    error_page( "Unknown action");
+    error_page("Unknown action");
 }
 
-
 end_table();
 
 echo "</form>";
Index: forum_post.php
===================================================================
--- forum_post.php	(Revision 24007)
+++ forum_post.php	(Arbeitskopie)
@@ -37,10 +37,7 @@
 $forum = BoincForum::lookup_id($forumid);
 
 if (!user_can_create_thread($logged_in_user, $forum)) {
-    error_page(
-        "Only project admins may create a thread here.
-        However, you may reply existing threads."
-    );
+    error_page(tra("Only project admins may create a thread here. However, you may reply existing threads."));
 }
 check_post_access($logged_in_user, $forum);
 
@@ -60,9 +57,7 @@
     }
     check_tokens($logged_in_user->authenticator);
     if (!akismet_check($logged_in_user, $content)) {
-        $warning = "Your message was flagged as spam by the Akismet
-            anti-spam system.  Please modify your text and try again.
-        ";
+        $warning = tra("Your message was flagged as spam by the Akismet anti-spam system. Please modify your text and try again.");
         $preview = tra("Preview");
     } else {
         $thread = create_thread(
@@ -72,7 +67,7 @@
     }
 }
 
-page_head('Create new thread','','','', $bbcode_js);
+page_head(tra("Create new thread"),'','','', $bbcode_js);
 show_forum_header($logged_in_user);
 
 if ($warning) {
@@ -107,7 +102,7 @@
 $body_help = "";
 
 if ($content && !$title) {
-    $submit_help = "<br /><font color=\"red\">Remember to add a title</font>";
+    $submit_help = "<br /><font color=\"red\">".tra("Remember to add a title")."</font>";
 }
 
 if ($force_title && $title){
@@ -129,10 +124,10 @@
 }
 
 if (is_news_forum($forum)) {
-    row2("", "<input name=export type=checkbox> Show this item as a Notice in the BOINC Manager<br><span class=note>Do so only for items likely to be of interest to all volunteers</span>");
+    row2("", "<input name=export type=checkbox>".tra("Show this item as a Notice in the BOINC Manager")."<br><span class=note>".tra("Do so only for items likely to be of interest to all volunteers.")."</span>");
 }
 row2("", "<input name=\"add_signature\" value=\"add_it\" ".$enable_signature." type=\"checkbox\"> ".tra("Add my signature to this post"));
-row2("", "<input type=\"submit\" name=\"preview\" value=\"".tra("Preview")."\"> <input type=\"submit\" value=\"OK\">");
+row2("", "<input type=\"submit\" name=\"preview\" value=\"".tra("Preview")."\"> <input type=\"submit\" value=\"".tra("OK")."\">");
 
 
 end_table();
Index: edit_passwd_action.php
===================================================================
--- edit_passwd_action.php	(Revision 24007)
+++ edit_passwd_action.php	(Arbeitskopie)
@@ -30,7 +30,7 @@
 $passwd2 = post_str("passwd2");
 
 if ($passwd != $passwd2) {
-    error_page("New passwords are different");
+    error_page(tra("New passwords are different"));
 }
 
 $config = get_config();
@@ -38,41 +38,35 @@
 if (!$min_passwd_length) $min_passwd_length = 6;
 
 if (!is_ascii($passwd)) {
-    error_page("Passwords may only include ASCII characters.");
+    error_page(tra("Passwords may only include ASCII characters."));
 }
 
 if (strlen($passwd)<$min_passwd_length) {
-    error_page(
-        "New password is too short:
-        minimum password length is $min_passwd_length characters."
-    );
+    error_page(tra("New password is too short: minimum password length is %1 characters.", $min_passwd_length));
 }
 if ($auth) {
     $user = lookup_user_auth($auth);
     if (!$user) {
-        error_page("Invalid account key");
+        error_page(tra("Invalid account key"));
     }
 } else {
     $user = lookup_user_email_addr($email_addr);
     if (!$user) {
-        error_page("No account with that email address was found");
+        error_page(tra("No account with that email address was found"));
     }
     $passwd_hash = md5($old_passwd.$email_addr);
     if ($user->passwd_hash != $passwd_hash) {
-        error_page("Invalid password");
+        error_page(tra("Invalid password"));
     }
 }
 
-page_head("Change password");
+page_head(tra("Change password"));
 $passwd_hash = md5($passwd.$user->email_addr);
 $result = $user->update("passwd_hash='$passwd_hash'");
 if ($result) {
-    echo "Your password has been changed.";
+    echo tra("Your password has been changed.");
 } else {
-    echo "
-        We can't update your password due to a database problem.
-        Please try again later.
-    ";
+    echo tra("We can't update your password due to a database problem. Please try again later.");
 }
 
 page_tail();
Index: login_action.php
===================================================================
--- login_action.php	(Revision 24007)
+++ login_action.php	(Arbeitskopie)
@@ -29,7 +29,7 @@
 
 // check for email/password case
 //
-$email_addr = strtolower(strip_tags(post_str("email_addr", true)));
+$email_addr = strtolower(sanitize_tags(post_str("email_addr", true)));
 $passwd = post_str("passwd", true);
 
 if ($email_addr && $passwd) {
Index: delete_account.php
===================================================================
--- delete_account.php	(Revision 24007)
+++ delete_account.php	(Arbeitskopie)
@@ -54,32 +54,30 @@
 if ($cmd == "delete") {
     $retval = delete_account($user);
     if (!$retval) {
-        error_page("Couldn't delete account");
+        error_page(tra("Couldn't delete account"));
     } else {
-        page_head("Account deleted");
-        echo "
-            Your account has been deleted.
-        ";
+        page_head(tra("Account deleted"));
+        echo tra("Your account has been deleted.");
         page_tail();
     }
 } else {
-    page_head("Confirm delete account");
+    page_head(tra("Confirm delete account"));
     echo "
         <table><tr><td>
-        Deleting your account will remove all of your
-        personal information from our servers,
-        including your profile and message-board posts.
-        No jobs will be issued to any computers attached
-        to this account.
+        ".tra("Deleting your account will remove all of your
+personal information from our servers,
+including your profile and message-board posts.
+No jobs will be issued to any computers attached
+to this account.")."
         <p>
-        <b>This cannot be undone.
-        Once your account has been deleted, you cannot get it back.
+        <b>".tra("This cannot be undone.
+Once your account has been deleted, you cannot get it back.")."
         <p>
-        Are you sure you want to delete your account?</b>
+        ".tra("Are you sure you want to delete your account?")."</b>
         <p>
     ";
-    show_button("delete_account.php?cmd=delete", "Yes", "Delete this account");
-    show_button("index.php", "No", "Do not delete this account");
+    show_button("delete_account.php?cmd=delete", tra("Yes"), tra("Delete this account"));
+    show_button("index.php", tra("No"), tra("Do not delete this account"));
     echo "</td></tr></table>\n";
 
     page_tail();
Index: delete_profile.php
===================================================================
--- delete_profile.php	(Revision 24007)
+++ delete_profile.php	(Arbeitskopie)
@@ -20,41 +20,39 @@
 require_once("../inc/util.inc");
 require_once("../inc/profile.inc");
 
-check_get_args(array("delete"));
+check_get_args(array("cmd"));
 
 $user = get_logged_in_user();
 
-if (isset($_POST['delete']) && $_POST['delete']) {
+$cmd = get_str("cmd", true);
+
+if ($cmd == "delete") {
     $result = delete_profile($user);
     if (!$result) {
-        error_page("couldn't delete profile - please try again later");
+        error_page(tra("couldn't delete profile - please try again later"));
     }
     delete_user_pictures($user->id);
-    page_head("Delete Confirmation");
+    page_head(tra("Delete Confirmation"));
     $user->update("has_profile=0");
-    echo "Your profile has been deleted<br>";
+    echo tra("Your profile has been deleted.")."<br>";
     page_tail();
     exit();
 }
 
-page_head("Profile delete confirmation");
+page_head(tra("Profile delete confirmation"));
 
-echo "<form action=", $_SERVER['PHP_SELF'], " method=\"POST\">";
-
 echo "
-    <h2>Are you sure?</h2><p>
-    Deleted profiles are gone forever and cannot be recovered --
-    you will have to start from scratch
-    if you want another profile in the future.
+    <h2>".tra("Are you sure?")."</h2><p>
+    ".tra("Deleted profiles are gone forever and cannot be recovered --
+you will have to start from scratch
+if you want another profile in the future.")."
     <p>
-    If you're sure, click 'Delete'
-    to remove your profile from our database.
-
+    ".tra("If you're sure, click 'Delete'
+to remove your profile from our database.")."
     <p>
-    <input type=submit name=delete value=Delete>
-    </form>
 ";
-
+    show_button("delete_profile.php?cmd=delete", tra("Yes"), tra("Delete my profile"));
+    show_button("index.php", tra("No"), tra("Do not delete my profile"));
 page_tail();
 
 ?>
Index: ffmail_action.php
===================================================================
--- ffmail_action.php	(Revision 24007)
+++ ffmail_action.php	(Arbeitskopie)
@@ -19,6 +19,13 @@
 require_once("../project/project.inc");
 require_once("../inc/email.inc");
 
+$array_get_args = array("preview", "uname", "uemail", "comment", "action");
+for ($i=0; $i<5; $i++) {
+    $array_get_args[]= "n$i";
+    $array_get_args[]= "e$i";
+}
+check_get_args($array_get_args);
+
 function replace($toname, $comment, $fromname, $template) {
     $pat = array(
         '/<toname\/>/',
@@ -44,8 +51,8 @@
 
 $action = get_str('action');
 if ($action=='Preview') {
-    page_head('Email preview');
-    echo "Your email will appear as follows:
+    page_head(tra("Email preview"));
+    echo tra("Your email will appear as follows:")."
         <hr>
     ";
     echo replace("[Friend's name]", $comment, $uname, $html);
@@ -54,13 +61,13 @@
 
     echo "
         <hr>
-        <b><a href=ffmail_action.php$args>Send email</a></b>
+        <b><a href=ffmail_action.php$args>".tra("Send email")."</a></b>
         <p>
-        [Use your browser's back button to return to message form]
+        [".tra("Use your browser's back button to return to message form")."]
     ";
     page_tail();
 } else {
-    page_head("Sending emails");
+    page_head(tra("Sending emails"));
     $found = false;
     for ($i=0; $i<5; $i++) {
         $n = get_str("n$i", true);
@@ -81,23 +88,17 @@
             $mail->Host = $PHPMAILER_HOST;
             $mail->Mailer = $PHPMAILER_MAILER;
             if ($mail->Send()) {
-                echo "<br>email sent successfully to $e\n";
+                echo "<br>".tra("email sent successfully to %1", $e)."\n";
             } else {
-                echo "<br>failed to send email to $e: $mail->ErrorInfo\n";
+                echo "<br>".tra("failed to send email to %1: %2", $e, $mail->ErrorInfo)."\n";
             }
         }
     }
     if ($found) {
         echo "
-            <p>
-            Thanks for telling your friends about ".PROJECT.".
-        ";
+            <p>".tra("Thanks for telling your friends about %1", PROJECT);
     } else {
-        echo "
-            You forgot to enter your friends' names and/or email addresses;
-            Please <a href=ffmail_form.php>return to the form</a>
-            and enter them.
-        ";
+        echo tra("You forgot to enter your friends' names and/or email addresses; Please %1return to the form%2 and enter them.", "<a href=ffmail_form.php>", "</a>");
     }
     page_tail();
 }
Index: donations.php
===================================================================
--- donations.php	(Revision 24007)
+++ donations.php	(Arbeitskopie)
@@ -21,7 +21,7 @@
 check_get_args(array());
 
 if (!defined("PAYPAL_ADDRESS")) {
-    error_page("This project is not accepting donations.");
+    error_page(tra("This project is not accepting donations."));
 }
 
 db_init();
@@ -31,15 +31,15 @@
     $user_id = $logged_in_user->id;
 }
 
-page_head(PROJECT." donations");
+page_head(tra("%1 donations", PROJECT));
 
 if (function_exists("donations_intro")) {
     donations_intro();
 } else {
-    echo "<div>This project is accepting donations via
-        <a href=\"http://www.paypal.com/\">PayPal</a>.</div>
+    echo "<div>".tra("This project is accepting donations via
+%1.", "<a href=\"http://www.paypal.com/\">PayPal</a>")."</div>
         <div class=\"smalltext\">
-        To donate, fill in the amount you want to donate using the field below.
+        ".tra("To donate, fill in the amount you want to donate using the field below.
         PayPal is accepting multiple currencies
         (Canadian Dollars, Euros, Pounds Sterling, U.S. Dollars,
          Yen, Australian Dollars, New Zealand Dollars,
@@ -49,7 +49,7 @@
         You can use included currency converter
         to see the donation amount equivalent in different currencies
         (please note that the rates are only estimates
-         and the actual amount may differ).</div>
+         and the actual amount may differ).")."</div>
     ";
 }
 
@@ -313,19 +313,20 @@
 $estimated .= "</select>\n";
 $estimated .= "<input name=\"outV\" value=\"0.00\" style=\"text-align: right; width: 80px;\" disabled=\"disabled\">\n";
 
-echo row2("Amount you would like to donate", $amount);
-echo row2("Estimated value in", $estimated);
+echo row2(tra("Amount you would like to donate"), $amount);
+echo row2(tra("Estimated value in"), $estimated);
 if ($user_id) {
-    echo row2("Anonymous donation<br><span class=\"smalltext\">Select this if you dont want your name and account number displayed in
-        donator lists.<br>If not checked, you will be recorded as user ID ".$user_id." (".$logged_in_user->name.")</span>",
-        "<input type=\"checkbox\" name=\"anonymous\" id=\"anonymous\" value=\"1\"><label for=\"anonymous\">Yes</label>");
+    $tmp_user_name = $user_id." (".$logged_in_user->name.")";
+    echo row2(tra("Anonymous donation")."<br><span class=\"smalltext\">".tra("Select this if you dont want your name and account number displayed in
+donator lists.<br>If not checked, you will be recorded as user ID %1", $tmp_user_name)."</span>",
+        "<input type=\"checkbox\" name=\"anonymous\" id=\"anonymous\" value=\"1\"><label for=\"anonymous\">".tra("Yes")."</label>");
 } else {
-    echo row2("Anonymous donation<br><span class=\"smalltext\">To assign the donation with your user ID, please log in.",
+    echo row2(tra("Anonymous donation")."<br><span class=\"smalltext\">".tra("To assign the donation with your user ID, please log in."),
         "<input type=\"checkbox\" name=\"anonymous\" id=\"anonymous\" value=\"1\" checked=\"checked\" disabled=\"disabled\">
-        <label for=\"anonymous\">Yes</label>");
+        <label for=\"anonymous\">".tra("Yes")."</label>");
 }
-echo row2("", "<input type=\"submit\" value=\"Proceed\">");
-echo row1("Donations are accepted through<br><img src=\"img/paypal_logo.png\" alt=\"PayPal\">");
+echo row2("", "<input type=\"submit\" value=\"".tra("Proceed")."\">");
+echo row1(tra("Donations are accepted through")."<br><img src=\"img/paypal_logo.png\" alt=\"PayPal\">");
 end_table();
 echo "</form>\n";
 
Index: host_delete.php
===================================================================
--- host_delete.php	(Revision 24007)
+++ host_delete.php	(Arbeitskopie)
@@ -28,24 +28,18 @@
 $hostid = get_int("hostid");
 $host = BoincHost::lookup_id($hostid);
 if (!$host || $host->userid != $user->id) {
-    error_page("We have no record of that computer.");
+    error_page(tra("We have no record of that computer."));
 }
 
 $nresults = host_nresults($host);
 if ($nresults == 0) {
     $host->delete();
 } else {
-    error_page(
-        "You can not delete our record of this computer because our
-        database still contains work for it.
-        You must wait a few days until the work for this computer
-        has been deleted from the project database."
-    );
+    error_page(tra("You can not delete our record of this computer because our database still contains work for it. You must wait a few days until the work for this computer has been deleted from the project database."));
 }
-page_head("Delete record of computer");
-echo "
-    Record deleted.
-    <p><a href=hosts_user.php>Return to list of your computers</a>
+page_head(tra("Delete record of computer"));
+echo tra("Record deleted.")."
+    <p><a href=hosts_user.php>".tra("Return to list of your computers")."</a>
 ";
 page_tail();
 
Index: forum_moderate_thread.php
===================================================================
--- forum_moderate_thread.php	(Revision 24007)
+++ forum_moderate_thread.php	(Arbeitskopie)
@@ -24,16 +24,16 @@
 BoincForumPrefs::lookup($logged_in_user);
 
 if (!get_str('action')) {
-    error_page("no action");
+    error_page("unknown action");
 }
 $thread = BoincThread::lookup_id(get_int('thread'));
 $forum = BoincForum::lookup_id($thread->forum);
         
 if (!is_moderator($logged_in_user, $forum)) {
-    error_page("not authorized");
+    error_page(tra("not authorized"));
 }
 
-page_head("Moderate thread '$thread->title'");
+page_head(tra("Moderate thread '%1'", $thread->title));
 
 echo "<form action=forum_moderate_thread_action.php?thread=$thread->id method=POST>\n";
 echo form_tokens($logged_in_user->authenticator);
@@ -45,14 +45,14 @@
 case 'lock':
     echo "<input type=hidden name=action value=$action>";
     row2("",
-        "Select the reason category, or write a longer description of why you're hiding or locking the thread; then press OK."
+        tra("Select the reason category, or write a longer description of why you're hiding or locking the thread; then press OK.")
     );
-    row2("Category",
+    row2(tra("Category"),
         "<select name=\"category\">
-        <option value=\"1\">Obscene</option>
-        <option value=\"2\">Flame/Hate mail</option>
-        <option value=\"3\">Commercial spam</option>
-        <option value=\"4\">Other</option>
+        <option value=\"1\">".tra("Obscene")."</option>
+        <option value=\"2\">".tra("Flame/Hate mail")."</option>
+        <option value=\"3\">".tra("Commercial spam")."</option>
+        <option value=\"4\">".tra("Other")."</option>
         </select>"
     );
     break;
@@ -69,12 +69,12 @@
     }  
     $selectbox .= '</option>';  
     
-    row2("Current forum", $forum->title);
-    row2("Destination forum", $selectbox);  
+    row2(tra("Current forum"), $forum->title);
+    row2(tra("Destination forum"), $selectbox);  
     break;
 case 'title':
     echo "<input type=hidden name=action value=title>";
-    row2("New title:",
+    row2(tra("New title:"),
         "<input size=80 name=\"newtitle\" value=\"".htmlspecialchars($thread->title)."\">"
     );
     break;
@@ -82,13 +82,13 @@
     error_page("Unknown action");
 }
 
-row2("Reason<br><span class=note>Mailed if nonempty</span>",
+row2(tra("Reason")."<br><span class=note>".tra("Mailed if nonempty")."</span>",
     "<textarea rows=10 cols=80 name=\"reason\"></textarea>"
 );
 
 row2(
     "",
-    "<input type=\"submit\" name=\"submit\" value=\"OK\">"
+    "<input type=\"submit\" name=\"submit\" value=\"".tra("OK")."\">"
 );
 
 end_table();
Index: explain_state.php
===================================================================
--- explain_state.php	(Revision 24007)
+++ explain_state.php	(Arbeitskopie)
@@ -24,113 +24,100 @@
 
 switch($field) {
 case "result_server_state":
-    page_head("Server states");
+    page_head(tra("Server states"));
     echo "
         <p>
-        A tasks's <b>server state</b> indicates
-        whether the task has been sent to a computer,
-        and if so whether the computer has finished it.
-        Possible values are:
+        ".tra("A tasks's <b>server state</b> indicates whether the task has been sent to a computer, and if so whether the computer has finished it. Possible values are:")."
         <p>
     ";
     start_table();
-    row2_plain("<b>Inactive</b>",
-        "The task is not ready to send
-        (for example, because its input files are unavailable)"
+    row2_plain("<b>".tra("Inactive")."</b>",
+        tra("The task is not ready to send (for example, because its input files are unavailable)")
     );
-    row2_plain("<b>Unsent</b>",
-        "The task is ready to send, but hasn't been sent yet."
+    row2_plain("<b>".tra("Unsent")."</b>",
+        tra("The task is ready to send, but hasn't been sent yet.")
     );
-    row2_plain("<b>In Progress</b>",
-        "The task has been sent; waiting for completion."
+    row2_plain("<b>".tra("In Progress")."</b>",
+        tra("The task has been sent; waiting for completion.")
     );
-    row2_plain("<b>Over</b>",
-        "The task has been sent to a computer and either
-        it has timed out or the computer has reported its completion."
+    row2_plain("<b>".tra("Over")."</b>",
+        tra("The task has been sent to a computer and either it has timed out or the computer has reported its completion.")
     );
     break;
 
 case "result_outcome":
-    page_head("Outcomes");
+    page_head(tra("Outcomes"));
     echo "
         <p>
-        A tasks's <b>outcome</b> is defined if its server state is <b>over</b>.
-        Possible values are:
+        ".tra("A tasks's <b>outcome</b> is defined if its server state is <b>over</b>. Possible values are:")."
         <p>
     ";
     start_table();
-    row2_plain("<b>Unknown</b>",
-        "The task was sent to a computer, but the computer has not
-        yet completed the work and reported the outcome."
+    row2_plain("<b>".tra("Unknown")."</b>",
+        tra("The task was sent to a computer, but the computer has not yet completed the work and reported the outcome.")
     );
-    row2_plain("<b>Success</b>",
-        "A computer completed and reported the task successfully."
+    row2_plain("<b>".tra("Success")."</b>",
+        tra("A computer completed and reported the task successfully.")
     );
-    row2_plain("<b>Couldn't send</b>",
-        "The server wasn't able to send the task to a computer
-        (perhaps because its resource requirements were too large)"
+    row2_plain("<b>".tra("Couldn't send")."</b>",
+        tra("The server wasn't able to send the task to a computer (perhaps because its resource requirements were too large)")
     );
-    row2_plain("<b>Client error</b>",
-        "The task was sent to a computer and an error occurred."
+    row2_plain("<b>".tra("Client error")."</b>",
+        tra("The task was sent to a computer and an error occurred.")
     );
-    row2_plain("<b>No reply</b>",
-        "The task was sent to a computer
-        and no reply was received within the time limit."
+    row2_plain("<b>".tra("No reply")."</b>",
+        tra("The task was sent to a computer and no reply was received within the time limit.")
     );
-    row2_plain("<b>Didn't need</b>",
-        "The task wasn't sent to a computer because
-        enough other tasks were completed for this workunit."
+    row2_plain("<b>".tra("Didn't need")."</b>",
+        tra("The task wasn't sent to a computer because enough other tasks were completed for this workunit.")
     );
-    row2_plain("<b>Validate error</b>",
-        "The task was reported but could not be validated,
-        typically because the output files were lost on the server."
+    row2_plain("<b>".tra("Validate error")."</b>",
+        tra("The task was reported but could not be validated, typically because the output files were lost on the server.")
     );
     break;
 
 case "result_client_state":
-    page_head("Client states");
-    echo "<p>A result's <b>client state</b>
-        indicates the stage of processing at which an error occurred.
+    page_head(tra("Client states"));
+    echo "<p>".tra("A result's <b>client state</b> indicates the stage of processing at which an error occurred.")."
         <p>
     ";
     start_table();
-    row2_plain("<b>New</b>",
-        "The computer has not yet completed the task."
+    row2_plain("<b>".tra("New")."</b>",
+        tra("The computer has not yet completed the task.")
     );
-    row2_plain("<b>Done</b>",
-        "The computer completed the task successfully."
+    row2_plain("<b>".tra("Done")."</b>",
+        tra("The computer completed the task successfully.")
     );
-    row2_plain("<b>Downloading</b>",
-        "The computer couldn't download the application or input files."
+    row2_plain("<b>".tra("Downloading")."</b>",
+        tra("The computer couldn't download the application or input files.")
     );
-    row2_plain("<b>Computing</b>",
-        "An error occurred during computation."
+    row2_plain("<b>".tra("Computing")."</b>",
+        tra("An error occurred during computation.")
     );
-    row2_plain("<b>Uploading</b>",
-        "The computer couldn't upload the output files."
+    row2_plain("<b>".tra("Uploading")."</b>",
+        tra("The computer couldn't upload the output files.")
     );
     break;
 
 case "result_time":
-    page_head("Time reported and deadline");
+    page_head(tra("Time reported and deadline"));
     echo "
         <p>
-        A task's <b>Time reported or deadline</b> field depends
-        on whether the task has been reported yet:
+        ".tra("A task's <b>Time reported or deadline</b> field depends on whether the task has been reported yet:")."
         <p>
     ";
     start_table();
-    row2("Already reported", "The date/time it was reported");
-    row2("Not reported yet, deadline in the future",
-        "Deadline, shown in green."
+    row2(tra("Already reported"), tra("The date/time it was reported"));
+    row2(tra("Not reported yet, deadline in the future"),
+        tra("Deadline, shown in green.")
     );
-    row2("Not reported yet, deadline in the past",
-        "Deadline, shown in red."
+    row2(tra("Not reported yet, deadline in the past"),
+        tra("Deadline, shown in red.")
     );
     break;
 
 default:
-    page_head("Unknown field");
+    page_head(tra("Unknown field"));
 }
 
 end_table();
Index: create_account_action.php
===================================================================
--- create_account_action.php	(Revision 24007)
+++ create_account_action.php	(Arbeitskopie)
@@ -23,21 +23,21 @@
 include_once("../inc/recaptchalib.php");
 
 function show_error($str) {
-    page_head("Can't create account");
+    page_head(tra("Can't create account"));
     echo "$str<br>\n";
     echo BoincDb::error();
-    echo "<p>Click your browser's <b>Back</b> button to try again.\n<p>\n";
+    echo "<p>".tra("Click your browser's <b>Back</b> button to try again.")."\n</p>\n";
     page_tail();
     exit();
 }
 
 $config = get_config();
 if (parse_bool($config, "disable_account_creation")) {
-    page_head("Account creation is disabled");
+    page_head(tra("Account creation is disabled"));
     echo "
-        <h3>Account creation is disabled</h3>
-        Sorry, this project has disabled the creation of new accounts.
-        Please try again later.
+        <h3>".tra("Account creation is disabled")."</h3>
+        ".tra("Sorry, this project has disabled the creation of new accounts.
+Please try again later.")."
     ";
     exit();
 }
@@ -48,7 +48,7 @@
           $_POST["recaptcha_challenge_field"], $_POST["recaptcha_response_field"]
       );
       if (!$resp->is_valid) {
-          echo "" . tra("Your reCAPTCHA response was not correct. Please try again."). "";
+          echo tra("Your reCAPTCHA response was not correct. Please try again.");
           return;
       }
   }
@@ -61,8 +61,7 @@
     $team = lookup_team($teamid);
     $clone_user = lookup_user_id($team->userid);
     if (!$clone_user) {
-        echo "User $userid not found";
-        exit();
+        error_page("User $userid not found");
     }
     $project_prefs = $clone_user->project_prefs;
 } else {
@@ -82,42 +81,37 @@
 
 $new_name = post_str("new_name");
 if (strlen($new_name)==0) {
-    show_error("You must supply a name for your account");
+    show_error(tra("You must supply a name for your account"));
 }
-if ($new_name != strip_tags($new_name)) {
-    show_error("HTML tags not allowed in name");
+if ($new_name != sanitize_tags($new_name)) {
+    show_error(tra("HTML tags not allowed in name"));
 }
 
-$new_email_addr = post_str("new_email_addr");
-$new_email_addr = strtolower($new_email_addr);
+$new_email_addr = strtolower(post_str("new_email_addr"));
 if (!is_valid_email_addr($new_email_addr)) {
-    show_error("Invalid email address:
-        you must enter a valid address of the form
-        name@domain"
-    );
+    show_error(tra("Invalid email address: you must enter a valid address of the form name@domain"));
 }
 $user = lookup_user_email_addr($new_email_addr);
 if ($user) {
-    show_error("There's already an account with that email address.");
+    show_error(tra("There's already an account with that email address."));
 }
 
 $passwd = post_str("passwd");
 $passwd2 = post_str("passwd2");
 if ($passwd != $passwd2) {
-    show_error("New passwords are different");
+    show_error(tra("New passwords are different"));
 }
 
 $min_passwd_length = parse_config($config, "<min_passwd_length>");
 if (!$min_passwd_length) $min_passwd_length = 6;
 
 if (!is_ascii($passwd)) {
-    show_error("Passwords may only include ASCII characters.");
+    show_error(tra("Passwords may only include ASCII characters."));
 }
 
 if (strlen($passwd)<$min_passwd_length) {
     show_error(
-        "New password is too short:
-        minimum password length is $min_passwd_length characters."
+        tra("New password is too short: minimum password length is %1 characters.", $min_passwd_length)
     );
 }
 
@@ -128,18 +122,17 @@
     $country = "International";
 }
 if (!is_valid_country($country)) {
-    echo "bad country";
-    exit();
+    error_page("bad country");
 }
 
-$postal_code = post_str("postal_code", true);
+$postal_code = sanitize_tags(post_str("postal_code", true));
 
 $user = make_user(
     $new_email_addr, $new_name, $passwd_hash,
     $country, $postal_code, $project_prefs, $teamid
 );
 if (!$user) {
-    show_error("Couldn't create account");
+    show_error(tra("Couldn't create account"));
 }
 
 if(defined('INVITE_CODES')) {
Index: forum_search.php
===================================================================
--- forum_search.php	(Revision 24007)
+++ forum_search.php	(Arbeitskopie)
@@ -28,35 +28,35 @@
 
 start_table();
 echo "<form action=\"forum_search_action.php\" method=\"post\">";
-row1("Search query");
-row2("Search for keywords:<br />
-    <span class=\"smalltext\">Posts that contain all the specified words will be displayed</span>",
-    '<input type="text" style="width: 290px" name="search_keywords" size="30" /><br />
-    <span class="smalltext">For example: "screensaver freeze"</span>');
-row2("Search for author ID:<br />
-    <span class=\"smalltext\">Only posts by this author will be displayed</span>",
-    '<input type="text" style="width: 150px" name="search_author" size="10" /><br />
-    <span class="smalltext">For example: "43214"</span>');
+row1(tra("Search query"));
+row2(tra("Search for keywords:")."<br />
+    <span class=\"smalltext\">".tra("Posts that contain all the specified words will be displayed")."</span>",
+    "<input type=\"text\" style=\"width: 290px\" name=\search_keywords\" size=\"30\" /><br />
+    <span class=\"smalltext\">".tra("For example: \"screensaver freeze\"")."</span>");
+row2(tra("Search for author ID:")."<br />
+    <span class=\"smalltext\">".tra("Only posts by this author will be displayed")."</span>",
+    "<input type=\"text\" style=\"width: 150px\" name=\"search_author\" size=\"10\" /><br />
+    <span class=\"smalltext\">".tra("For example: \"43214\"")."</span>");
 
-row1("Search options");
-row2("Search limits<br />
-    <span class=\"smalltext\">Search at most this many days back in time</span>",
-    '<select name="search_max_time">
-    <option value="1">1 day</option>
-    <option value="3">3 days</option>
-    <option value="7">7 days</option>
-    <option value="15">15 days</option>
-    <option value="30" selected>30 days</option>
-    <option value="90">3 months</option>
-    <option value="180">6 months</option>
-    <option value="360">1 year</option>
-    </select>');
+row1(tra("Search options"));
+row2(tra("Search limits")."<br />
+    <span class=\"smalltext\">".tra("Search at most this many days back in time")."</span>",
+    "<select name=\"search_max_time\">
+    <option value=\"1\">".tra("1 day")."</option>
+    <option value=\"3\">".tra("%1 days", "3")."</option>
+    <option value=\"7\">".tra("%1 days", "7")."</option>
+    <option value=\"15\">".tra("%1 days", "15")."</option>
+    <option value=\"30\" selected>".tra("%1 days", "30")."</option>
+    <option value=\"90\">".tra("%1 months", "3")."</option>
+    <option value=\"180\">".tra("%1 months", "6")."</option>
+    <option value=\"360\">".tra("1 year")."</option>
+    </select>");
 
 $forumid = null;
 if (get_str("forumid",true)){
     $forumid = get_str("forumid");
 }
-$forumlist="<option value=\"-1\">All</option>";
+$forumlist="<option value=\"-1\">".tra("All")."</option>";
 $categories = BoincCategory::enum();
 foreach ($categories as $category) {
     $forums = BoincForum::enum("parent_type=0 and category=$category->id");
@@ -68,8 +68,8 @@
         }
     }
 }
-row2("Forum<br />
-    <span class=\"smalltext\">Only display posts from this forum</span>",
+row2(tra("Forum")."<br />
+    <span class=\"smalltext\">".tra("Only display posts from this forum")."</span>",
     '<select name="search_forum">'.$forumlist.'</select');
 
 $sortlist = null;
@@ -80,16 +80,15 @@
         $sortlist.="<option value=\"".$id."\">".$style."</option>";
     }
 }
-row2("Sort by", 
+row2(tra("Sort by"), 
     '<select name="search_sort">'.$sortlist.'</select');
 
 row1("&nbsp;");
-row2("","<input type=\"submit\" value=\"Start the search\">");
+row2("","<input type=\"submit\" value=\"".tra("Start the search")."\">");
 echo "</form>";
 end_table();
 
 page_tail();
-exit;
 
 $cvs_version_tracker[]="\$Id$";  //Generated automatically - do not edit
 ?>
Index: bbcode.php
===================================================================
--- bbcode.php	(Revision 24007)
+++ bbcode.php	(Arbeitskopie)
@@ -20,37 +20,37 @@
 
 check_get_args(array());
 
-page_head("BBCode tags");
+page_head(tra("BBCode tags"));
 echo "<p>
-BBCode tags let you format text in your profile and message-board postings.
+".tra("BBCode tags let you format text in your profile and message-board postings.
 It's similar to HTML, but simpler. The tags start with a [ (where you would
-have used &lt; in HTML) and end with ] (where you would have used &gt; in
-HTML).</p>";
+have used %1 in HTML) and end with ] (where you would have used %2 in
+HTML).", "&lt;", "&gt;")."</p>";
 
 start_table();
-row1("Examples");
-row2_plain("[b]Bold[/b]", "<b>Bold</b>");
-row2_plain("[i]Italic[/i]", "<i>Italic</i>");
-row2_plain("[u]Underline[/u]", "<u>Underline</u>");
-row2_plain("[size=15]Big text[/size]", "<span style=\"font-size: 15px\">Big text</span>");
-row2_plain("[color=red]Red text[/color]", "<font color=\"red\">Red text</font></li>");
-row2_plain("[url=http://google.com/]Google[/url]", "<a href=\"http://google.com/\">Google</a>");
-row2_plain("[quote]Quoted text[/quote]", "use for quoted blocks of text");
-row2_plain("[img]http://example.com/pic.jpg[/img]", "use to display an image");
-row2_plain("[code]Code snippet here[/code]", "use to display some code");
-row2_plain("[pre]Pre-formatted text[/pre]", "use to display pre-formatted (usually monospaced) text");
-row2_plain("[list]<br>* Item 1<br>*Item2<br>[/list]", "<ul><li>Item 1</li><li>Item 2</li></ul>");
+row1(tra("Examples"));
+row2_plain("[b]".tra("Bold")."[/b]", "<b>".tra("Bold")."</b>");
+row2_plain("[i]".tra("Italic")."[/i]", "<i>".tra("Italic")."</i>");
+row2_plain("[u]".tra("Underline")."[/u]", "<u>".tra("Underline")."</u>");
+row2_plain("[size=15]".tra("Big text")."[/size]", "<span style=\"font-size: 15px\">".tra("Big text")."</span>");
+row2_plain("[color=red]".tra("Red text")."[/color]", "<font color=\"red\">".tra("Red text")."</font></li>");
+row2_plain("[url=http://google.com/]".tra("link to website")."[/url]", "<a href=\"http://google.com/\">".tra("link to website")."</a>");
+row2_plain("[quote]".tra("Quoted text")."[/quote]", tra("use for quoted blocks of text"));
+row2_plain("[img]http://example.com/pic.jpg[/img]", tra("use to display an image"));
+row2_plain("[code]".tra("Code snippet here")."[/code]", tra("use to display some code"));
+row2_plain("[pre]".tra("Pre-formatted text")."[/pre]", tra("use to display pre-formatted (usually monospaced) text"));
+row2_plain("[list]<br>* ".tra("Item 1")."<br>* ".tra("Item2")."<br>[/list]", "<ul><li>".tra("Item 1")."</li><li>".tra("Item 2")."</li></ul>");
 row2_plain("[trac]#1[/trac] or [trac]ticket:1[/trac]",
-    "use to link to Trac ticket on BOINC website: <a href=\"http://boinc.berkeley.edu/trac/ticket/1\">#1</a>");
+    tra("use to link to Trac ticket on BOINC website").": <a href=\"http://boinc.berkeley.edu/trac/ticket/1\">#1</a>");
 row2_plain("[trac]wiki:WebForum[/trac]",
-    "use to link to Trac Wiki on BOINC website: <a href=\"http://boinc.berkeley.edu/trac/wiki/WebForum\">WebForum</a>");
+    tra("use to link to Trac Wiki on BOINC website").": <a href=\"http://boinc.berkeley.edu/trac/wiki/WebForum\">WebForum</a>");
 row2_plain("[trac]changeset:12345[/trac]",
-    "use to link to SVN changeset on BOINC website: <a href=\"http://boinc.berkeley.edu/trac/changeset/12345\">[12345]</a>");
+    tra("use to link to SVN changeset on BOINC website").": <a href=\"http://boinc.berkeley.edu/trac/changeset/12345\">[12345]</a>");
 end_table();
 
 echo "<p>
-If you don't close a tag or don't specify a parameter correctly,
-the raw tag itself will display instead of the formatted text.</p>
+".tra("If you don't close a tag or don't specify a parameter correctly,
+the raw tag itself will display instead of the formatted text.")."</p>
 ";
 page_tail();
 ?>
Index: forum_thread.php
===================================================================
--- forum_thread.php	(Revision 24007)
+++ forum_thread.php	(Arbeitskopie)
@@ -44,7 +44,7 @@
 }
 
 if ($threadid < 1) {
-    error_page(tra("Invalid thread ID!"));
+    error_page("Invalid thread ID!");
 }
 
 $thread = BoincThread::lookup_id($threadid);
@@ -66,9 +66,7 @@
         if ($logged_in_user) {
             remove_subscriptions_forum($logged_in_user->id, $thread->id);
         }
-        error_page(
-            tra("This thread has been hidden by moderators")
-        );
+        error_page(tra("This thread has been hidden by moderators."));
     }
 }
 
@@ -242,14 +240,14 @@
     if ($thread->status) {
         show_button(
             "forum_thread_status.php?action=clear&id=$thread->id",
-            "Export",
-            "Export this news item as a Notice"
+            tra("Export"),
+            tra("Export this news item as a Notice")
         );
     } else {
         show_button(
             "forum_thread_status.php?action=set&id=$thread->id",
-            "Don't export",
-            "Don't export this news item as a Notice"
+            tra("Don't export"),
+            tra("Don't export this news item as a Notice")
         );
     }
 }
@@ -259,7 +257,7 @@
     <input type=\"hidden\" name=\"id\" value=\"", $thread->id, "\">" .
     tra("Sort");
 echo select_from_array("sort", $thread_sort_styles, $sort_style);
-echo "<input type=\"submit\" value=\"Sort\">
+echo "<input type=\"submit\" value=\"tra(Sort)\">
     </td></tr></table></form>
 ";
 
Index: home.php
===================================================================
--- home.php	(Revision 24007)
+++ home.php	(Arbeitskopie)
@@ -42,10 +42,8 @@
     page_head(tra("Welcome to %1", PROJECT));
     echo "<p>".tra("View and edit your account preferences using the links below.")."</p>\n";
     if ($via_web) {
-        echo "
-            <p> If you have not already done so,
-            <a href=\"http://boinc.berkeley.edu/download.php\">download BOINC client software</a>.</p>
-        ";
+        echo "<p> "
+        .tra("If you have not already done so, %1download BOINC client software%2.", "<a href=\"http://boinc.berkeley.edu/download.php\">", "</a>")."</p>";
     }
 } else {
     page_head(tra("Your account"));
Index: forum_report_post.php
===================================================================
--- forum_report_post.php	(Revision 24007)
+++ forum_report_post.php	(Arbeitskopie)
@@ -42,7 +42,7 @@
 //
 
 if ($user->total_credit<$forum->rate_min_total_credit || $user->expavg_credit<$forum->rate_min_expavg_credit) {
-    error_page("You need more average or total credit to report a post.");
+    error_page(tra("You need more average or total credit to report a post."));
 }
 
 //__-------------- Action part
@@ -61,44 +61,36 @@
 
 //__--------------- Display part
 if ($success_page==1) {
-    page_head('Report Registered');
-    echo "Your report has been recorded.
-        Thanks for your input.
-        <p>
-        A moderator will now look at your report and decide what will happen -
-        this may take a little while, so please be patient.
-    ";
-    echo "<a href=\"forum_thread.php?id=", $thread->id, "#", $post->id, "\">Return to thread</a>";
+    page_head(tra("Report Registered"));
+    echo tra("Your report has been recorded. Thanks you for your input.")."<p>"
+        .tra("A moderator will now look at your report and decide what will happen - this may take a little while, so please be patient");
+
+    echo "<a href=\"forum_thread.php?id=", $thread->id, "#", $post->id, "\">".tra("Return to thread")."</a>";
 } elseif ($success_page==0){
-    page_head('Report a forum post');
+    page_head(".tra(""Report a forum post"").");
     if (!$no_forum_rating) {
-        echo "<p>Before reporting this post,
-            consider using the +/- rating system instead.
-            If enough users rate a post negatively it will eventually be hidden.
-            <br>You can find the rating system at the bottom of the post.
+        echo "<p>".tra("Before reporting this post, consider using the +/- rating system instead. If enough users rate a post negatively it will eventually be hidden.<br />You can find the rating system at the bottom of the post.")."</p>
         ";
     }
     start_forum_table(array(tra("Author"), tra("Message"),""));
     show_post($post, $thread, $forum, $user, 0, 0);
     echo "<form action=\"forum_report_post.php\" method=\"get\">\n";
     echo form_tokens($user->authenticator);
-    row1("Report post");
-    row2("Why do you find the post offensive:<br><font size=-1>Please include enough information so that a person that
-    has not yet read the thread will quickly be able to identify the issue.</font>",
+    row1(tra("Report post"));
+    row2(tra("Why do you find the post offensive: %1Please include enough information so that a person that
+has not yet read the thread will quickly be able to identify the issue.%2", "<span class=\"smalltext\">", "</span>"),
         "<textarea name=\"reason\" rows=12 cols=54></textarea>"
     );
-    row2("", "<input type=\"submit\" name=\"submit\" value=\"OK\">");
+    row2("", "<input type=\"submit\" name=\"submit\" value=\"".tra("OK")."\">");
     echo "<input type=\"hidden\" name=\"post\" value=\"".$post->id."\">";
     echo "</form>";
     end_table();
 } elseif ($success_page==-1) {
-    page_head('Report not registered');
-    echo "<p>Your report could not be recorded.
-        Please wait a while and try again.
-        <p>If this is not a temporary error,
-        please report it to the project developers.
+    page_head(tra("Report not registered"));
+    echo "<p>".tra("Your report could not be recorded. Please wait a while and try again.")."</p>
+        <p>".tra("If this is not a temporary error, please report it to the project developers.")."</p>
     ";
-    echo "<a href=\"forum_thread.php?id=", $thread->id, "#", $post->id, "\">Return to thread</a>";
+    echo "<a href=\"forum_thread.php?id=", $thread->id, "#", $post->id, "\">".tra("Return to thread")."</a>";
 }
 page_tail();
 ?>
Index: account_finish_action.php
===================================================================
--- account_finish_action.php	(Revision 24007)
+++ account_finish_action.php	(Arbeitskopie)
@@ -24,18 +24,18 @@
 $name = post_str("name");
 
 if (strlen($name)==0) {
-    error_page("You must supply a name for your account");
+    error_page(tra("You must supply a name for your account"));
 }
-if ($new_name != strip_tags($new_name)) {
-    error_page("HTML tags not allowed in name");
+if ($new_name != sanitize_tags($new_name)) {
+    error_page(tra("HTML tags not allowed in name"));
 }
 
 $country = post_str("country");
 if (!is_valid_country($country)) {
-    error_page( "invalid country");
+    error_page("invalid country");
 }
 $country = BoincDb::escape_string($country);
-$postal_code = BoincDb::escape_string(strip_tags(post_str("postal_code", true)));
+$postal_code = BoincDb::escape_string(sanitize_tags(post_str("postal_code", true)));
 $auth = BoincDb::escape_string($auth);
 
 $name = BoincDb::escape_string($name);
Index: get_passwd.php
===================================================================
--- get_passwd.php	(Revision 24007)
+++ get_passwd.php	(Arbeitskopie)
@@ -22,15 +22,11 @@
 
 check_get_args(array());
 
-page_head("Forgot your account info?");
+page_head(tra("Forgot your account info?"));
 
-echo "
-<h3>1) If you know your account's email address,
-    and you can receive email there:</h3>
-<p>
-Enter the email address below, and click OK.
-You will be sent email instructions for resetting your password.
-";
+echo "<h3>"
+    .tra("1) If you know your account's email address, and you can receive email there:")."</h3><p>"
+    .tra("Enter the email address below, and click OK. You will be sent email instructions for resetting your password.");
 
 $master_url = parse_config(get_config(), "<master_url>");
 $x = strstr($master_url, "//");
@@ -41,27 +37,19 @@
 
 start_table();
 echo "<form method=post action=mail_passwd.php>\n";
-row2("Email address","<input type=\"text\" size=40 name=email_addr>");
-row2("", "<input type=submit value=OK>");
+row2(tra("Email address"),"<input type=\"text\" size=40 name=email_addr>");
+row2("", "<input type=submit value=\"".tra("OK")."\">");
 echo "</form>";
 end_table();
 
-echo "
-<p>
-<h3>2) If you forgot your account's email address,
-or you can't receive email there:</h3>
+echo "<p><h3>"
+    .tra("2) If you forgot your account's email address, or you can't receive email there:")."</h3>"
+    .tra("If you have run BOINC under this account, you can still access it. Here's how:")."
 
-If you have run BOINC under the account,
-you can still access it.
-Here's how:
-
 <ul>
-<li> Go to the BOINC data directory on your computer
-(on Windows this is usually <b>C:\\Documents and Settings\All Users\Application Data\BOINC</b> or <b>C:\\Program Files\BOINC</b>.
-<li> Find your account file for this project;
-it will be named <b>$account_file</b>.
-<li> Open the file in a text editor like Notepad.
-You'll see something like
+<li> ".tra("Go to the BOINC data directory on your computer (on Windows this is usually <b>C:\\Documents and Settings\All Users\Application Data\BOINC</b> or <b>C:\\Program Files\BOINC</b>.")."
+<li> ".tra("Find your account file for this project; it will be named <b>%1</b>.", $account_file)."
+<li> ".tra("Open the file in a text editor like Notepad. You'll see something like")."
 <pre>
 &lt;account>
     &lt;master_url>http://lhcathome.cern.ch/&lt;/master_url>
@@ -71,23 +59,20 @@
 &lt;/account>
 </pre>
 
-<li> Select and Copy the string between &lt;authenticator>
-and &lt;/authenticator>
-(<b>8b8496fdd26df7dc0423ecd43c09a56b</b> in the above example).
+<li> ".tra("Select and Copy the string between %1 and %2 (%3 in the above example).", "&lt;authenticator>", "&lt;/authenticator>", "<b>8b8496fdd26df7dc0423ecd43c09a56b</b>")."
 
-<li> Paste the string into the field below, and click OK.
-<li> You will now be logged in to your account;
-update the email and password of your account.
+<li> ".tra("Paste the string into the field below, and click OK.")."
+<li> ".tra("You will now be logged in to your account; update the email and password of your account.")."
 </ul>
 ";
 start_table();
 
 echo "<form action=login_action.php method=post>\n";
-row2("Log in with authenticator", "<input type=\"text\" name=authenticator size=40>");
-row2("Stay logged in on this computer",
+row2(tra("Log in with authenticator"), "<input type=\"text\" name=authenticator size=40>");
+row2(tra("Stay logged in on this computer"),
     "<input type=checkbox name=send_cookie checked>"
 );
-row2("", "<input type=submit value=OK>");
+row2("", "<input type=submit value=\"".tra("OK")."\">");
 echo "</form>";
 
 end_table();
Index: forum_rate.php
===================================================================
--- forum_rate.php	(Revision 24007)
+++ forum_rate.php	(Arbeitskopie)
@@ -23,8 +23,8 @@
 
 $config = get_config();
 if (parse_bool($config, "no_forum_rating")) {
-    page_head("Rating offline");
-    echo "This function is turned off by the project";
+    page_head(tra("Rating offline"));
+    echo tra("This function is turned off by the project");
     page_tail();
     exit(0);
 }
@@ -55,11 +55,11 @@
     // before allowing them to rate a post.
     //
     if ($user->total_credit<$forum->rate_min_total_credit || $user->expavg_credit<$forum->rate_min_expavg_credit) {
-        error_page("You need more average or total credit to rate a post.");
+        error_page(tra("You need more average or total credit to rate a post."));
     }
     
     if (BoincPostRating::lookup($user->id, $post->id)) {
-        error_page("You have already rated this post.<br /><br /><a href=\"forum_thread.php?nowrap=true&id=".$thread->id."#".$post->id."\">Return to thread</a>");
+        error_page(tra("You have already rated this post.")."<br /><br /><a href=\"forum_thread.php?nowrap=true&id=".$thread->id."#".$post->id."\">".tra("Return to thread")."</a>");
     } else {
         $success = BoincPostRating::replace($user->id, $post->id, $rating);
         show_result_page($success, $post, $thread, $choice);
@@ -69,20 +69,20 @@
 function show_result_page($success, $post, $thread, $choice) {
     if ($success) {
         if ($choice) {
-            page_head('Input Recorded');
-                echo "Your input has been recorded.  Thanks for your help.";
+            page_head(tra("Input Recorded"));
+                echo tra("Your input has been recorded. Thanks for your help.");
         } else {
-            page_head('Vote Registered');
-            echo "Your rating has been recorded.  Thanks for your input.";
+            page_head(tra("Vote Registered"));
+            echo tra("Your rating has been recorded. Thanks for your input.");
         }
-        echo "<a href=\"forum_thread.php?nowrap=true&id=", $thread->id, "#", $post->id, "\">Return to thread</a>";
+        echo "<a href=\"forum_thread.php?nowrap=true&id=", $thread->id, "#", $post->id, "\">".tra("Return to thread")."</a>";
     } else {
-        page_head('Vote Submission Problem');    
+        page_head(tra("Vote Submission Problem"));    
         if ($post) {
-            echo "There was a problem recording your vote in our database.  Please try again later.";
-            echo "<a href=\"forum_thread.php?id=", $thread->id, "#", $post->id, "\">Return to thread</a>";
+            echo tra("There was a problem recording your vote in our database. Please try again later.");
+            echo "<a href=\"forum_thread.php?id=", $thread->id, "#", $post->id, "\">".tra("Return to thread")."</a>";
         } else {
-            echo "The post you specified does not exist, or your rating was invalid.";
+            echo tra("The post you specified does not exist, or your rating was invalid.");
         }
     }
     page_tail();
Index: host_app_versions.php
===================================================================
--- host_app_versions.php	(Revision 24007)
+++ host_app_versions.php	(Arbeitskopie)
@@ -22,29 +22,29 @@
 
 function rsc_name($t) {
     switch ($t) {
-    case 2: return "CPU";
-    case 3: return "nvidia GPU";
-    case 4: return "ATI GPU";
+    case 2: return tra("CPU");
+    case 3: return tra("nvidia GPU");
+    case 4: return tra("ATI GPU");
     }
-    return "Unknown";
+    return tra("Unknown");
 }
 
 function av_desc($gavid) {
     if ($gavid >= 1000000) {
         $appid = (int)($gavid/1000000);
         $app = BoincApp::lookup_id($appid);
-        if (!$app) return "Anonymous platform, missing app";
+        if (!$app) return tra("Anonymous platform, missing app");
         $rsc_type = $gavid % 1000000;
         $r = rsc_name($rsc_type);
-        return "$app->user_friendly_name (anonymous platform, $r)";
+        return "$app->user_friendly_name (".tra("anonymous platform").", $r)";
 
     } else {
         $av = BoincAppVersion::lookup_id($gavid);
-        if (!$av) return "Missing app version";
+        if (!$av) return tra("Missing app version");
         $app = BoincApp::lookup_id($av->appid);
-        if (!$app) return "Missing app";
+        if (!$app) return tra("Missing app");
         $platform = BoincPlatform::lookup_id($av->platformid);
-        if (!$platform) return "Missing platform";
+        if (!$platform) return tra("Missing platform");
         $pc = (strlen($av->plan_class))?"($av->plan_class)":"";
         $v = number_format($av->version_num/100, 2);
         return "$app->user_friendly_name $v $platform->name $pc";
@@ -53,16 +53,16 @@
 
 function show_hav($hav) {
     row1(av_desc($hav->app_version_id));
-    row2("Number of tasks completed", $hav->pfc_n);
-    row2("Max tasks per day", $hav->max_jobs_per_day);
-    row2("Number of tasks today", $hav->n_jobs_today);
-    row2("Consecutive valid tasks", $hav->consecutive_valid);
+    row2(tra("Number of tasks completed"), $hav->pfc_n);
+    row2(tra("Max tasks per day"), $hav->max_jobs_per_day);
+    row2(tra("Number of tasks today"), $hav->n_jobs_today);
+    row2(tra("Consecutive valid tasks"), $hav->consecutive_valid);
     $x = number_format($hav->turnaround_avg/86400, 2);
     if ($hav->et_avg) {
         $gflops = 1e-9/$hav->et_avg;
-        row2("Average processing rate", $gflops);
+        row2(tra("Average processing rate"), $gflops);
     }
-    row2("Average turnaround time", "$x days");
+    row2(tra("Average turnaround time"), "$x days");
 }
 
 $hostid = get_int('hostid');
Index: forum_help_desk.php
===================================================================
--- forum_help_desk.php	(Revision 24007)
+++ forum_help_desk.php	(Arbeitskopie)
@@ -24,13 +24,11 @@
 
 $user = get_logged_in_user(false);
 
-page_head("Questions and answers");
+page_head(tra("Questions and answers"));
 
-echo "<p>
-    Talk live via Skype with a volunteer, in any of several languages.
-    Go to
-    <a href=\"http://boinc.berkeley.edu/help.php\">BOINC Online Help</a>.</p>
-";
+echo "<p>".
+    tra("Talk live via Skype with a volunteer, in any of several languages. Go to %1BOINC Online Help%2.", "<a href=\"http://boinc.berkeley.edu/help.php\">", "</a>").
+    "</p>";
 
 show_forum_header($user);
 
@@ -44,7 +42,7 @@
         show_mark_as_read_button($user);
         start_forum_table(array(
             tra("Topic"),
-            tra("# Questions"),
+            tra("Questions"),
             tra("Last post")
         ));
     }
Index: friend.php
===================================================================
--- friend.php	(Revision 24007)
+++ friend.php	(Arbeitskopie)
@@ -61,7 +61,7 @@
         error_page(tra("You can't be friends with yourself"));
     }
     $destuser = BoincUser::lookup_id($destid);
-    if (!$destuser) error_page(tra("No such user"));
+    if (!$destuser) error_page("No such user");
 
     check_pending($user, $destuser);
     check_ignoring($user, $destuser);
@@ -71,14 +71,14 @@
         <form method=post action=friend.php>
         <input type=hidden name=userid value=$destid>
         <input type=hidden name=action value=add_confirm>" .
-        tra("You have asked to add %1 as a friend. We will notify %2 and will ask him/her to confirm that you are friends.",
-        "<b>".$destuser->name."</b>","<b>".$destuser->name."</b>") ."
+        tra("You have asked to add %1 as a friend. We will notify %1 and will ask him/her to confirm that you are friends.",
+        "<b>".$destuser->name."</b>") ."
         <p>" .
         tra("Add an optional message here:") ."
         <br>
         <textarea name=message cols=64 rows=4></textarea>
         <p>
-        <input type=submit value=OK>
+        <input type=submit value=\"".tra("OK")."\">
         </form>
     ";
     page_tail();
@@ -89,13 +89,13 @@
 function handle_add_confirm($user) {
     $destid = post_int('userid');
     $destuser = BoincUser::lookup_id($destid);
-    if (!$destuser) error_page(tra("No such user"));
+    if (!$destuser) error_page("No such user");
 
     check_pending($user, $destuser);
     check_ignoring($user, $destuser);
 
     $msg = post_str('message', true);
-    if ($msg) $msg = strip_tags(BoincDb::escape_string($msg));
+    if ($msg) $msg = sanitize_tags(BoincDb::escape_string($msg));
 
     $now = time();
     $ret = BoincFriend::replace(
@@ -132,9 +132,9 @@
     }
     $srcid = get_int('userid');
     $srcuser = BoincUser::lookup_id($srcid);
-    if (!$srcuser) error_page(tra("No such user"));
+    if (!$srcuser) error_page("No such user");
     $friend = BoincFriend::lookup($srcid, $user->id);
-    if (!$friend) error_page(tra("Request not found"));
+    if (!$friend) error_page("Request not found");
     page_head(tra("Friend request"));
 	echo time_str($friend->create_time)."<p>\n";
     $x = user_links($srcuser, true);
@@ -155,17 +155,17 @@
 function handle_accept($user) {
     $srcid = get_int('userid');
     $srcuser = BoincUser::lookup_id($srcid);
-    if (!$srcuser) error_page(tra("No such user"));
+    if (!$srcuser) error_page("No such user");
 
     $friend = BoincFriend::lookup($srcid, $user->id);
     if (!$friend) {
-        error_page(tra("No request"));
+        error_page("No request");
     }
     $friend->update("reciprocated=1");
 
     // "accept message" not implemented in interface yet
     $msg = post_str('message', true);
-    if ($msg) $msg = strip_tags(BoincDb::escape_string($msg));
+    if ($msg) $msg = sanitize_tags(BoincDb::escape_string($msg));
     $now = time();
     $ret = BoincFriend::replace("user_src=$user->id, user_dest=$srcid, message='$msg', create_time=$now, reciprocated=1");
     if (!$ret) {
@@ -213,7 +213,7 @@
 function handle_accepted($user) {
     $destid = get_int('userid');
     $destuser = BoincUser::lookup_id($destid);
-    if (!$destuser) error_page(tra("No such user"));
+    if (!$destuser) error_page("No such user");
     $notify = BoincNotify::lookup($user->id, NOTIFY_FRIEND_ACCEPT, $destid);
     if ($notify) {
         $notify->delete();
@@ -228,7 +228,7 @@
 function handle_cancel_confirm($user) {
     $destid = get_int('userid');
     $destuser = BoincUser::lookup_id($destid);
-    if (!$destuser) error_page(tra("No such user"));
+    if (!$destuser) error_page("No such user");
     page_head(tra("Cancel friendship?"));
     echo
         tra("Are you sure you want to cancel your friendship with %1?",
@@ -244,7 +244,7 @@
 function handle_cancel($user) {
     $destid = get_int('userid');
     $destuser = BoincUser::lookup_id($destid);
-    if (!$destuser) error_page(tra("No such user"));
+    if (!$destuser) error_page("No such user");
     BoincFriend::delete($user->id, $destid);
     page_head(tra("Friendship cancelled"));
     echo tra("Your friendship with %1 has been cancelled.",$destuser->name);
@@ -285,7 +285,7 @@
     handle_cancel($user);
     break;
 default:
-    error_page(tra("Unknown action"));
+    error_page("Unknown action");
 }
 
 ?>
Index: host_update_credit.php
===================================================================
--- host_update_credit.php	(Revision 24007)
+++ host_update_credit.php	(Arbeitskopie)
@@ -25,17 +25,17 @@
 db_init();
 $user = get_logged_in_user();
 
-page_head("Updating computer credit");
+page_head(tra("Updating computer credit"));
 
 $hostid = get_int("hostid");
 
 $host = lookup_host($hostid);
 if (!$host || $host->userid != $user->id) {
-    error_page("We have no record of that computer");
+    error_page(tra("We have no record of that computer"));
 }
 
 host_update_credit($hostid);
-echo "<br>Host credit updated";
+echo "<br>".tra("Host credit updated");
 page_tail();
 
 ?>
Index: host_venue_action.php
===================================================================
--- host_venue_action.php	(Revision 24007)
+++ host_venue_action.php	(Arbeitskopie)
@@ -30,25 +30,24 @@
 
 $host = BoincHost::lookup_id($hostid);
 if (!$host) {
-    error_page("No such host");
+    error_page(tra("No such host"));
 }
 if ($host->userid != $user->id) {
-    error_page("Not your host");
+    error_page(tra("Not your host"));
 }
 
 $retval = $host->update("venue='$venue'");
 if ($retval) {
-    page_head("Host venue updated");
+    page_head(tra("Host venue updated"));
     if ($venue == '') {
-        $venue = '(none)';
+        $venue = '('.tra("none").')';
     }
     echo "
-        The venue of this host has been set to <b>$venue</b>.
+        ".tra("The venue of this host has been set to %1.", "<b>$venue</b>")."
         <p>
-        This change will take effect the next time the
-        host communicates with this project.
+        ".tra("This change will take effect the next time the host communicates with this project.")."
         <p>
-        <a href=show_host_detail.php?hostid=$hostid>Return to host page</a>.
+        <a href=show_host_detail.php?hostid=$hostid>".tra("Return to host page")."</a>.
     ";
     page_tail();
 } else {
Index: host_edit_action.php
===================================================================
--- host_edit_action.php	(Revision 24007)
+++ host_edit_action.php	(Arbeitskopie)
@@ -21,7 +21,7 @@
 require_once("../inc/host.inc");
 
 function fail($msg) {
-    echo "Error: $msg";
+    echo tra("Error:")." $msg";
     page_tail();
     exit();
 }
@@ -29,14 +29,14 @@
 function get_host($hostid, $user) {
     $host = BoincHost::lookup_id($hostid);
     if (!$host || $host->userid != $user->id) {
-        fail("We have no record of that computer");
+        fail(tra("We have no record of that computer"));
     }
     return $host;
 }
 
 $user = get_logged_in_user();
 
-page_head("Merge computer records");
+page_head(tra("Merge computer records"));
 
 $nhosts = get_int("nhosts");
 $hostid = get_int("id_0");
@@ -62,7 +62,7 @@
     $latest_host = BoincHost::lookup_id($latest_host->id);
 }
 echo "
-    <p><a href=hosts_user.php>Return to list of your computers</a>
+    <p><a href=hosts_user.php>".tra("Return to list of your computers")."</a>
 ";
 page_tail();
 
Index: forum_rss.php
===================================================================
--- forum_rss.php	(Revision 24007)
+++ forum_rss.php	(Arbeitskopie)
@@ -38,22 +38,21 @@
 if (!$forum) error_page("no such forum");
 
 if (get_int('setup', true)) {
-    page_head("$forum->name RSS feed");
-    echo "
-        This message board is available as an RSS feed.
-        Options:
-        <form action=forum_rss.php>
-        <input type=hidden name=forumid value=$forumid>
+    page_head(tra("%1 RSS feed", $forum->title));
+    echo tra("This message board is available as an RSS feed.")
+        .tra("Options:")."
+        <form action=\"forum_rss.php\" method=\"get\">
+        <input type=\"hidden\" name=\"forumid\" value=\"$forumid\">
         <p>
-        Include only posts by user ID <input name=userid> (default: all users).
+        ".tra("Include only posts by user ID %1 (default: all users).", "<input name=\"userid\">")."
         <p>
-        Include only posts from the last <input name=ndays> days (default: 30).
+        ".tra("Include only posts from the last %1 days (default: 30).", "<input name=\"ndays\">")."
         <p>
-        Truncate posts <input type=checkbox name=truncate checked>
+        ".tra("Truncate posts: %1 (Include only first 265 characters of each post)", "<input type=\"checkbox\" name=\"truncate\" checked>")."
         <p>
-        Threads only <input type=checkbox name=threads_only>
+        ".tra("Threads only: %1 (Include only the first post of every thread)", "<input type=\"checkbox\" name=\"threads_only\">")."
         <p>
-        <input type=submit value=OK>
+        <input type=\"submit\" value=\"".tra("OK")."\">
     ";
     page_tail();
     exit;
Index: ffmail_form.php
===================================================================
--- ffmail_form.php	(Revision 24007)
+++ ffmail_form.php	(Arbeitskopie)
@@ -16,6 +16,10 @@
 // You should have received a copy of the GNU Lesser General Public License
 // along with BOINC.  If not, see <http://www.gnu.org/licenses/>.
 
+// TODO: - find out if this is used (add some logging mechanism or so)
+//       - if used rewrite code to use display functions from util.inc
+//       - if used find a way to give the user a language choice (projects must translate messages themself)
+
 require_once("../inc/util.inc");
 
 check_get_args(array());
@@ -24,31 +28,25 @@
 $user = get_logged_in_user();
 
 if (!@file_get_contents('../ops/ffmail/subject')) {
-    error_page(
-        'This project hasn\'t created an email message -
-        please notify its administrators'
-    );
+    error_page(tra("This project hasn\'t created an email message - please notify its administrators"));
 }
 
-page_head("Tell your friends about ".PROJECT);
+page_head(tra("Tell your friends about %1", PROJECT));
 
 echo "
 <table width=600><tr><td>
-Help us by telling your friends, family and coworkers about ".PROJECT.".
+".tra("Help us by telling your friends, family and coworkers about %1", PROJECT)."
 <p>
-Fill in this form with the names and email addresses
-of people you think might be interested in ".PROJECT.".
-We'll send them an email in your name,
-and you can add your own message if you like.
+".tra("Fill in this form with the names and email addresses of people you think might be interested in %1. We'll send them an email in your name, and you can add your own message if you like.", PROJECT)."
 <form method=get action=ffmail_action.php>
 <table cellpadding=4>
-<tr><td class=heading>Your name:</td><td class=heading>Your email address:</td></tr>
+<tr><td class=heading>".tra("Your name:")."</td><td class=heading>".tra("Your email address:")."</td></tr>
 <tr><td><b>$user->name</b></td><td><b>$user->email_addr</b></td></tr>
 
 <input type=hidden name=uname value=\"$user->name\">
 <input type=hidden name=uemail value=\"$user->email_addr\">
 
-<tr><td class=heading>Friend's name:</td><td class=heading>Friend's email address:</td></tr>
+<tr><td class=heading>".tra("Friend's name:")."</td><td class=heading>".tra("Friend's email address:")."</td></tr>
 ";
 for ($i=0; $i<5; $i++) {
     echo "
@@ -56,10 +54,10 @@
     ";
 }
 echo "
-<tr><td class=heading colspan=2>Additional message (optional)</td></tr>
+<tr><td class=heading colspan=2>".tra("Additional message (optional)")."</td></tr>
 <tr><td colspan=2><textarea name=comment rows=8 cols=50></textarea></td></tr>
-<tr><td align=center><input type=submit name=action value=Preview></td>
-    <td align=center><input type=submit name=action value=Send></td>
+<tr><td align=center><input type=submit name=action value=".tra("Preview")."></td>
+    <td align=center><input type=submit name=action value=".tra("Send")."></td>
 </tr>
 </table>
 </form>
Index: forum_subscribe.php
===================================================================
--- forum_subscribe.php	(Revision 24007)
+++ forum_subscribe.php	(Arbeitskopie)
@@ -43,39 +43,35 @@
 
 function subscribe($forum, $thread, $user) {
     if (BoincSubscription::replace($user->id, $thread->id)) {
-        page_head("Subscription successful");
+        page_head(tra("Subscription successful"));
         show_forum_header($user);
         show_title($forum, $thread);
-        echo "<p>You are now subscribed to <b>", cleanup_title($thread->title), "</b>.
-        You will be notified whenever there is a new post.";
+        echo "<p>".tra("You are now subscribed to %1. You will be notified whenever there is a new post.", "<b>".cleanup_title($thread->title)."</b>");
     } else {
-        page_head("Subscription failed");
-        echo "<p>We are currently unable to subscribe you to this thread (<b>", cleanup_title($thread->title), "</b>).
-        Please try again later..";
+        page_head(tra("Subscription failed"));
+        echo "<p>".tra("We are currently unable to subscribe you to %1. Please try again later..", "<b>".cleanup_title($thread->title)."</b>");
     }
-    echo "</p><p><br /><a href=\"forum_thread.php?id=".$thread->id."\">Return to thread</a></p>";
+    echo "</p><p><br /><a href=\"forum_thread.php?id=".$thread->id."\">".tra("Return to thread")."</a></p>";
     page_tail();
 }
 
 function unsubscribe($forum, $thread, $user) {
     BoincSubscription::delete($user->id, $thread->id);
     if (!BoincSubscription::lookup($user->id, $thread->id)) {
-        page_head("Unsubscription successful");
+        page_head(tra("Unsubscription successful"));
         show_forum_header($user);
         show_title($forum, $thread);
-        echo "<p>You are no longer subscribed to <b>", cleanup_title($thread->title), "</b>.
-        You will no longer receive notifications for this thread.";
+        echo "<p>".tra("You are no longer subscribed to %1. You will no longer receive notifications for this thread.", "<b>".cleanup_title($thread->title)."</b>");
     } else {
-        page_head("Unsubscription failed");
-        echo "<p>We are currently unable to unsubscribe you to this thread (<b>", cleanup_title($thread->title), "</b>).
-        Please try again later..";
+        page_head(tra("Unsubscription failed"));
+        echo "<p>".tra("We are currently unable to unsubscribe you from %1. Please try again later..", "<b>".cleanup_title($thread->title)."</b>");
     }
-    echo "</p><p><br /><a href=\"forum_thread.php?id=".$thread->id."\">Return to thread</a></p>";
+    echo "</p><p><br /><a href=\"forum_thread.php?id=".$thread->id."\">".tra("Return to thread")."</a></p>";
     page_tail();
 }
 
 if (!$thread || !$action) {
-    error_page("Unknown subscription action");
+    error_page(tra("Unknown subscription action"));
 }
 
 $user = get_logged_in_user();
Index: donated.php
===================================================================
--- donated.php	(Revision 24007)
+++ donated.php	(Arbeitskopie)
@@ -22,14 +22,14 @@
 
 $st = get_str("st", true);
 
-page_head("PayPal - Transaction Completed");
+page_head(tra("PayPal - Transaction Completed"));
 
 if ($st == "Completed") {
-    echo "<div>Thank you for donating!<br>\n";
-    echo "Your donation for has been completed.<br>\n";
-    echo "Your donation will be added to the progress bar after confirmation by PayPal.</div>";
+    echo "<div>".tra("Thank you for donating!")."<br>\n";
+    echo tra("Your donation for has been completed.")."<br>\n";
+    echo tra("Your donation will be added to the progress bar after confirmation by PayPal.")."</div>";
 } else {
-    echo "<strong>You have canceled your donation</strong>";
+    echo "<strong>".tra("You have canceled your donation.")."</strong>";
 }
 
 page_tail();
Index: account_finish.php
===================================================================
--- account_finish.php	(Revision 24007)
+++ account_finish.php	(Arbeitskopie)
@@ -23,7 +23,6 @@
 require_once('../inc/boinc_db.inc');
 require_once('../inc/util.inc');
 require_once('../inc/countries.inc');
-require_once('../inc/translation.inc');
 
 check_get_args(array("auth"));
 
@@ -32,7 +31,7 @@
 if (!$user) {
     error_page("no such account");
 }
-page_head("Finish account setup");
+page_head(tra("Finish account setup"));
 
 echo "
     <form action=account_finish_action.php method=post>
Index: forum_moderate_thread_action.php
===================================================================
--- forum_moderate_thread_action.php	(Revision 24007)
+++ forum_moderate_thread_action.php	(Arbeitskopie)
@@ -35,7 +35,7 @@
 if (!$forum) error_page("no forum");
 
 if (!is_moderator($logged_in_user, $forum)) {
-    error_page("You are not authorized to moderate this post.");
+    error_page(tra("You are not authorized to moderate this post."));
 }
 
 $explanation = "";
@@ -95,11 +95,11 @@
     $action_name = "renamed from '$thread->title' to '$new_title'";
     break;
 default:
-    error_page("Unknown action ");
+    error_page("Unknown action");
 }
 
 if (!$result) {
-    error_page("Moderation failed");
+    error_page(tra("Action failed: possible database problem"));
 }
 
 $reason = post_str('reason', true);
Index: forum_forum.php
===================================================================
--- forum_forum.php	(Revision 24007)
+++ forum_forum.php	(Arbeitskopie)
@@ -31,14 +31,14 @@
 if (!$start) $start = 0;
 
 $forum = BoincForum::lookup_id($id);
-if (!$forum) error_page("no forum");
+if (!$forum) error_page("forum ID not found");
 $user = get_logged_in_user(false);
 
 if (!is_forum_visible_to_user($forum, $user)) {
     if ($user) {
         remove_subscriptions_forum($user->id, $id);
     }
-    error_page("Not visible");
+    error_page(tra("Not visible to you"));
 }
 
 BoincForumPrefs::lookup($user);
@@ -67,7 +67,7 @@
 switch ($forum->parent_type) {
 case 0:
     $category = BoincCategory::lookup_id($forum->category);
-    if ($category->is_helpdesk){
+    if ($category->is_helpdesk) {
         page_head(tra("Questions and Answers").' : '.$forum->title);
         echo '<link href="forum_help_desk.php" rel="up" title="Forum Index">';
     } else {
@@ -79,7 +79,7 @@
     break;
 case 1:
     $team = BoincTeam::lookup_id($forum->category);
-    page_head("Team message board for <a href=team_display.php?teamid=$team->id>$team->name</a>");
+    page_head(tra("Team message board for %1", "<a href=team_display.php?teamid=$team->id>$team->name</a>"));
     show_forum_header($user);
     show_team_forum_title($forum);
     break;
@@ -95,7 +95,7 @@
 
 if (user_can_create_thread($user, $forum)) {
     show_button(
-        "forum_post.php?id=$id", "New thread", "Add a new thread to this forum"
+        "forum_post.php?id=$id", tra("New thread"), tra("Add a new thread to this forum")
     );
 }
 
@@ -114,11 +114,8 @@
 show_forum($forum, $start, $sort_style, $user);
 
 echo "
-    <p>
-    This message board is available as an
-    <a href=forum_rss.php?forumid=$forum->id&setup=1>RSS feed
-    <img src=img/feed_logo.png></a>
-";
+    <p>".
+    tra("This message board is available as an %1RSS feed%2", "<a href=forum_rss.php?forumid=$forum->id&setup=1>", " <img src=img/feed_logo.png></a>");
 
 page_tail();
 
@@ -174,33 +171,33 @@
 
         echo "<td width=\"1%\" class=\"threadicon\"><nobr>";
         if ($thread->hidden) {
-            show_image(IMAGE_HIDDEN, "This thread is hidden", "hidden");
+            show_image(IMAGE_HIDDEN, tra("This thread is hidden"), tra("hidden"));
         } else if ($unread) {
             if ($thread->sticky) {
                 if ($thread->locked) {
-                    show_image(NEW_IMAGE_STICKY_LOCKED, "This thread is sticky and locked, and you haven't read it yet", "sticky/locked/unread");
+                    show_image(NEW_IMAGE_STICKY_LOCKED, tra("This thread is sticky and locked, and you haven't read it yet"), tra("sticky/locked/unread"));
                 } else {
-                    show_image(NEW_IMAGE_STICKY, "This thread is sticky and you haven't read it yet", "sticky/unread");
+                    show_image(NEW_IMAGE_STICKY, tra("This thread is sticky and you haven't read it yet"), tra("sticky/unread"));
                 }
             } else {
                 if ($thread->locked) {
-                    show_image(NEW_IMAGE_LOCKED, "You haven't read this thread yet, and it's locked", "unread/locked");
+                    show_image(NEW_IMAGE_LOCKED, tra("You haven't read this thread yet, and it's locked"), tra("unread/locked"));
                 } else {
-                    show_image(NEW_IMAGE, "You haven't read this thread yet", "unread");
+                    show_image(NEW_IMAGE, tra("You haven't read this thread yet"), tra("unread"));
                 }
             }
         } else {
             if ($thread->sticky) {
                 if ($thread->locked) {
-                    show_image(IMAGE_STICKY_LOCKED, "This thread is sticky and locked", "sticky/locked");
+                    show_image(IMAGE_STICKY_LOCKED, tra("This thread is sticky and locked"), tra("sticky/locked"));
                 } else {
-                    show_image(IMAGE_STICKY, "This thread is sticky", "sticky");
+                    show_image(IMAGE_STICKY, tra("This thread is sticky"), tra("sticky"));
                 }
             } else {
                 if ($thread->locked) {
-                    show_image(IMAGE_LOCKED, "This thread is locked", "locked");
+                    show_image(IMAGE_LOCKED, tra("This thread is locked"), tra("locked"));
                 } else {
-                    show_image(IMAGE_POST, "You read this thread", "read");
+                    show_image(IMAGE_POST, tra("You read this thread"), tra("read"));
                 }
             }
         }
Index: user_search.php
===================================================================
--- user_search.php	(Revision 24007)
+++ user_search.php	(Arbeitskopie)
@@ -147,7 +147,7 @@
     if (strlen($search_string)<3) {
         error_page(tra("search string must be at least 3 characters"));
     }
-    $s = boinc_real_escape_string($search_string);
+    $s = BoincDb::escape_string($search_string);
     $s = escape_pattern($s);
     $fields = "id, create_time, name, country, total_credit, expavg_credit, teamid, url, has_profile, donated";
     $users = BoincUser::enum_fields($fields, "name like '$s%'", "limit $count");
@@ -185,7 +185,7 @@
         case 'name_prefix':
             break;
         default:
-            error_page(tra("missing search type"));
+            error_page("missing search type");
         }
 
         $filter = null;
Index: html.php
===================================================================
--- html.php	(Revision 24007)
+++ html.php	(Arbeitskopie)
@@ -16,29 +16,23 @@
 // You should have received a copy of the GNU Lesser General Public License
 // along with BOINC.  If not, see <http://www.gnu.org/licenses/>.
 
-
 require_once("../inc/util.inc");
 
 check_get_args(array());
 
-page_head("Allowed HTML tags");
+page_head(tra("Allowed HTML tags"));
 
-echo "
-The following HTML tags are allowed in profiles, team descriptions,
-signatures, etc.:
+echo tra("The following HTML tags are allowed in team descriptions:")."
 <ul>
-<li> &lt;b> or &lt;strong> (bold)
-<li> &lt;i> or &lt;em> (italics)
-<li> &lt;a> (hyperlink)
-<li> &lt;p> (paragraph)
-<li> &lt;br> (break)
-<li> &lt;pre> (preformatted)
-<li> &lt;img> (image; height cannot exceed 450 pixels.
-Please do not link to images without
-permission of the web site where the image is hosted.)
+<li> &lt;b> or &lt;strong> (".tra("bold").")
+<li> &lt;i> or &lt;em> (".tra("italics").")
+<li> &lt;a> (".tra("hyperlink").")
+<li> &lt;p> (".tra("paragraph").")
+<li> &lt;br> (".tra("break").")
+<li> &lt;pre> (".tra("preformatted").")
+<li> &lt;img> (".tra("image; height cannot exceed 450 pixels. Please do not link to images without permission of the web site where the image is hosted.").")
 </ul>
-You can also use ampersand notation for special characters.
-";
+".tra("You can also use ampersand notation for special characters.");
 
 page_tail();
 ?>
Index: host_edit_form.php
===================================================================
--- host_edit_form.php	(Revision 24007)
+++ host_edit_form.php	(Arbeitskopie)
@@ -27,18 +27,16 @@
 $hostid = get_int("hostid");
 $host = BoincHost::lookup_id($hostid);
 if (!$host || $host->userid != $user->id) {
-    error_page("We have no record of that computer");
+    error_page(tra("We have no record of that computer"));
 }
 
 $detail = get_int('detail', true);
 
-page_head("Merge computers");
+page_head(tra("Merge computers"));
 
 $t = time_str($host->create_time);
-echo "
-    Sometimes BOINC assigns separate identities to the same computer by mistake.
-    You can correct this by merging old identities with the newest one.
-    <form name=blah action=host_edit_action.php>
+echo tra("Sometimes BOINC assigns separate identities to the same computer by mistake. You can correct this by merging old identities with the newest one.")."
+    <form name=host_list action=host_edit_action.php>
     <input type=hidden name=id_0 value=$hostid>
     <p>
 ";
@@ -55,29 +53,28 @@
     if ($nhosts==500) break;
 }
 if ($nhosts == 1) {
-    echo "<br>No hosts are eligible for merging with this one.";
+    echo "<br>".tra("No hosts are eligible for merging with this one.");
     if (!$detail) {
-        echo "<p><a href=host_edit_form.php?hostid=$hostid&detail=1>Show details</a>
+        echo "<p><a href=host_edit_form.php?hostid=$hostid&detail=1>".tra("Show details")."</a>
         ";
     }
     page_tail();
     exit();
 }
 echo "
+    <p>"
+    .tra("Check the computers that are the same as %1 (created %2, computer ID %3):", $host->domain_name, $t, $host->id)."
     <p>
-    Check the computers that are the same as $host->domain_name
-    (created $t, computer ID $host->id):
-    <p>
 ";
 start_table();
-row_heading_array(array("", "name", "created", "computer ID"));
+row_heading_array(array("", tra("name"), tra("created"), tra("computer ID")));
 
 $i = 1;
 foreach ($hosts as $host2) {
     $t = time_str($host2->create_time);
     $x = $host2->domain_name;
     if ($x == "") {
-        $x = "[no hostname]";
+        $x = "[".tra("no hostname")."]";
     }
     row_array(array(
         "<input type=checkbox name=id_$i value=$host2->id>",
@@ -94,14 +91,14 @@
         function set_all() {
 ";
 for ($i=1; $i<$nhosts; $i++) {
-    echo "document.blah.id_$i.checked=1;\n";
+    echo "document.host_list.id_$i.checked=1;\n";
 }
 echo "
         }
         function clear_all() {
 ";
 for ($i=1; $i<$nhosts; $i++) {
-    echo "document.blah.id_$i.checked=0;\n";
+    echo "document.host_list.id_$i.checked=0;\n";
 }
 echo "
         }
@@ -109,12 +106,12 @@
     <p><a href=javascript:set_all()>Select all</a>
     <p><a href=javascript:clear_all()>Unselect all</a>
     <input type=hidden name=nhosts value=$nhosts>
-    <p><input type=submit value='Merge hosts'>
+    <p><input type=submit value='".tra("Merge hosts")."'>
     </form>
 ";
 
 if (!$detail) {
-    echo "<p><a href=host_edit_form.php?hostid=$hostid&detail=1>Show details</a>
+    echo "<p><a href=host_edit_form.php?hostid=$hostid&detail=1>".tra("Show details")."</a>
     ";
 }
 
Index: forum_moderate_post_action.php
===================================================================
--- forum_moderate_post_action.php	(Revision 24007)
+++ forum_moderate_post_action.php	(Arbeitskopie)
@@ -25,23 +25,22 @@
     $x = "";
     $reason = post_str('reason', true);
     if ($reason){
-        $x .= "
-Moderator comment: $reason
+        $x .= "\nModerator comment: $reason
 ";
     }
     return $x;
 }
 
 function hide_explanation() {
-    $x = "\nYour post was categorized as ";
     switch (post_int("category", true)) {
-    case 1: $x .= "Obscene"; break;
-    case 2: $x .= "Flame/Hate mail"; break;
-    case 3: $x .= "Commercial spam"; break;
-    case 4: $x .= "Double post"; break;
-    case 5: $x .= "User Request"; break;
-    default: $x .= "Other"; break;
+        case 1: $c = "Obscene"; break;
+        case 2: $c = "Flame/Hate mail"; break;
+        case 3: $c = "Commercial spam"; break;
+        case 4: $c = "Double post"; break;
+        case 5: $c = "User Request"; break;
+        default: $c = "Other"; break;
     }
+    $x = "\nYour post was categorized as ".$c;
     $x .= mod_comment();
     return $x;
 }
@@ -55,13 +54,13 @@
 $forum = BoincForum::lookup_id($thread->forum);
 
 if (!is_moderator($user, $forum)) {
-    error_page("You are not authorized to moderate this post.");
+    error_page(tra("You are not authorized to moderate this post."));
 }
 
 // See if "action" is provided - either through post or get
 if (!post_str('action', true)) {
     if (!get_str('action', true)){
-        error_page("You must specify an action...");
+        error_page(tra("You must specify an action..."));
     } else {
         $action = get_str('action');
     }
@@ -83,11 +82,11 @@
     if (!$new_thread) error_page("No such thread");
     $new_forum = BoincForum::lookup_id($new_thread->forum);
     if ($forum->parent_type != $new_forum->parent_type) {
-        error_page("Can't move to different category type");
+        error_page(tra("Can't move to different category type"));
     }
     if ($forum->parent_type != 0) {
         if ($forum->category != $new_forum->category) {
-            error_page("Can't move to different category");
+            error_page(tra("Can't move to different category"));
         }
     }
     $result = move_post($post, $thread, $forum, $new_thread, $new_forum);
@@ -108,14 +107,14 @@
         }
     }
     if (!$auth) {
-        error_page("Not authorized to banish users");
+        error_page(tra("Not authorized to banish users"));
     }
     $userid = post_int('userid');
-    $user = BoincUser::lookup_id($userid);
-    if (!$user) {
-        error_page("no user");
+    $bad_user = BoincUser::lookup_id($userid);
+    if (!$bad_user) {
+        error_page("user ID not found");
     }
-    BoincForumPrefs::lookup($user);
+    BoincForumPrefs::lookup($bad_user);
     $duration = post_int('duration');
     if ($duration == -1) {
         $t = 2147483647; // Maximum integer value
@@ -123,22 +122,22 @@
         $t = time() + $duration;
     }
     $reason = post_str("reason", true);
-    $result = $user->prefs->update("banished_until=$t");
-    page_head("Banishment");
+    $result = $bad_user->prefs->update("banished_until=$t");
+    page_head(tra("Banishment"));
     if ($result) {
-        echo "User ".$user->name." has been banished.";
-        send_banish_email($forum, $user, $t, $reason);
+        echo tra("User %1 has been banished.", $bad_user->name);
+        send_banish_email($forum, $bad_user, $t, $reason);
     } else {
-        echo "DB failure";
+        error_page(tra("Action failed: possible database problem"));
     }
     page_tail();
     exit();
 } else {
-    error_page("Unknown action ");
+    error_page("Unknown action");
 }
 
 if (!$result) {
-    error_page("Action failed: possible database problem");
+    error_page(tra("Action failed: possible database problem"));
 }
 
 send_moderation_email($forum, $post, $thread, $explanation, $action_name);
Index: forum_index.php
===================================================================
--- forum_index.php	(Revision 24007)
+++ forum_index.php	(Arbeitskopie)
@@ -50,7 +50,7 @@
         $t = $forum->title;
         if (!strlen($t)) $t = $team->name;
         $d = $forum->description;
-        if (!strlen($d)) $d = "Discussion among members of $team->name";
+        if (!strlen($d)) $d = tra("Discussion among members of %1", $team->name);
         break;
     }
     $j = $i % 2;
@@ -120,7 +120,7 @@
 if ($user) {
     $subs = BoincSubscription::enum("userid=$user->id");
     if (count($subs)) {
-        echo "<p><span class=title>Subscribed threads</span><p>";
+        echo "<p><span class=title>".tra("Subscribed threads")."</span><p>";
         show_thread_and_context_header();
         $i = 0;
         foreach ($subs as $sub) {
Index: team_lookup.php
===================================================================
--- team_lookup.php	(Revision 24007)
+++ team_lookup.php	(Arbeitskopie)
@@ -66,7 +66,7 @@
 $name_lc = strtolower($team_name);
 $name_lc = escape_pattern($name_lc);
 
-$clause = "name like '%".boinc_real_escape_string($name_lc)."%' order by expavg_credit desc limit 100";
+$clause = "name like '%".BoincDb::escape_string($name_lc)."%' order by expavg_credit desc limit 100";
 $teams = BoincTeam::enum($clause);
 
 if ($format == 'xml') {
@@ -83,7 +83,7 @@
 
 page_head(tra("Search Results"));
 if (count($teams)) {
-    echo "<h2>".tra("Search results for '%1'", strip_tags($team_name))."</h2>";
+    echo "<h2>".tra("Search results for '%1'", sanitize_tags($team_name))."</h2>";
     echo "<p>";
     echo tra("You may view these teams' members, statistics, and information.");
     echo "<ul>";
Index: profile_search_action.php
===================================================================
--- profile_search_action.php	(Revision 24007)
+++ profile_search_action.php	(Arbeitskopie)
@@ -26,9 +26,7 @@
     echo "<tr><td>".user_links($user)."</td><td>".date_str($user->create_time)."</td><td>$user->country</td><td>".(int)$user->total_credit."</td><td>".(int)$user->expavg_credit."</td></tr>\n";
 }
 
-$search_string = get_str('search_string');
-$search_string = strip_tags($search_string);
-$search_string = boinc_real_escape_string($search_string);
+$search_string = BoincDb::escape_string(sanitize_tags(get_str('search_string')));
 $offset = get_int('offset', true);
 if (!$offset) $offset=0;
 $count = 10;
Index: prefs_edit.php
===================================================================
--- prefs_edit.php	(Revision 24007)
+++ prefs_edit.php	(Arbeitskopie)
@@ -20,7 +20,7 @@
 include_once("../inc/util.inc");
 include_once("../inc/prefs.inc");
 
-db_init();
+check_get_args(array("action", "subset", "venue", "cols", "tnow", "ttok"));
 
 $user = get_logged_in_user();
 
Index: edit_email_action.php
===================================================================
--- edit_email_action.php	(Revision 24007)
+++ edit_email_action.php	(Arbeitskopie)
@@ -28,18 +28,18 @@
 $email_addr = strtolower(post_str("email_addr"));
 $passwd = post_str("passwd", true);
 
-page_head("Change email address of account");
+page_head(tra("Change email address of account"));
 
 if (!is_valid_email_addr($email_addr)) {
-    echo "New email address '$email_addr' is invalid";
+    echo tra("New email address '%1' is invalid.", $email_addr);
 } else if (is_banned_email_addr($email_addr)) {
-    echo "New email address '$email_addr' is invalid";
+    echo tra("New email address '%1' is invalid.", $email_addr);
 } else if ($email_addr == $user->email_addr) {
-    echo "New email address is same as existing address; no change.";
+    echo tra("New email address is same as existing address. Nothing is changed.");
 } else {
     $existing = lookup_user_email_addr($email_addr);
     if ($existing) {
-        echo "There's already an account with that email address";
+        echo tra("There's already an account with that email address");
     } else {
         $passwd_hash = md5($passwd.$user->email_addr);
 
@@ -51,7 +51,7 @@
             $passwd_hash = md5($passwd.$user->email_addr);
         }
         if ($passwd_hash != $user->passwd_hash) {
-            echo "Invalid password.";
+            echo tra("Invalid password.");
         } else {
             $passwd_hash = md5($passwd.$email_addr);
             $email_addr = BoincDb::escape_string($email_addr);
@@ -59,17 +59,12 @@
                 "email_addr='$email_addr', passwd_hash='$passwd_hash', email_validated=0"
             );
             if ($result) {
-                echo "
-                    The email address of your account is now $email_addr.
-                ";
+                echo tra("The email address of your account is now %1.", $email_addr);
                 if (defined("SHOW_NONVALIDATED_EMAIL_ADDR")) {
-                    echo "<p>Please <a href=validate_email_addr.php>validate this email address</a>.\n";
+                    echo "<p>".tra("Please %1validate this email address%2.", "<a href=validate_email_addr.php>", "</a>")."\n";
                 }
             } else {
-                echo "
-                    We can't update your email address
-                    due to a database problem.  Please try again later.
-                ";
+                echo tra("We can't update your email address due to a database problem.  Please try again later.");
             }
         }
     }
Index: forum_banishment_vote_action.php
===================================================================
--- forum_banishment_vote_action.php	(Revision 24007)
+++ forum_banishment_vote_action.php	(Arbeitskopie)
@@ -30,13 +30,13 @@
 check_tokens($logged_in_user->authenticator);
 
 if (!$logged_in_user->prefs->privilege(S_MODERATOR)) {
-    error_page("You are not authorized to banish users.");
+    error_page(tra("You are not authorized to banish users."));
 }
 
 // See if "action" is provided - either through post or get
 if (!post_str('action', true)) {
     if (!get_str('action', true)){
-	    error_page("You must specify an action...");
+	    error_page(tra("You must specify an action..."));
     } else {
         $action = get_str('action');
     }
@@ -48,18 +48,19 @@
 $user=BoincUser::lookup_id($userid);
 
 if ($action!="start"){
-    error_page("Unknown action ");
+    error_page("Unknown action");
 }
 
+// TODO: create a function for this in forum_banishment_vote.inc to make it more flexible
 switch (post_int("category", true)) {
     case 1:
-        $mod_category = "Obscene";
+        $mod_category = tra("Obscene");
     case 2:
-        $mod_category = "Flame/Hate mail";
+        $mod_category = tra("Flame/Hate mail");
     case 3:
-        $mod_category = "User Request";
+        $mod_category = tra("User Request");
     default:
-        $mod_category = "Other";
+        $mod_category = tra("Other");
 }
 
 if (post_str('reason', true)){
Index: edit_user_info_action.php
===================================================================
--- edit_user_info_action.php	(Revision 24007)
+++ edit_user_info_action.php	(Arbeitskopie)
@@ -27,24 +27,22 @@
 check_tokens($user->authenticator);
 
 $name = post_str("user_name");
-if ($name != strip_tags($name)) {
+if ($name != sanitize_tags($name)) {
     error_page(tra("HTML tags are not allowed in your name."));
 }
 if (strlen($name) == 0) {
     error_page(tra("You must supply a name for your account."));
 }
-$url = post_str("url", true);
-$url = strip_tags($url);
+$url = sanitize_tags(post_str("url", true));
 $country = post_str("country");
 if ($country == "") {
     $country = "International";
 }
 if (!is_valid_country($country)) {
-    error_page(tra("bad country"));
+    error_page("bad country");
 }
 $country = BoincDb::escape_string($country);
-$postal_code = post_str("postal_code", true);
-$postal_code = strip_tags($postal_code);
+$postal_code = sanitize_tags(post_str("postal_code", true));
 
 $name = BoincDb::escape_string($name);
 $url = BoincDb::escape_string($url);
Index: team_forum.php
===================================================================
--- team_forum.php	(Revision 24007)
+++ team_forum.php	(Arbeitskopie)
@@ -50,7 +50,7 @@
     $id = BoincForum::insert("(category, parent_type) values ($team->id, 1)");
     $forum = BoincForum::lookup_id($id);
     if (!$forum) {
-        error_page(tra("couldn't create message board"));
+        error_page(tra("Couldn't create message board"));
     }
     edit_form($user, $team, $forum, true);
 }
@@ -104,7 +104,7 @@
 
 function remove($team) {
     $forum = BoincForum::lookup("parent_type=1 and category=$team->id");
-    if (!$forum) error_page(tra("message board not found"));
+    if (!$forum) error_page("message board not found");
     
     // delete threads and posts
     //
@@ -131,9 +131,9 @@
 }
 
 function edit_action($forum) {
-    $title = strip_tags(post_str('title'));
+    $title = sanitize_tags(post_str('title'));
     $title = BoincDb::escape_string($title);
-    $description = strip_tags(post_str('description'));
+    $description = sanitize_tags(post_str('description'));
     $description = BoincDb::escape_string($description);
     $post_min_interval = post_int('post_min_interval');
     $post_min_total_credit = post_int('post_min_total_credit');
@@ -151,7 +151,7 @@
 function show_forum($team) {
     $forum = BoincForum::lookup("parent_type=1 and category=$team->id");
     if (!$forum) {
-        error_page(tra("team has no forum"));
+        error_page(tra("Team has no forum"));
     }
     Header("Location: forum_forum.php?id=$forum->id");
 }
@@ -161,7 +161,7 @@
 
 $team = BoincTeam::lookup_id($teamid);
 if (!$team) {
-    error_page(tra("no such team"));
+    error_page("no such team");
 }
 
 $cmd = get_str('cmd', true);
@@ -186,7 +186,7 @@
     require_founder_login($user, $team);
     check_tokens($user->authenticator);
     $forum = BoincForum::lookup("parent_type=1 and category=$teamid");
-    if (!$forum) error_page(tra("no such forum"));
+    if (!$forum) error_page("no such forum");
     edit_action($forum);
 } else if ($cmd == "remove_confirm") {
     $user = get_logged_in_user();
@@ -197,7 +197,7 @@
     require_founder_login($user, $team);
     remove($team);
 } else if ($cmd != "") {
-    error_page(tra("unknown command %1", $cmd));
+    error_page("unknown command $cmd");
 } else {
     show_forum($team);
 }
Index: forum_reply.php
===================================================================
--- forum_reply.php	(Revision 24007)
+++ forum_reply.php	(Arbeitskopie)
@@ -73,9 +73,7 @@
     }
     check_tokens($logged_in_user->authenticator);
     if (!akismet_check($logged_in_user, $content)) {
-        $warning = "Your post has been flagged as spam by the Akismet
-            anti-spam system.  Please modify your text and try again.
-        ";
+        $warning = tra("Your post has been flagged as spam by the Akismet anti-spam system. Please modify your text and try again.");
         $preview = tra("Preview");
     } else {
         create_post(
@@ -126,10 +124,10 @@
     global $logged_in_user, $bbcode_html;
     global $content, $preview;
 
-    $x1 = "Message:".html_info().post_warning();
+    $x1 = tra("Message:").html_info().post_warning();
     $x2 = "";
     if ($parent_post) {
-        $x2 .=" reply to <a href=#".$parent_post->id.">Message ID ".$parent_post->id."</a>:";
+        $x2 .=" ".tra("reply to %1Message ID%2:", "<a href=#".$parent_post->id.">", " ".$parent_post->id."</a>");
     }
     $x2 .= "<form action=forum_reply.php?thread=".$thread->id;
 
@@ -146,17 +144,17 @@
     } else if (!$no_quote) {
         if ($parent_post) $x2 .= quote_text(htmlspecialchars($parent_post->content))."\n";
     }
-    if (!$logged_in_user->prefs->no_signature_by_default){
+    if (!$logged_in_user->prefs->no_signature_by_default) {
         $enable_signature="checked=\"true\"";
     } else {
         $enable_signature="";
     }
     $x2 .= "</textarea><p>
         <input type=\"submit\" name=\"preview\" value=\"".tra("Preview")."\">
-        <input type=\"submit\" value=\"Post reply\">
+        <input type=\"submit\" value=\"".tra("Post reply")."\">
         &nbsp;&nbsp;&nbsp;
-        <input name=\"add_signature\" id=\"add_signature\" value=\"add_it\" ".$enable_signature." type=\"checkbox\">
-        <label for=\"add_signature\">Add my signature to this reply</label>
+        <input type=\"checkbox\" name=\"add_signature\" id=\"add_signature\" value=\"add_it\" ".$enable_signature.">
+        <label for=\"add_signature\">".tra("Add my signature to this reply")."</label>
 
         </form>
     ";
Index: edit_forum_preferences_action.php
===================================================================
--- edit_forum_preferences_action.php	(Revision 24007)
+++ edit_forum_preferences_action.php	(Arbeitskopie)
@@ -32,14 +32,12 @@
 BoincForumPrefs::lookup($user);
 
 if (post_str("action", true)=="reset_confirm"){
-    page_head("Confirm reset");
-    echo "This action will erase any changes you have made
-        in your community preferences.
-        To cancel, click your browser's Back button.
+    page_head(tra("Confirm reset"));
+    echo tra("This action will erase any changes you have made in your community preferences. To cancel, click your browser's Back button.")."
         <p>
         <form action=edit_forum_preferences_action.php method=post>
         <input type=hidden name=action value=reset>
-        <input type=submit value=\"Reset preferences\">
+        <input type=submit value=\"".tra("Reset preferences")."\">
         </form>
     ";
     page_tail();
@@ -89,7 +87,7 @@
         $size = getImageSize($file);
         if ($size[2]!=2 and $size[2]!=3){
             //Not the right kind of file
-            error_page("Error: Not the right kind of file, only PNG and JPEG are supported.");
+            error_page(tra("Error: Not the right kind of file, only PNG and JPEG are supported."));
         }
         $width = $size[0];
         $height = $size[1];
@@ -115,9 +113,7 @@
 $pm_notification = post_int("pm_notification");
 $signature = post_str("signature", true);
 if (strlen($signature)>250) {
-    error_page(
-        "Your signature was too long, please keep it less than 250 chars"
-    );
+    error_page(tra("Your signature was too long, please keep it less than 250 characters."));
 }
 $forum_sort = post_int("forum_sort");
 $thread_sort = post_int("thread_sort");
@@ -140,7 +136,7 @@
     if ($user_to_add!="" and $user_to_add==strval(intval($user_to_add))){
         $other_user = BoincUser::lookup_id($user_to_add);
         if (!$other_user) {
-            echo "No such user: $other_user";
+            echo tra("No such user: %1", $other_user);
         } else {
             add_ignored_user($user, $other_user);
         }
@@ -154,7 +150,7 @@
     if ($_POST["remove".trim($ignored_users[$i])]!=""){
         $other_user = BoincUser::lookup_id($ignored_users[$i]);
         if (!$other_user) {
-            echo "No such user: $other_user";
+            echo tra("No such user: %1", $other_user);
         } else {
             remove_ignored_user($user, $other_user);
         }
Index: forum_user_posts.php
===================================================================
--- forum_user_posts.php	(Revision 24007)
+++ forum_user_posts.php	(Arbeitskopie)
@@ -70,7 +70,7 @@
         }
     }
 }
-page_head("Posts by $user->name");
+page_head(tra("Posts by %1", $user->name));
 
 $posts = BoincPost::enum("user=$userid order by id desc");
 $n = 0;
@@ -113,7 +113,7 @@
 if ($offset) {
 	$x = $offset - $count;
     echo "<a href=forum_user_posts.php?userid=$userid&offset=$x>
-		<b>Previous $count</b>
+		<b>".tra("Previous %1", $count)."</b>
 		</a>
     ";
 	if ($show_next) echo " | ";
@@ -122,7 +122,7 @@
 if ($show_next) {
     $offset += $count;
     echo "<a href=forum_user_posts.php?userid=$userid&offset=$offset>
-		<b>Next $count</b>
+		<b>".tra("Next %1", $count)."</b>
 		</a>
     ";
 }
Index: add_venue.php
===================================================================
--- add_venue.php	(Revision 24007)
+++ add_venue.php	(Arbeitskopie)
@@ -21,6 +21,8 @@
 require_once("../inc/util.inc");
 require_once("../inc/prefs.inc");
 
+check_get_args(array("action", "subset", "venue", "cols"));
+
 db_init();
 
 $user = get_logged_in_user();
Index: forum_edit.php
===================================================================
--- forum_edit.php	(Revision 24007)
+++ forum_edit.php	(Arbeitskopie)
@@ -38,15 +38,13 @@
 
 if (!is_moderator($logged_in_user, $forum)) {
     if (time() > $post->timestamp + MAXIMUM_EDIT_TIME) {
-        error_page(
-            "You can no longer edit this post.<br />Posts can only be edited at most ".(MAXIMUM_EDIT_TIME/60)." minutes after they have been created."
-        );
+        error_page(tra("You can no longer edit this post.<br/>Posts can only be edited at most %1 minutes after they have been created.", (MAXIMUM_EDIT_TIME/60)));
     }
 }
 
 $post_owner = BoincUser::lookup_id($post->user);
 if (($logged_in_user->id != $post_owner->id) || (can_reply($thread, $forum, $logged_in_user) == false)) {
-    error_page ("You are not authorized to edit this post.");
+    error_page (tra("You are not authorized to edit this post."));
 }
 
 $thread_owner = BoincUser::lookup_id($thread->owner);
@@ -74,7 +72,7 @@
     
         if ($can_edit_title){
             $title = trim($title);
-            $title = strip_tags($title);
+            $title = sanitize_tags($title);
             $title = BoincDb::escape_string($title);
             $thread->update("title='$title'");
         }
@@ -85,7 +83,7 @@
     }
 }
 
-page_head('Forum','','','', $bbcode_js);
+page_head(tra("Forum"),'','','', $bbcode_js);
 
 show_forum_header($logged_in_user);
 switch ($forum->parent_type) {
@@ -109,7 +107,7 @@
 echo "<form action=\"forum_edit.php?id=".$post->id."\" method=\"POST\" name=\"post\" onsubmit=\"return checkForm(this)\">\n";
 echo form_tokens($logged_in_user->authenticator);
 start_table();
-row1("Edit your message");
+row1(tra("Edit your message"));
 if ($can_edit_title) {
     //If this is the user can edit the thread title display a way of doing so
     if ($preview) {
Index: hosts_user.php
===================================================================
--- hosts_user.php	(Revision 24007)
+++ hosts_user.php	(Arbeitskopie)
@@ -46,14 +46,14 @@
 if ($userid) {
     $user = lookup_user_id($userid);
     if (!$user) {
-        error_page("No such user");
+        error_page(tra("No such user"));
     }
 
     if ($user->show_hosts) {
         page_head(tra("Computers belonging to %1", $user->name));
     } else {
-        page_head("Computers hidden");
-        echo tra("This user has chosen not to show information about their computers.");
+        page_head(tra("Computers hidden"));
+        echo tra(tra("This user has chosen not to show information about his or her computers."));
         page_tail();
         exit();
     }
@@ -61,7 +61,7 @@
 } else {
     $user = get_logged_in_user();
     $userid = $user->id;
-    page_head("Your computers");
+    page_head(tra("Your computers"));
     $private = true;
 }
 
Index: apps.php
===================================================================
--- apps.php	(Revision 24007)
+++ apps.php	(Arbeitskopie)
@@ -18,7 +18,6 @@
 
 require_once("../inc/boinc_db.inc");
 require_once("../inc/util.inc");
-require_once("../inc/translation.inc");
 
 check_get_args(array("xml"));
 
Index: forum_search_action.php
===================================================================
--- forum_search_action.php	(Revision 24007)
+++ forum_search_action.php	(Arbeitskopie)
@@ -87,8 +87,8 @@
 
     $search_string="%";
     foreach ($keyword_list as $key => $word){
-        $search_string.=mysql_escape_string($word)."%";
-    }
+        $search_string.=BoincDb::escape_string($word)."%";
+    } 
     $optional_join = "";
     // if looking in a single forum, need to join w/ thread table
     // because that's where the link to forum is
@@ -209,15 +209,15 @@
 }
 
 if (!count($thread) && !count($posts)){
-    echo "<p>Sorry, couldn't find anything matching your search query. You 
-    can try to broaden your search by using less words (or less specific words).</p>
-    <p>You can also 
-    <a href=\"http://www.google.com/search?domains=".URL_BASE."&sitesearch=".URL_BASE."/forum_thread.php&q=".htmlentities($search_keywords)."\">
-    try the same search on Google.</a></p>";
+    echo "<p>".tra("Sorry, couldn't find anything matching your search query. You can try to broaden your search by using less words (or less specific words).")."</p>
+    <p>"
+    .tra("You can also %1try the same search on Google.%2",
+         "<a href=\"http://www.google.com/search?domains=".URL_BASE."&sitesearch=".URL_BASE."/forum_thread.php&q=".htmlentities($search_keywords)."\">",
+         "</a>")
+    ."</p>";
 }
-echo "<p><a href=\"forum_search.php\">Perform another search</a></p>";
+echo "<p><a href=\"forum_search.php\">".tra("Perform another search")."</a></p>";
 page_tail();
-exit;
 
 $cvs_version_tracker[]="\$Id$";  //Generated automatically - do not edit
 ?>
Index: forum_thread_status.php
===================================================================
--- forum_thread_status.php	(Revision 24007)
+++ forum_thread_status.php	(Arbeitskopie)
@@ -40,16 +40,16 @@
         $ret = $thread->update("status=0");
     }
     if (!$ret){
-        error_page("Could not update the status of the thread: ".$thread->id);
+        error_page(tra("Could not update the status of the thread: %1", $thread->id));
     }
 } else {
-    error_page("You must be the creator of the thread to update its status");
+    error_page(tra("You must be the creator of the thread to update its status."));
 }
 
 // --------------
 
-page_head("Thread status updated");
-echo "<p>The status has been updated.</p>";
-echo "<p><a href=\"forum_thread.php?nowrap=true&id=".$thread->id."\">Return to the thread</a></p>";
+page_head(tra("Thread status updated"));
+echo "<p>".tra("The status has been updated.")."</p>";
+echo "<p><a href=\"forum_thread.php?nowrap=true&id=".$thread->id."\">".tra("Return to thread")."</a></p>";
 page_tail();
 ?>
Index: create_profile.php
===================================================================
--- create_profile.php	(Revision 24007)
+++ create_profile.php	(Arbeitskopie)
@@ -274,9 +274,9 @@
     $response1 = sanitize_html($response1);
     $response2 = sanitize_html($response2);
     if ($profile) {
-        $query = " response1 = '".boinc_real_escape_string($response1)."',"
-            ." response2 = '".boinc_real_escape_string($response2)."',"
-            ." language = '".boinc_real_escape_string($language)."',"
+        $query = " response1 = '".BoincDb::escape_string($response1)."',"
+            ." response2 = '".BoincDb::escape_string($response2)."',"
+            ." language = '".BoincDb::escape_string($language)."',"
             ." has_picture = '$hasPicture',"
             ." verification = '$profile->verification'"
             ." WHERE userid = '$user->id'";
@@ -287,9 +287,9 @@
     } else {
         $query = 'SET '
             ." userid = '$user->id',"
-            ." language = '".boinc_real_escape_string($language)."',"
-            ." response1 = '".boinc_real_escape_string($response1)."',"
-            ." response2 = '".boinc_real_escape_string($response2)."',"
+            ." language = '".BoincDb::escape_string($language)."',"
+            ." response1 = '".BoincDb::escape_string($response1)."',"
+            ." response2 = '".BoincDb::escape_string($response2)."',"
             ." has_picture = '$hasPicture',"
             ." verification=0";
         $result = BoincProfile::insert($query);
Index: edit_forum_preferences_form.php
===================================================================
--- edit_forum_preferences_form.php	(Revision 24007)
+++ edit_forum_preferences_form.php	(Arbeitskopie)
@@ -28,7 +28,7 @@
 $user = get_logged_in_user();
 BoincForumPrefs::lookup($user);
 
-page_head("Community preferences");
+page_head(tra("Community preferences"));
 
 // output a script for counting chars left in text field
 //
@@ -48,15 +48,15 @@
 
 // ------------ Notification -----------
 
-row1("Notifications");
+row1(tra("Notifications"));
 $ch0 = $user->prefs->pm_notification==0?"checked":"";
 $ch1 = $user->prefs->pm_notification==1?"checked":"";
 $ch2 = $user->prefs->pm_notification==2?"checked":"";
 row2(
-    "How should we notify you of new private messages, friend requests, posts in subscribed threads, and other events?",
-    "<input type=radio name=pm_notification value=0 $ch0> On my Account page (no email)
-    <br><input type=radio name=pm_notification value=1 $ch1> Immediately, by email
-    <br><input type=radio name=pm_notification value=2 $ch2> In a single daily email
+    tra("How should we notify you of new private messages, friend requests, posts in subscribed threads, and other events?"),
+    "<input type=radio name=pm_notification value=0 $ch0> ".tra("On my Account page (no email)")."
+    <br><input type=radio name=pm_notification value=1 $ch1> ".tra("Immediately, by email")."
+    <br><input type=radio name=pm_notification value=2 $ch2> ".tra("In a single daily email")."
     "
 );
 
@@ -72,112 +72,81 @@
 } else {
     $select_0 = "checked=\"true\"";
 }
-row1("Message-board identity");
-row2("Avatar
-    <br><span class=\"note\">An image representing you on the message boards.
-    <br>Format: JPG or PNG. Size: at most 4 KB, 100x100 pixels</span>",
+row1(tra("Message-board identity"));
+row2(tra("Avatar")."
+    <br><span class=\"note\">".tra("An image representing you on the message boards.")."
+    <br>".tra("Format: JPG or PNG. Size: at most 4 KB, 100x100 pixels")."</span>",
     "<input type=\"radio\" id=\"avatar_select_0\" name=\"avatar_select\" value=\"0\" ".$select_0.">
-        <label for=\"avatar_select_0\">Don't use an avatar</label><br>
+        <label for=\"avatar_select_0\">".tra("Don't use an avatar")."</label><br>
     <input type=\"radio\" id=\"avatar_select_1\" name=\"avatar_select\" value=\"1\" ".$select_1.">
-        <label for=\"avatar_select_1\">Use a Globally Recognized Avatar provided by <a href=\"http://gravatar.com\">Gravatar.com</a></label><br>
+        <label for=\"avatar_select_1\">".tra("Use a Globally Recognized Avatar provided by %1", "<a href=\"http://gravatar.com\">Gravatar.com</a>")."</label><br>
     <input type=\"radio\" id=\"avatar_select_2\" name=\"avatar_select\" value=\"2\" ".$select_2.">
-        <label for=\"avatar_select_2\">Use this uploaded avatar:</label> <input type=\"file\" name=\"picture\">"
+        <label for=\"avatar_select_2\">".tra("Use this uploaded avatar:")."</label> <input type=\"file\" name=\"picture\">"
 );
 if (strlen($user->prefs->avatar)){
-    row2("Avatar preview<br><span class=\"note\">This is how your avatar will look</span>",
+    row2(tra("Avatar preview")."<br><span class=\"note\">".tra("This is how your avatar will look")."</span>",
     "<img src=\"".$user->prefs->avatar."\" width=\"100\" height=\"100\">");
 }
 
-if (!$user->prefs->no_signature_by_default){
-    $signature_by_default="checked=\"checked\"";
-} else {
-    $signature_by_default="";
-}
+$signature_by_default = $user->prefs->no_signature_by_default==false?"checked=\"checked\"":"";
+
 $signature=$user->prefs->signature;
 $maxlen=250;
 row2(
-    "Signature for message board posts"
+    tra("Signature for message board posts")
     .html_info()
-    ."<br><br>Check out <a href=http://boinc.berkeley.edu/links.php#sigs>various free services</a>
-    <br> providing dynamic 'signature images'
-    <br> showing your latest credit info, project news, etc.",
+    ."<br><br>"
+    .tra("Check out %1various free services%2
+<br> providing dynamic 'signature images'
+<br> showing your latest credit info, project news, etc.", "<a href=http://boinc.berkeley.edu/links.php#sigs>", "</a>"),
     "<textarea name=\"signature\" rows=4 cols=50 id=\"signature\" onkeydown=\"textCounter(this.form.signature, this.form.remLen,$maxlen);\"
     onkeyup=\"textCounter(this.form.signature, this.form.remLen,250);\">".$signature."</textarea>
-    <br><input name=\"remLen\" type=\"text\" id=\"remLen\" value=\"".($maxlen-strlen($signature))."\" size=\"3\" maxlength=\"3\" readonly> chars remaining
-    <br><input type=\"checkbox\" name=\"signature_by_default\" ".$signature_by_default."> Attach signature by default "
+    <br><input name=\"remLen\" type=\"text\" id=\"remLen\" value=\"".($maxlen-strlen($signature))."\" size=\"3\" maxlength=\"3\" readonly> ".tra("characters remaining")."
+    <br><input type=\"checkbox\" name=\"signature_by_default\" ".$signature_by_default."> ".tra("Attach signature by default")
 );
 if ($user->prefs->signature!=""){
-    row2("Signature preview".
-        "<br><span class=note>This is how your signature will look in the forums</span>",
+    row2(tra("Signature preview").
+        "<br><span class=note>".tra("This is how your signature will look in the forums")."</span>",
         output_transform($user->prefs->signature)
     );
 }
 
 // ------------ Message display  -----------
 
-if ($user->prefs->hide_avatars){
-    $forum_hide_avatars = "checked=\"checked\"";
-} else {
-    $forum_hide_avatars = "";
-}
-if ($user->prefs->hide_signatures){
-    $forum_hide_signatures = "checked=\"checked\"";
-} else {
-    $forum_hide_signatures = "";
-}
+$forum_hide_avatars = $user->prefs->hide_avatars?"checked=\"checked\"":"";
+$forum_hide_signatures = $user->prefs->hide_signatures?"checked=\"checked\"":"";
+$forum_link_popup = $user->prefs->link_popup?"checked=\"checked\"":""; 
+$forum_image_as_link = $user->prefs->images_as_links?"checked=\"checked\"":"";
+$forum_jump_to_unread = $user->prefs->jump_to_unread?"checked=\"checked\"":"";
+$forum_ignore_sticky_posts = $user->prefs->ignore_sticky_posts?"checked=\"checked\"":"";
+$forum_highlight_special = $user->prefs->highlight_special?"checked=\"checked\"":"";
 
-if ($user->prefs->link_popup){
-    $forum_link_popup="checked=\"checked\"";
-} else {
-    $forum_link_popup="";
-}
-if ($user->prefs->images_as_links){
-    $forum_image_as_link="checked=\"checked\"";
-} else {
-    $forum_image_as_link="";
-}
-if ($user->prefs->jump_to_unread){
-    $forum_jump_to_unread="checked=\"checked\"";
-} else {
-    $forum_jump_to_unread="";
-}
-if ($user->prefs->ignore_sticky_posts){
-    $forum_ignore_sticky_posts="checked=\"checked\"";
-} else {
-    $forum_ignore_sticky_posts="";
-}
-if ($user->prefs->highlight_special){
-    $forum_highlight_special="checked=\"checked\"";
-} else {
-    $forum_highlight_special="";
-}
-
 $forum_minimum_wrap_postcount = intval($user->prefs->minimum_wrap_postcount);
 $forum_display_wrap_postcount = intval($user->prefs->display_wrap_postcount);
 
-row1("Message display");
+row1(tra("Message display"));
 row2(
-    "What to display",
-    "<input type=\"checkbox\" name=\"forum_hide_avatars\" ".$forum_hide_avatars."> Hide avatar images<br>
-    <input type=\"checkbox\" name=\"forum_hide_signatures\" ".$forum_hide_signatures."> Hide signatures<br>
-    <input type=\"checkbox\" name=\"forum_images_as_links\" ".$forum_image_as_link."> Show images as links<br>
-    <input type=\"checkbox\" name=\"forum_link_popup\" ".$forum_link_popup."> Open links in new window/tab<br>
-    <input type=\"checkbox\" name=\"forum_highlight_special\" ".$forum_highlight_special."> Highlight special users<br>
+    tra("What to display"),
+    "<input type=\"checkbox\" name=\"forum_hide_avatars\" ".$forum_hide_avatars."> ".tra("Hide avatar images")."<br>
+    <input type=\"checkbox\" name=\"forum_hide_signatures\" ".$forum_hide_signatures."> ".tra("Hide signatures")."<br>
+    <input type=\"checkbox\" name=\"forum_images_as_links\" ".$forum_image_as_link."> ".tra("Show images as links")."<br>
+    <input type=\"checkbox\" name=\"forum_link_popup\" ".$forum_link_popup."> ".tra("Open links in new window/tab")."<br>
+    <input type=\"checkbox\" name=\"forum_highlight_special\" ".$forum_highlight_special."> ".tra("Highlight special users")."<br>
     "
 );
 
-row2("How to sort",
-    "Threads: ".select_from_array("forum_sort", $forum_sort_styles, $user->prefs->forum_sorting)."<br>Posts: ".select_from_array("thread_sort", $thread_sort_styles, $user->prefs->thread_sorting)."<br>
-    <input type=\"checkbox\" name=\"forum_jump_to_unread\" ".$forum_jump_to_unread."> Jump to first new post in thread automatically<br>
-    <input type=\"checkbox\" name=\"forum_ignore_sticky_posts\" ".$forum_ignore_sticky_posts.">Do not reorder sticky posts<br>
-    <input type=\"text\" name=\"forum_minimum_wrap_postcount\" size=3 value=\"".$forum_minimum_wrap_postcount."\"> If a thread contains more than this number of posts<br />
-    <input type=\"text\" name=\"forum_display_wrap_postcount\" size=3 value=\"".$forum_display_wrap_postcount."\"> only display the first one and this many of the last ones<br />
+row2(tra("How to sort"),
+    tra("Threads:")." ".select_from_array("forum_sort", $forum_sort_styles, $user->prefs->forum_sorting)."<br>".tra("Posts:")." ".select_from_array("thread_sort", $thread_sort_styles, $user->prefs->thread_sorting)."<br>
+    <input type=\"checkbox\" name=\"forum_jump_to_unread\" ".$forum_jump_to_unread."> ".tra("Jump to first new post in thread automatically")."<br>
+    <input type=\"checkbox\" name=\"forum_ignore_sticky_posts\" ".$forum_ignore_sticky_posts.">".tra("Do not reorder sticky posts")."<br>
+    <input type=\"text\" name=\"forum_minimum_wrap_postcount\" size=3 value=\"".$forum_minimum_wrap_postcount."\"> ".tra("If a thread contains more than this number of posts")."<br />
+    <input type=\"text\" name=\"forum_display_wrap_postcount\" size=3 value=\"".$forum_display_wrap_postcount."\"> ".tra("only display the first one and this many of the last ones")."<br />
     "
 );
 
 // ------------ Message filtering  -----------
 
-row1("Message filtering");
+row1(tra("Message filtering"));
 
 $filtered_userlist = get_ignored_list($user);
 $forum_filtered_userlist = "";
@@ -189,24 +158,24 @@
             echo "Missing user $id";
             continue;
         }
-        $forum_filtered_userlist .= "<input type =\"submit\" name=\"remove".$filtered_user->id."\" value=\"Remove\"> ".$filtered_user->id." - ".user_links($filtered_user)."<br>";
+        $forum_filtered_userlist .= "<input type =\"submit\" name=\"remove".$filtered_user->id."\" value=\"".tra("Remove")."\"> ".$filtered_user->id." - ".user_links($filtered_user)."<br>";
     }
 }
 
-row2("Filtered users".
-    "<br><span class=note>Ignore message board posts and private messages from these  users.</span>",
+row2(tra("Filtered users").
+    "<br><span class=note>".tra("Ignore message board posts and private messages from these users.")."</span>",
     "$forum_filtered_userlist
-        <input type=\"text\" name=\"forum_filter_user\" size=12> User ID (For instance: 123456789)
-        <br><input type=\"submit\" name=\"add_user_to_filter\" value=\"Add user to filter\">
+        <input type=\"text\" name=\"forum_filter_user\" size=12> ".tra("User ID (For instance: 123456789)")."
+        <br><input type=\"submit\" name=\"add_user_to_filter\" value=\"".tra("Add user to filter")."\">
     "
 );
 
-row1("Update");
-row2("Click here to update preferences", "<input type=submit value=\"Update\">");
+row1(tra("Update"));
+row2(tra("Click here to update preferences"), "<input type=submit value=\"".tra("Update")."\">");
 echo "</form>\n";
-row1("Reset");
-row2("Or click here to reset preferences to the defaults",
-    "<form method=\"post\" action=\"edit_forum_preferences_action.php\"><input type=\"submit\" value=\"Reset\"><input type=\"hidden\" name=\"action\" value=\"reset_confirm\"></form>"
+row1(tra("Reset"));
+row2(tra("Or click here to reset preferences to the defaults"),
+    "<form method=\"post\" action=\"edit_forum_preferences_action.php\"><input type=\"submit\" value=\"".tra("Reset")."\"><input type=\"hidden\" name=\"action\" value=\"reset_confirm\"></form>"
 );
 end_table();
 page_tail();
Index: forum_moderate_post.php
===================================================================
--- forum_moderate_post.php	(Revision 24007)
+++ forum_moderate_post.php	(Arbeitskopie)
@@ -37,10 +37,10 @@
     error_page("No action specified");
 }
 if (!is_moderator($logged_in_user, $forum)) {
-    error_page("You are not authorized to moderate this post.");
+    error_page(tra("You are not authorized to moderate this post."));
 }    
 
-page_head('Moderate post');
+page_head(tra("Moderate post"));
 
 echo "<form action=\"forum_moderate_post_action.php?id=".$post->id."\" method=\"POST\">\n";
 echo form_tokens($logged_in_user->authenticator);
@@ -49,60 +49,56 @@
 if (get_str('action')=="hide") {
     //display input that selects reason
     echo "<input type=hidden name=action value=hide>";
-    row1("Hide post");
-    row2("Reason",
+    row1(tra("Hide post"));
+    row2(tra("Reason"),
     "<select name=\"category\">
-    <option value=\"1\">Obscene</option>
-    <option value=\"2\">Flame/Hate mail</option>
-    <option value=\"3\">Commercial spam</option>
-    <option value=\"4\">Doublepost</option>
-    <option value=\"5\">User Request</option>
-    <option value=\"6\">Other</option>
+    <option value=\"1\">".tra("Obscene")."</option>
+    <option value=\"2\">".tra("Flame/Hate mail")."</option>
+    <option value=\"3\">".tra("Commercial spam")."</option>
+    <option value=\"4\">".tra("Doublepost")."</option>
+    <option value=\"5\">".tra("User Request")."</option>
+    <option value=\"6\">".tra("Other")."</option>
 </select>");
 } elseif (get_str('action')=="move") {
-    row1("Move post");
+    row1(tra("Move post"));
     echo "<input type=hidden name=action value=move>";
-    row2("Destination thread ID:", "<input name=\"threadid\">");
-    //todo display where to move the post as a dropdown instead of having to get ID    
+    row2(tra("Destination thread ID:"), "<input name=\"threadid\">");
+    // TODO: display where to move the post as a dropdown instead of having to get ID    
 } elseif (get_str('action')=="banish_user") {
     $userid = get_int('userid');
     $user = BoincUser::lookup_id($userid);
     BoincForumPrefs::lookup($user);
     if (!$user) {
-        error_page("no user");
+        error_page("no user found");
     }
     $x = $user->prefs->banished_until;
     if ($x>time()) {
-        error_page("User is already banished");
+        error_page(tra("User is already banished"));
     }
-    row1("Banish user");
-    row1("Are you sure you want to banish ".$user->name."?
-        This will prevent ".$user->name." from posting for chosen time period.<br />
-        It should be done only if ".$user->name."
-        has consistently exhibited trollish behavior.");
-    row2("Ban duration", "<select name=\"duration\">
-            <option value=\"14400\">4 hours</option>
-            <option value=\"86400\">1 day</option>
-            <option value=\"604800\">1 week</option>
-            <option value=\"1209600\" selected=\"selected\">2 weeks</option>
-            <option value=\"2592000\">1 month</option>
-            <option value=\"-1\">Forever</option>
+    row1(tra("Banish user"));
+    row1(tra("Are you sure you want to banish %1?<br/>This will prevent %1 from posting for chosen time period.<br/>It should be done only if %1 has consistently exhibited trollish behavior.", $user->name));
+    row2(tra("Ban duration"), "<select name=\"duration\">
+            <option value=\"14400\">".tra("4 hours")."</option>
+            <option value=\"86400\">".tra("1 day")."</option>
+            <option value=\"604800\">".tra("1 week")."</option>
+            <option value=\"1209600\" selected=\"selected\">".tra("2 weeks")."</option>
+            <option value=\"2592000\">".tra("1 month")."</option>
+            <option value=\"-1\">".tra("Forever")."</option>
         </select>");
     echo "<input type=\"hidden\" name=\"action\" value=\"banish_user\">\n";
     echo "<input type=\"hidden\" name=\"id\" value=\"".$postid."\">\n";
     echo "<input type=\"hidden\" name=\"userid\" value=\"".$userid."\">\n";
     echo "<input type=\"hidden\" name=\"confirmed\" value=\"yes\">\n";
 } else {
-    error_page( "Unknown action");
+    error_page("Unknown action");
 }
 
-row2("Optional explanation
-    <br><span class=note>This is included in email to user</span>",
+row2(tra("Optional explanation %1 This is included in email to user.%2", "<br><span class=note>", "</span>"),
     "<textarea name=\"reason\" rows=\"10\" cols=\"80\"></textarea>");
 
 row2(
     "",
-    "<input type=\"submit\" name=\"submit\" value=\"OK\">"
+    "<input type=\"submit\" name=\"submit\" value=\"".tra("OK")."\">"
 );
 
 end_table();
Index: profile_menu.php
===================================================================
--- profile_menu.php	(Revision 24007)
+++ profile_menu.php	(Arbeitskopie)
@@ -50,7 +50,7 @@
         $user = lookup_user_id($profile->userid);
         echo uotd_thumbnail($profile, $user);
         echo user_links($user)."<br>";
-        echo sub_sentence(output_transform(strip_tags($profile->response1)), ' ', 150, true);
+        echo sub_sentence(output_transform(sanitize_tags($profile->response1)), ' ', 150, true);
     }
 
 echo "</td></tr>";
Index: team_edit_action.php
===================================================================
--- team_edit_action.php	(Revision 24007)
+++ team_edit_action.php	(Arbeitskopie)
@@ -27,15 +27,15 @@
 $teamid = post_int("teamid");
 $team = BoincTeam::lookup_id($teamid);
 
-if (!$team) error_page(tra("no such team"));
+if (!$team) error_page("no such team");
 require_admin($user, $team);
 
-$team_url = BoincDb::escape_string(strip_tags(post_str("url", true)));
+$team_url = BoincDb::escape_string(sanitize_tags(post_str("url", true)));
 $x = strstr($team_url, "http://");
 if ($x) {
     $team_url = substr($team_url, 7);
 }
-$team_name = BoincDb::escape_string(strip_tags(post_str("name")));
+$team_name = BoincDb::escape_string(sanitize_tags(post_str("name")));
 $team_name_lc = strtolower($team_name);
 
 $tnh = post_str("name_html", true);
@@ -50,7 +50,7 @@
     $country = "International";
 }
 if (!is_valid_country($country)) {
-    error_page(tra("bad country"));
+    error_page("bad country");
 }
 $joinable = post_str('joinable', true)?1:0;
 
