Index: inc/host.inc
===================================================================
--- inc/host.inc	(Revision 20577)
+++ inc/host.inc	(Arbeitskopie)
@@ -21,9 +21,9 @@
 require_once("../inc/boinc_db.inc");
 
 function link_to_results($host) {
-    if (!$host) return "No host";
+    if (!$host) return tra("No host");
     $config = get_config();
-    if (!parse_bool($config, "show_results")) return "Unavailable";
+    if (!parse_bool($config, "show_results")) return tra("Unavailable");
     $nresults = host_nresults($host);
     if (!$nresults) return "0";
     return "<a href=results.php?hostid=$host->id>$nresults</a>";
@@ -52,11 +52,11 @@
         <input type=hidden name=hostid value=$host->id>
         <select name=venue>
         <option value=\"\" $none>---
-        <option value=home $h>Home
-        <option value=work $w>Work
-        <option value=school $s>School
+        <option value=home $h>".tra("Home")."
+        <option value=work $w>".tra("Work")."
+        <option value=school $s>".tra("School")."
         </select>
-        <input type=submit value=Update>
+        <input type=submit value=".tra("Update").">
         </form>
     ";
     return $x;
@@ -80,89 +80,89 @@
 //
 function show_host($host, $user, $ipprivate) {
     start_table();
-    row1("Computer information");
+    row1(tra("Computer information"));
     $anonymous = false;
     if ($user) {
         if ($ipprivate) {
-            row2("IP address", "$host->last_ip_addr<br>(same the last $host->nsame_ip_addr times)");
+            row2(tra("IP address"), "$host->last_ip_addr<br>".tra("(same the last %1 times)", $host->nsame_ip_addr));
             if ($host->last_ip_addr != $host->external_ip_addr) {
-                row2("External IP address", $host->external_ip_addr);
+                row2(tra("External IP address"), $host->external_ip_addr);
             }
         } else { 
-            row2("IP address", "<a href=show_host_detail.php?hostid=$host->id&ipprivate=1>Show IP address</a>");
+            row2(tra("IP address"), "<a href=show_host_detail.php?hostid=$host->id&ipprivate=1>".tra("Show IP address")."</a>");
         }
-        row2("Domain name", $host->domain_name);
+        row2(tra("Domain name"), $host->domain_name);
         $x = $host->timezone/3600;
         if ($x >= 0) $x="+$x";
-        row2("Local Standard Time", "UTC $x hours");
-        row2("Name", $host->domain_name);
+        row2(tra("Local Standard Time"), tra("UTC %1 hours", $x));
+        row2(tra("Name"), $host->domain_name);
     } else {
         $owner = lookup_user_id($host->userid);
         if ($owner && $owner->show_hosts) {
-            row2("Owner", user_links($owner));
+            row2(tra("Owner"), user_links($owner));
         } else {
-            row2("Owner", "Anonymous");
+            row2(tra("Owner"), tra("Anonymous"));
             $anonymous = true;
         }
     }
-    row2("Created", time_str($host->create_time));
-    row2("Total credit", format_credit_large($host->total_credit));
-    row2("Average credit", format_credit($host->expavg_credit));
+    row2(tra("Created"), time_str($host->create_time));
+    row2(tra("Total credit"), format_credit_large($host->total_credit));
+    row2(tra("Average credit"), format_credit($host->expavg_credit));
     if (!$anonymous) {
-        row2("Cross project credit", cross_project_links($host));
+        row2(tra("Cross project credit"), cross_project_links($host));
     }
-    row2("CPU type", "$host->p_vendor <br> $host->p_model");
-    row2("Number of processors", $host->p_ncpus);
+    row2(tra("CPU type"), "$host->p_vendor <br> $host->p_model");
+    row2(tra("Number of processors"), $host->p_ncpus);
     if ($host->serialnum) {
-        row2("Coprocessors", gpu_desc($host->serialnum));
+        row2(tra("Coprocessors"), gpu_desc($host->serialnum));
     }
-    row2("Operating System", "$host->os_name <br> $host->os_version");
+    row2(tra("Operating System"), "$host->os_name <br> $host->os_version");
     $v = boinc_version($host->serialnum);
     if ($v) {
-        row2("BOINC client version", $v);
+        row2(tra("BOINC client version"), $v);
     }
     $x = $host->m_nbytes/(1024*1024);
     $y = round($x, 2);
-    row2("Memory", "$y MB");
+    row2(tra("Memory"), tra("%1 MB", $y));
     $x = $host->m_cache/1024;
     $y = round($x, 2);
-    row2("Cache", "$y KB");
+    row2(tra("Cache"), tra("%1 KB", $y));
 
     if ($user) {
         $x = $host->m_swap/(1024*1024);
         $y = round($x, 2);
-        row2("Swap space", "$y MB");
+        row2(tra("Swap space"), tra("%1 MB", $y));
         $x = $host->d_total/(1024*1024*1024);
         $y = round($x, 2);
-        row2("Total disk space", "$y GB");
+        row2(tra("Total disk space"), tra("%1 GB", $y));
         $x = $host->d_free/(1024*1024*1024);
         $y = round($x, 2);
-        row2("Free Disk Space", "$y GB");
+        row2(tra("Free Disk Space"), tra("%1 GB", $y));
     }
     $x = $host->p_fpops/(1000*1000);
     $y = round($x, 2);
-    row2("Measured floating point speed", "$y million ops/sec");
+    row2(tra("Measured floating point speed"), tra("%1 million ops/sec", $y));
     $x = $host->p_iops/(1000*1000);
     $y = round($x, 2);
-    row2("Measured integer speed", "$y million ops/sec");
+    row2(tra("Measured integer speed"), tra("%1 million ops/sec", $y));
     $x = $host->n_bwup/(1024);
     $y = round($x, 2);
     if ($y > 0) {
-        row2("Average upload rate", "$y KB/sec");
+        row2(tra("Average upload rate"), tra("%1 KB/sec", $y));
     } else {
-        row2("Average upload rate", "Unknown");
+        row2(tra("Average upload rate"), tra("Unknown"));
     }
     $x = $host->n_bwdown/(1024);
     $y = round($x, 2);
     if ($y > 0) {
-        row2("Average download rate", "$y KB/sec");
+        row2(tra("Average download rate"), tra("%1 KB/sec", $y));
     } else {
-        row2("Average download rate", "Unknown");
+        row2(tra("Average download rate"), tra("Unknown"));
     }
     $x = $host->avg_turnaround/86400;
-    row2("Average turnaround time", round($x, 2)." days");
+    row2(tra("Average turnaround time"), tra("%1 days", round($x, 2)));
     $mrd= $host->max_results_day;
-    row2("Maximum daily WU quota per CPU", $mrd."/day");
+    row2(tra("Maximum daily WU quota per CPU"), tra("%1/day", $mrd));
     $config = get_config();
     if (parse_bool($config, "show_results")) {
         $nresults = host_nresults($host);
@@ -171,30 +171,30 @@
         } else {
             $results = "0";
         }
-        row2("Tasks", $results);
+        row2(tra("Tasks"), $results);
     }
 
     if ($user) {
-        row2("Number of times client has contacted server", $host->rpc_seqno);
-        row2("Last time contacted server", sched_log_link($host->rpc_time));
-        row2("% of time BOINC client is running", 100*$host->on_frac." %");
+        row2(tra("Number of times client has contacted server"), $host->rpc_seqno);
+        row2(tra("Last time contacted server"), sched_log_link($host->rpc_time));
+        row2(tra("% of time BOINC client is running"), 100*$host->on_frac." %");
         if ($host->connected_frac > 0) {
-            row2("While BOINC running, % of time host has an Internet connection", 100*$host->connected_frac." %");
+            row2(tra("While BOINC running, % of time host has an Internet connection"), 100*$host->connected_frac." %");
         }
-        row2("While BOINC running, % of time work is allowed", 100*$host->active_frac." %");
+        row2(tra("While BOINC running, % of time work is allowed"), 100*$host->active_frac." %");
         if ($host->cpu_efficiency) {
-            row2("Average CPU efficiency", $host->cpu_efficiency);
+            row2(tra("Average CPU efficiency"), $host->cpu_efficiency);
         }
         if ($host->duration_correction_factor) {
-            row2("Task duration correction factor", $host->duration_correction_factor);
+            row2(tra("Task duration correction factor"), $host->duration_correction_factor);
         }
-        row2("Location", location_form($host));
+        row2(tra("Location"), location_form($host));
         if ($nresults == 0) {
-            $x = " | <a href=host_delete.php?hostid=$host->id".url_tokens($user->authenticator).">Delete this computer</a> ";
+            $x = " | <a href=host_delete.php?hostid=$host->id".url_tokens($user->authenticator).">".tra("Delete this computer")."</a> ";
         } else {
             $x = "";
         }
-        row2("Click to", "<a href=host_edit_form.php?hostid=$host->id>Merge this computer</a> $x");
+        row2(tra("Click to"), "<a href=host_edit_form.php?hostid=$host->id>".tra("Merge this computer")."</a> $x");
         //row2("Click to", "<a href=host_update_credit.php?hostid=$host->id>recompute credit</a>");
     }
     echo "</table>\n";
@@ -208,25 +208,25 @@
     shuffle($host_sites);
     start_table();
     echo "<tr>";
-    echo "<th>Computer info</th>\n";
-    echo "<th>Rank</th>";
-    echo "<th>Owner</th>\n";
+    echo "<th>".tra("Computer info")."</th>\n";
+    echo "<th>".tra("Rank")."</th>";
+    echo "<th>".tra("Owner")."</th>\n";
     if ($sort_by == 'total_credit') {
         echo "
-            <th><a href=top_hosts.php?sort_by=expavg_credit>Avg. credit</a></th>
-            <th>Total credit</th>
+            <th><a href=top_hosts.php?sort_by=expavg_credit>".tra("Avg. credit")."</a></th>
+            <th>".tra("Total credit")."</th>
         ";
     } else {
         echo "
-            <th>Recent average credit</th>
-            <th><a href=top_hosts.php?sort_by=total_credit>Total credit</a></th>
+            <th>".tra("Recent average credit")."</th>
+            <th><a href=top_hosts.php?sort_by=total_credit>".tra("Total credit")."</a></th>
         ";
     }
     echo "
-        <th>BOINC version</th>
-        <th>CPU</th>
-        <th>GPU</th>
-        <th>Operating system</th>
+        <th>".tra("BOINC version")."</th>
+        <th>".tra("CPU")."</th>
+        <th>".tra("GPU")."</th>
+        <th>".tra("Operating system")."</th>
         </tr>
     ";
 }
@@ -278,7 +278,7 @@
 }
 
 function cpu_desc($host) {
-    return "$host->p_vendor<br>$host->p_model<br>($host->p_ncpus processors)\n";
+    return "$host->p_vendor<br>$host->p_model<br>".tra("(%1 processors)", $host->p_ncpus)."\n";
 }
 
 // If private is true, we're showing the host to its owner,
@@ -298,12 +298,12 @@
         }
     }
     echo "<tr class=row$j><td>ID: $host->id
-        <br><a href=show_host_detail.php?hostid=$host->id>Details</a> |
-        <a href=results.php?hostid=$host->id>Tasks</a>
+        <br><a href=show_host_detail.php?hostid=$host->id>".tra("Details")."</a> |
+        <a href=results.php?hostid=$host->id>".tra("Tasks")."</a>
     ";
     if (!$anonymous) {
         echo "
-            <br><nobr><span class=note>Cross-project stats:</span></nobr><br>".cross_project_links($host);
+            <br><nobr><span class=note>".tra("Cross-project stats:")."</span></nobr><br>".cross_project_links($host);
     }
     echo "
         </td>
@@ -315,7 +315,7 @@
         echo "<td>$i</td>\n";
         if ($show_owner) {
             if ($anonymous) {
-                echo "<td>Anonymous</td>\n";
+                echo "<td>".tra("Anonymous")."</td>\n";
             } else {
                 echo "<td>", user_links($user), "</td>\n";
             }
@@ -363,7 +363,7 @@
     echo "</tr>\n";
 }
 
-// return true iff it's possible that the hosts are actually
+// return true if it's possible that the hosts are actually
 // the same machine
 //
 function ghz($x) {
@@ -457,20 +457,20 @@
                 $r1 = date_str($host1->rpc_time);
                 $c2 = date_str($host2->create_time);
                 $r2 = date_str($host2->rpc_time);
-                echo "<br>Host $host2->id has overlapping lifetime ($c1 - $r1), ($c2 - $r2)";
+                echo "<br>".tra("Host %1 has overlapping lifetime:", $host2->id)." ($c1 - $r1), ($c2 - $r2)";
             }
             return false;
         }
     }
     if (!os_compatible($host1, $host2)) {
         if ($show_detail) {
-            echo "<br>Host $host2->id has incompatible OS: ($host1->os_name, $host2->os_name)\n";
+            echo "<br>".tra("Host %1 has an incompatible OS:", $host2->id)." ($host1->os_name, $host2->os_name)\n";
         }
         return false;
     }
     if (!cpus_compatible($host1, $host2)) {
         if ($show_detail) {
-            echo "<br>Host $host2->id: CPU not compatible ($host1->p_vendor $host1->p_model, $host2->p_vendor $host2->p_model)\n";
+            echo "<br>".tra("Host %1 has an incompatible CPU:", $host2->id)." ($host1->p_vendor $host1->p_model, $host2->p_vendor $host2->p_model)\n";
         }
         return false;
     }
@@ -537,13 +537,13 @@
 //
 function merge_hosts($old_host, $new_host) {
     if ($old_host->id == $new_host->id) {
-        return "same host";
+        return tra("same host");
     }
     if (!hosts_compatible($old_host, $new_host, false)) {
-        return "Can't merge host $old_host->id into $new_host->id - they're incompatible";
+        return tra("Can't merge host %1 into %2 - they're incompatible", $old_host->id, $new_host->id);
     }
 
-    echo "<br>Merging host $old_host->id into host $new_host->id\n";
+    echo "<br>".tra("Merging host %1 into host %2", $old_host->id, $new_host->id)."\n";
 
     // decay the average credit of both hosts
     //
@@ -560,18 +560,18 @@
     $recent_credit = $old_host->expavg_credit + $new_host->expavg_credit;
     $result = $new_host->update("total_credit=$total_credit, expavg_credit=$recent_credit, expavg_time=$now");
     if (!$result) {
-        return "Couldn't update credit of new computer";
+        return tra("Couldn't update credit of new computer");
     }
     $result = BoincResult::update_aux("hostid=$new_host->id where hostid=$old_host->id");
     if (!$result) {
-        return "Couldn't update results";
+        return tra("Couldn't update results");
     }
 
     $result = $old_host->update("total_credit=0, expavg_credit=0, userid=0, rpc_seqno=$new_host->id");
     if (!$result) {
-        return "Couldn't retire old computer";
+        return tra("Couldn't retire old computer");
     }
-    echo "<br>Retired old computer $old_host->id\n";
+    echo "<br>".tra("Retired old computer %1", $old_host->id)."\n";
     return 0;
 }
 
@@ -594,10 +594,10 @@
     echo "<p>";
     if ($show_all) {
         $url = link_url($sort, $rev, 0);
-        echo "Show: All computers | <a href=$url>Only computers active in past 30 days</a>";
+        echo tra("Show:")." ".tra("All computers")." | <a href=$url>".tra("Only computers active in past 30 days")."</a>";
     } else {
         $url = link_url($sort, $rev, 1);
-        echo "Show: <a href=$url>All computers</a> | Only computers active in past 30 days";
+        echo tra("Show:")." <a href=$url>".tra("All computers")."</a> | ".tra("Only computers active in past 30 days");
     }
     echo "<p>";
 }
@@ -606,27 +606,27 @@
     start_table();
     echo "<tr>";
     $url = link_url_rev($sort, "id", $rev, $show_all);
-    echo "<th><a href=$url>Computer ID</a></th>\n";
+    echo "<th><a href=$url>".tra("Computer ID")."</a></th>\n";
     if ($private) {
         $url = link_url_rev($sort, "name", $rev, $show_all);
-        echo "<th><a href=$url>Name</a></th>\n";
+        echo "<th><a href=$url>".tra("Name")."</a></th>\n";
         $url = link_url_rev($sort, "venue", $rev, $show_all);
-        echo "<th><a href=$url>Location</th>\n";
+        echo "<th><a href=$url>".tra("Location")."</th>\n";
     } else {
-        echo "<th>Rank</th>";
+        echo "<th>".tra("Rank")."</th>";
     }
     $url = link_url_rev($sort, "expavg_credit", $rev, $show_all);
-    echo "<th><a href=$url>Avg. credit</a></th>\n";
+    echo "<th><a href=$url>".tra("Avg. credit")."</a></th>\n";
     $url = link_url_rev($sort, "total_credit", $rev, $show_all);
-    echo "<th><a href=$url>Total credit</a></th>\n";
-    echo "<th>BOINC<br>version</th>\n";
+    echo "<th><a href=$url>".tra("Total credit")."</a></th>\n";
+    echo "<th>".tra("BOINC<br>version")."</th>\n";
     $url = link_url_rev($sort, "cpu", $rev, $show_all);
-    echo "<th><a href=$url>CPU</a></th>\n";
-    echo "<th>GPU</th>\n";
+    echo "<th><a href=$url>".tra("CPU")."</a></th>\n";
+    echo "<th>".tra("GPU")."</th>\n";
     $url = link_url_rev($sort, "os", $rev, $show_all);
-    echo "<th><a href=$url>Operating System</a></th>\n";
+    echo "<th><a href=$url>".tra("Operating System")."</a></th>\n";
     $url = link_url_rev($sort, "rpc_time", $rev, $show_all);
-    echo "<th><a href=$url>Last contact</a></th>\n";
+    echo "<th><a href=$url>".tra("Last contact")."</a></th>\n";
 }
 
 function show_user_hosts($userid, $private, $show_all, $sort, $rev) {
@@ -675,7 +675,7 @@
 
     if ($private) {
         echo "
-            <a href=merge_by_name.php>Merge computers by name</a>
+            <a href=merge_by_name.php>".tra("Merge computers by name")."</a>
         ";
     }
 }
Index: inc/profile.inc
===================================================================
--- inc/profile.inc	(Revision 20577)
+++ inc/profile.inc	(Arbeitskopie)
@@ -83,16 +83,13 @@
     if ($verify_flag == 0) {
         return "
             <font size='+2' color='#33cc33'>
-            Your profile will be made visible to other people<br>
-            as soon as it has been approved by the project.<br>
-            This may take up to a few days.<br>
+            ".tra("Your profile will be made visible to other people as soon as it has been approved by the project. This may take up to a few days.")."
             </font>
         ";
     } else if ($verify_flag == -1) {
         return "
             <font size='+2' color='#ff3333'>
-            Your profile has been marked as unacceptable.<br>
-            It is not visible to other people. Please change it.<br>
+            ".tra("Your profile has been marked as unacceptable. It is not visible to other people. Please change it.")."
             </font>
         ";
     }
@@ -167,7 +164,7 @@
     $user = get_user_from_id($profile->userid);
 
     if (!$user || !$profile) {
-        echo "Database error!";  // Change this to a standard error page.
+        error_page(tra("Database error"));
         exit();
     }
 
@@ -187,11 +184,11 @@
     $min_credit = parse_config(get_config(), "<profile_min_credit>");
     if (!$logged_in_user && $min_credit && $user->expavg_credit < $min_credit ) {
         error_page(
-           "To prevent spam, profiles of users with an average credit of less than $min_credit are displayed only to logged-in users.  We apologize for this inconvenience."
+           tra("To prevent spam, profiles of users with an average credit of less than %1 are displayed only to logged-in users.  We apologize for this inconvenience.", $min_credit)
         );
     }
     if (is_banished($user)) {
-        error_page("User is banished");
+        error_page(tra("User is banished"));
     }
 
 }
@@ -205,7 +202,7 @@
     BoincForumPrefs::lookup($user);
     $profile = BoincProfile::lookup("userid = $user->id");
     if (!$profile) {
-        row1("No profile exists for that user ID.");
+        row1(tra("No profile exists for that user ID."));
         $user->update("has_profile = 0");
         return;
     }
Index: user/view_profile.php
===================================================================
--- user/view_profile.php	(Revision 20577)
+++ user/view_profile.php	(Arbeitskopie)
@@ -41,7 +41,7 @@
     set_cache_data(serialize($community_links_object), $cache_args);
 }
 
-page_head("Profile: $user->name");
+page_head(tra("Profile: %1", $user->name));
 
 start_table();
 echo "<tr><td valign=\"top\">";
Index: user/validate_email_addr.php
===================================================================
--- user/validate_email_addr.php	(Revision 20577)
+++ user/validate_email_addr.php	(Arbeitskopie)
@@ -27,16 +27,12 @@
     $user->update("signature='$x2'");
     send_email(
         $user,
-        "Validate BOINC email address",
-        "Please visit the following link to validate the email address\n"
-        ."of your ".PROJECT." account:\n"
-        .$master_url."validate_email_addr.php?validate=1&u=$user->id&x=$x2"
+        tra("Validate BOINC email address"),
+        tra("Please visit the following link to validate the email address of your %1 account:", PROJECT)
+        ."\n".$master_url."validate_email_addr.php?validate=1&u=$user->id&x=$x2"
     );
-    page_head("Validate email sent");
-    echo "
-        An email has been sent to $user->email_addr.
-        Visit the link it contains to validate your email address.
-    ";
+    page_head(tra("Validate email sent"));
+    echo tra("An email has been sent to %1. Visit the link it contains to validate your email address.", $user->email_addr);
     page_tail();
 }
 
@@ -45,23 +41,21 @@
     $u = get_int("u");
     $user = lookup_user_id($u);
     if (!$user) {
-        error_page("No such user.\n");
+        error_page(tra("No such user."));
     }
 
     $x2 = $user->signature;
     if ($x2 != $x) {
-        error_page("Error in URL data - can't validate email address");
+        error_page(tra("Error in URL data - can't validate email address"));
     }
 
     $result = $user->update("email_validated=1");
     if (!$result) {
-        error_page("Database update failed - please try again later.");
+        error_page(tra("Database update failed - please try again later."));
     }
 
-    page_head("Validate email address");
-    echo "
-        The email address of your account has been validated.
-    ";
+    page_head(tra("Validate email address"));
+    echo tra("The email address of your account has been validated.");
     page_tail();
 }
 
Index: user/userw.php
===================================================================
--- user/userw.php	(Revision 20577)
+++ user/userw.php	(Arbeitskopie)
@@ -32,23 +32,23 @@
 function show_user_wap($user) {
    wap_begin();
    if (!$user) {
-      echo "<br/>User not found!<br/>";
+      echo "<br/>".tra("User not found!")."<br/>";
       wap_end();
       return;
    }
 
     // keep a 'running tab' in wapstr in case exceeds 1K WAP limit
 
-    $wapstr = PROJECT . "<br/>Account Data<br/>for $user->name<br/>Time: " . wap_timestamp();
+    $wapstr = PROJECT . "<br/>".tra("Account Data<br/>for %1<br/>Time:", $user->name)." " . wap_timestamp();
     $wapstr .= show_credit_wap($user);
     if ($user->teamid) {
         $team = BoincTeam::lookup_id($user->teamid);
-        $wapstr .= "<br/>Team: $team->name<br/>";
-        $wapstr .= "Team TotCred: " . format_credit($team->total_credit) . "<br/>";
-        $wapstr .= "Team AvgCred: " . format_credit($team->expavg_credit) . "<br/>";
+        $wapstr .= "<br/>".tra("Team:")." $team->name<br/>";
+        $wapstr .= tra("Team TotCred:")." " . format_credit($team->total_credit) . "<br/>";
+        $wapstr .= tra("Team AvgCred:")." " . format_credit($team->expavg_credit) . "<br/>";
 
     } else {
-        $wapstr .= "<br/>Team: None<br/>";
+        $wapstr .= "<br/>".tra("Team: None")."<br/>";
     }
 
    // don't want to send more than 1KB probably?
@@ -67,9 +67,6 @@
 start_cache(USER_PAGE_TTL, $cache_args);
 
 $user = BoincUser::lookup_id($userid);
-if (!$user) {
-    error_page("No such user");
-}
 show_user_wap($user);
 
 end_cache(USER_PAGE_TTL, $cache_args);
