Ticket #1129: diff of user section.diff

File diff of user section.diff, 129.7 KB (added by Christian Beer, 13 years ago)

Complete diff of the user/ folder

  • forum_banishment_vote.php

     
    3232}
    3333if (!$logged_in_user->prefs->privilege(S_MODERATOR)) {
    3434    // Can't moderate without being moderator
    35     error_page("You are not authorized to banish users.");
     35    error_page(tra("You are not authorized to banish users."));
    3636}   
    3737
    3838$userid = get_int('userid');
    3939$user = BoincUser::lookup_id($userid);
    4040
    41 page_head('Banishment Vote');
     41page_head(tra("Banishment Vote"));
    4242
    4343echo "<form action=\"forum_banishment_vote_action.php?userid=".$userid."\" method=\"POST\">\n";
    4444echo form_tokens($logged_in_user->authenticator);
    4545start_table();
    46 row1("Banishment Vote");
     46row1(tra("Banishment Vote"));
    4747
    4848if (get_str('action')=="start") {
    4949    if (!$user) {
    50         error_page("no user");
     50        error_page(tra("No user with this ID found."));
    5151    }
    5252    $x = $user->banished_until;
    5353    if ($x>time()) {
    54         error_page("User is already banished");
     54        error_page(tra("User is already banished"));
    5555    }
    5656    //display input that selects reason
    5757    echo "<input type=hidden name=action value=start>";
    5858    echo "<input type=\"hidden\" name=\"userid\" value=\"".$userid."\">\n";
    59     row1("Are you sure you want to banish ".$user->name."?
    60         This will prevent ".$user->name." from posting for chosen time period.<br />
    61         It should be done only if ".$user->name."
    62         has consistently exhibited trollish behavior.");
     59    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));
    6360    row2("",
    64     "Select the reason category, optionally write a longer description of why the user should be banished.");
    65     row2("Category",
     61    tra("Select the reason category, optionally write a longer description of why the user should be banished."));
     62    row2(tra("Category"),
    6663    "<select name=\"category\">
    67     <option value=\"1\">Obscene</option>
    68     <option value=\"2\">Flame/Hate mail</option>
    69     <option value=\"3\">User Request</option>
    70     <option value=\"4\">Other</option>
     64    <option value=\"1\">".tra("Obscene")."</option>
     65    <option value=\"2\">".tra("Flame/Hate mail")."</option>
     66    <option value=\"3\">".tra("User Request")."</option>
     67    <option value=\"4\">".tra("Other")."</option>
    7168</select>");
    72 row2("Reason<br>Mailed if nonempty",
     69row2(tra("Reason")."<br>".tra("Mailed if nonempty"),
    7370    "<textarea name=\"reason\" rows=\"10\" cols=\"80\"></textarea>");
    7471
    7572row2(
    7673    "",
    77     "<input type=\"submit\" name=\"submit\" value=\"Proceed with vote\">"
     74    "<input type=\"submit\" name=\"submit\" value=\"".tra("Proceed with vote")."\">"
    7875);
    7976} elseif (get_str('action')=="yes") {
    8077    vote_yes($config,$logged_in_user,$user);
    8178} elseif (get_str('action')=="no") {
    8279    vote_no($config,$logged_in_user,$user);
    8380} else {
    84     error_page( "Unknown action");
     81    error_page("Unknown action");
    8582}
    8683
    87 
    8884end_table();
    8985
    9086echo "</form>";
  • forum_post.php

     
    3737$forum = BoincForum::lookup_id($forumid);
    3838
    3939if (!user_can_create_thread($logged_in_user, $forum)) {
    40     error_page(
    41         "Only project admins may create a thread here.
    42         However, you may reply existing threads."
    43     );
     40    error_page(tra("Only project admins may create a thread here. However, you may reply existing threads."));
    4441}
    4542check_post_access($logged_in_user, $forum);
    4643
     
    6057    }
    6158    check_tokens($logged_in_user->authenticator);
    6259    if (!akismet_check($logged_in_user, $content)) {
    63         $warning = "Your message was flagged as spam by the Akismet
    64             anti-spam system.  Please modify your text and try again.
    65         ";
     60        $warning = tra("Your message was flagged as spam by the Akismet anti-spam system. Please modify your text and try again.");
    6661        $preview = tra("Preview");
    6762    } else {
    6863        $thread = create_thread(
     
    7267    }
    7368}
    7469
    75 page_head('Create new thread','','','', $bbcode_js);
     70page_head(tra("Create new thread"),'','','', $bbcode_js);
    7671show_forum_header($logged_in_user);
    7772
    7873if ($warning) {
     
    107102$body_help = "";
    108103
    109104if ($content && !$title) {
    110     $submit_help = "<br /><font color=\"red\">Remember to add a title</font>";
     105    $submit_help = "<br /><font color=\"red\">".tra("Remember to add a title")."</font>";
    111106}
    112107
    113108if ($force_title && $title){
     
    129124}
    130125
    131126if (is_news_forum($forum)) {
    132     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>");
     127    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>");
    133128}
    134129row2("", "<input name=\"add_signature\" value=\"add_it\" ".$enable_signature." type=\"checkbox\"> ".tra("Add my signature to this post"));
    135 row2("", "<input type=\"submit\" name=\"preview\" value=\"".tra("Preview")."\"> <input type=\"submit\" value=\"OK\">");
     130row2("", "<input type=\"submit\" name=\"preview\" value=\"".tra("Preview")."\"> <input type=\"submit\" value=\"".tra("OK")."\">");
    136131
    137132
    138133end_table();
  • edit_passwd_action.php

     
    3030$passwd2 = post_str("passwd2");
    3131
    3232if ($passwd != $passwd2) {
    33     error_page("New passwords are different");
     33    error_page(tra("New passwords are different"));
    3434}
    3535
    3636$config = get_config();
     
    3838if (!$min_passwd_length) $min_passwd_length = 6;
    3939
    4040if (!is_ascii($passwd)) {
    41     error_page("Passwords may only include ASCII characters.");
     41    error_page(tra("Passwords may only include ASCII characters."));
    4242}
    4343
    4444if (strlen($passwd)<$min_passwd_length) {
    45     error_page(
    46         "New password is too short:
    47         minimum password length is $min_passwd_length characters."
    48     );
     45    error_page(tra("New password is too short: minimum password length is %1 characters.", $min_passwd_length));
    4946}
    5047if ($auth) {
    5148    $user = lookup_user_auth($auth);
    5249    if (!$user) {
    53         error_page("Invalid account key");
     50        error_page(tra("Invalid account key"));
    5451    }
    5552} else {
    5653    $user = lookup_user_email_addr($email_addr);
    5754    if (!$user) {
    58         error_page("No account with that email address was found");
     55        error_page(tra("No account with that email address was found"));
    5956    }
    6057    $passwd_hash = md5($old_passwd.$email_addr);
    6158    if ($user->passwd_hash != $passwd_hash) {
    62         error_page("Invalid password");
     59        error_page(tra("Invalid password"));
    6360    }
    6461}
    6562
    66 page_head("Change password");
     63page_head(tra("Change password"));
    6764$passwd_hash = md5($passwd.$user->email_addr);
    6865$result = $user->update("passwd_hash='$passwd_hash'");
    6966if ($result) {
    70     echo "Your password has been changed.";
     67    echo tra("Your password has been changed.");
    7168} else {
    72     echo "
    73         We can't update your password due to a database problem.
    74         Please try again later.
    75     ";
     69    echo tra("We can't update your password due to a database problem. Please try again later.");
    7670}
    7771
    7872page_tail();
  • login_action.php

     
    2929
    3030// check for email/password case
    3131//
    32 $email_addr = strtolower(strip_tags(post_str("email_addr", true)));
     32$email_addr = strtolower(sanitize_tags(post_str("email_addr", true)));
    3333$passwd = post_str("passwd", true);
    3434
    3535if ($email_addr && $passwd) {
  • delete_account.php

     
    5454if ($cmd == "delete") {
    5555    $retval = delete_account($user);
    5656    if (!$retval) {
    57         error_page("Couldn't delete account");
     57        error_page(tra("Couldn't delete account"));
    5858    } else {
    59         page_head("Account deleted");
    60         echo "
    61             Your account has been deleted.
    62         ";
     59        page_head(tra("Account deleted"));
     60        echo tra("Your account has been deleted.");
    6361        page_tail();
    6462    }
    6563} else {
    66     page_head("Confirm delete account");
     64    page_head(tra("Confirm delete account"));
    6765    echo "
    6866        <table><tr><td>
    69         Deleting your account will remove all of your
    70         personal information from our servers,
    71         including your profile and message-board posts.
    72         No jobs will be issued to any computers attached
    73         to this account.
     67        ".tra("Deleting your account will remove all of your
     68personal information from our servers,
     69including your profile and message-board posts.
     70No jobs will be issued to any computers attached
     71to this account.")."
    7472        <p>
    75         <b>This cannot be undone.
    76         Once your account has been deleted, you cannot get it back.
     73        <b>".tra("This cannot be undone.
     74Once your account has been deleted, you cannot get it back.")."
    7775        <p>
    78         Are you sure you want to delete your account?</b>
     76        ".tra("Are you sure you want to delete your account?")."</b>
    7977        <p>
    8078    ";
    81     show_button("delete_account.php?cmd=delete", "Yes", "Delete this account");
    82     show_button("index.php", "No", "Do not delete this account");
     79    show_button("delete_account.php?cmd=delete", tra("Yes"), tra("Delete this account"));
     80    show_button("index.php", tra("No"), tra("Do not delete this account"));
    8381    echo "</td></tr></table>\n";
    8482
    8583    page_tail();
  • delete_profile.php

     
    2020require_once("../inc/util.inc");
    2121require_once("../inc/profile.inc");
    2222
    23 check_get_args(array("delete"));
     23check_get_args(array("cmd"));
    2424
    2525$user = get_logged_in_user();
    2626
    27 if (isset($_POST['delete']) && $_POST['delete']) {
     27$cmd = get_str("cmd", true);
     28
     29if ($cmd == "delete") {
    2830    $result = delete_profile($user);
    2931    if (!$result) {
    30         error_page("couldn't delete profile - please try again later");
     32        error_page(tra("couldn't delete profile - please try again later"));
    3133    }
    3234    delete_user_pictures($user->id);
    33     page_head("Delete Confirmation");
     35    page_head(tra("Delete Confirmation"));
    3436    $user->update("has_profile=0");
    35     echo "Your profile has been deleted<br>";
     37    echo tra("Your profile has been deleted.")."<br>";
    3638    page_tail();
    3739    exit();
    3840}
    3941
    40 page_head("Profile delete confirmation");
     42page_head(tra("Profile delete confirmation"));
    4143
    42 echo "<form action=", $_SERVER['PHP_SELF'], " method=\"POST\">";
    43 
    4444echo "
    45     <h2>Are you sure?</h2><p>
    46     Deleted profiles are gone forever and cannot be recovered --
    47     you will have to start from scratch
    48     if you want another profile in the future.
     45    <h2>".tra("Are you sure?")."</h2><p>
     46    ".tra("Deleted profiles are gone forever and cannot be recovered --
     47you will have to start from scratch
     48if you want another profile in the future.")."
    4949    <p>
    50     If you're sure, click 'Delete'
    51     to remove your profile from our database.
    52 
     50    ".tra("If you're sure, click 'Delete'
     51to remove your profile from our database.")."
    5352    <p>
    54     <input type=submit name=delete value=Delete>
    55     </form>
    5653";
    57 
     54    show_button("delete_profile.php?cmd=delete", tra("Yes"), tra("Delete my profile"));
     55    show_button("index.php", tra("No"), tra("Do not delete my profile"));
    5856page_tail();
    5957
    6058?>
  • ffmail_action.php

     
    1919require_once("../project/project.inc");
    2020require_once("../inc/email.inc");
    2121
     22$array_get_args = array("preview", "uname", "uemail", "comment", "action");
     23for ($i=0; $i<5; $i++) {
     24    $array_get_args[]= "n$i";
     25    $array_get_args[]= "e$i";
     26}
     27check_get_args($array_get_args);
     28
    2229function replace($toname, $comment, $fromname, $template) {
    2330    $pat = array(
    2431        '/<toname\/>/',
     
    4451
    4552$action = get_str('action');
    4653if ($action=='Preview') {
    47     page_head('Email preview');
    48     echo "Your email will appear as follows:
     54    page_head(tra("Email preview"));
     55    echo tra("Your email will appear as follows:")."
    4956        <hr>
    5057    ";
    5158    echo replace("[Friend's name]", $comment, $uname, $html);
     
    5461
    5562    echo "
    5663        <hr>
    57         <b><a href=ffmail_action.php$args>Send email</a></b>
     64        <b><a href=ffmail_action.php$args>".tra("Send email")."</a></b>
    5865        <p>
    59         [Use your browser's back button to return to message form]
     66        [".tra("Use your browser's back button to return to message form")."]
    6067    ";
    6168    page_tail();
    6269} else {
    63     page_head("Sending emails");
     70    page_head(tra("Sending emails"));
    6471    $found = false;
    6572    for ($i=0; $i<5; $i++) {
    6673        $n = get_str("n$i", true);
     
    8188            $mail->Host = $PHPMAILER_HOST;
    8289            $mail->Mailer = $PHPMAILER_MAILER;
    8390            if ($mail->Send()) {
    84                 echo "<br>email sent successfully to $e\n";
     91                echo "<br>".tra("email sent successfully to %1", $e)."\n";
    8592            } else {
    86                 echo "<br>failed to send email to $e: $mail->ErrorInfo\n";
     93                echo "<br>".tra("failed to send email to %1: %2", $e, $mail->ErrorInfo)."\n";
    8794            }
    8895        }
    8996    }
    9097    if ($found) {
    9198        echo "
    92             <p>
    93             Thanks for telling your friends about ".PROJECT.".
    94         ";
     99            <p>".tra("Thanks for telling your friends about %1", PROJECT);
    95100    } else {
    96         echo "
    97             You forgot to enter your friends' names and/or email addresses;
    98             Please <a href=ffmail_form.php>return to the form</a>
    99             and enter them.
    100         ";
     101        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>");
    101102    }
    102103    page_tail();
    103104}
  • donations.php

     
    2121check_get_args(array());
    2222
    2323if (!defined("PAYPAL_ADDRESS")) {
    24     error_page("This project is not accepting donations.");
     24    error_page(tra("This project is not accepting donations."));
    2525}
    2626
    2727db_init();
     
    3131    $user_id = $logged_in_user->id;
    3232}
    3333
    34 page_head(PROJECT." donations");
     34page_head(tra("%1 donations", PROJECT));
    3535
    3636if (function_exists("donations_intro")) {
    3737    donations_intro();
    3838} else {
    39     echo "<div>This project is accepting donations via
    40         <a href=\"http://www.paypal.com/\">PayPal</a>.</div>
     39    echo "<div>".tra("This project is accepting donations via
     40%1.", "<a href=\"http://www.paypal.com/\">PayPal</a>")."</div>
    4141        <div class=\"smalltext\">
    42         To donate, fill in the amount you want to donate using the field below.
     42        ".tra("To donate, fill in the amount you want to donate using the field below.
    4343        PayPal is accepting multiple currencies
    4444        (Canadian Dollars, Euros, Pounds Sterling, U.S. Dollars,
    4545         Yen, Australian Dollars, New Zealand Dollars,
     
    4949        You can use included currency converter
    5050        to see the donation amount equivalent in different currencies
    5151        (please note that the rates are only estimates
    52          and the actual amount may differ).</div>
     52         and the actual amount may differ).")."</div>
    5353    ";
    5454}
    5555
     
    313313$estimated .= "</select>\n";
    314314$estimated .= "<input name=\"outV\" value=\"0.00\" style=\"text-align: right; width: 80px;\" disabled=\"disabled\">\n";
    315315
    316 echo row2("Amount you would like to donate", $amount);
    317 echo row2("Estimated value in", $estimated);
     316echo row2(tra("Amount you would like to donate"), $amount);
     317echo row2(tra("Estimated value in"), $estimated);
    318318if ($user_id) {
    319     echo row2("Anonymous donation<br><span class=\"smalltext\">Select this if you dont want your name and account number displayed in
    320         donator lists.<br>If not checked, you will be recorded as user ID ".$user_id." (".$logged_in_user->name.")</span>",
    321         "<input type=\"checkbox\" name=\"anonymous\" id=\"anonymous\" value=\"1\"><label for=\"anonymous\">Yes</label>");
     319    $tmp_user_name = $user_id." (".$logged_in_user->name.")";
     320    echo row2(tra("Anonymous donation")."<br><span class=\"smalltext\">".tra("Select this if you dont want your name and account number displayed in
     321donator lists.<br>If not checked, you will be recorded as user ID %1", $tmp_user_name)."</span>",
     322        "<input type=\"checkbox\" name=\"anonymous\" id=\"anonymous\" value=\"1\"><label for=\"anonymous\">".tra("Yes")."</label>");
    322323} else {
    323     echo row2("Anonymous donation<br><span class=\"smalltext\">To assign the donation with your user ID, please log in.",
     324    echo row2(tra("Anonymous donation")."<br><span class=\"smalltext\">".tra("To assign the donation with your user ID, please log in."),
    324325        "<input type=\"checkbox\" name=\"anonymous\" id=\"anonymous\" value=\"1\" checked=\"checked\" disabled=\"disabled\">
    325         <label for=\"anonymous\">Yes</label>");
     326        <label for=\"anonymous\">".tra("Yes")."</label>");
    326327}
    327 echo row2("", "<input type=\"submit\" value=\"Proceed\">");
    328 echo row1("Donations are accepted through<br><img src=\"img/paypal_logo.png\" alt=\"PayPal\">");
     328echo row2("", "<input type=\"submit\" value=\"".tra("Proceed")."\">");
     329echo row1(tra("Donations are accepted through")."<br><img src=\"img/paypal_logo.png\" alt=\"PayPal\">");
    329330end_table();
    330331echo "</form>\n";
    331332
  • host_delete.php

     
    2828$hostid = get_int("hostid");
    2929$host = BoincHost::lookup_id($hostid);
    3030if (!$host || $host->userid != $user->id) {
    31     error_page("We have no record of that computer.");
     31    error_page(tra("We have no record of that computer."));
    3232}
    3333
    3434$nresults = host_nresults($host);
    3535if ($nresults == 0) {
    3636    $host->delete();
    3737} else {
    38     error_page(
    39         "You can not delete our record of this computer because our
    40         database still contains work for it.
    41         You must wait a few days until the work for this computer
    42         has been deleted from the project database."
    43     );
     38    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."));
    4439}
    45 page_head("Delete record of computer");
    46 echo "
    47     Record deleted.
    48     <p><a href=hosts_user.php>Return to list of your computers</a>
     40page_head(tra("Delete record of computer"));
     41echo tra("Record deleted.")."
     42    <p><a href=hosts_user.php>".tra("Return to list of your computers")."</a>
    4943";
    5044page_tail();
    5145
  • forum_moderate_thread.php

     
    2424BoincForumPrefs::lookup($logged_in_user);
    2525
    2626if (!get_str('action')) {
    27     error_page("no action");
     27    error_page("unknown action");
    2828}
    2929$thread = BoincThread::lookup_id(get_int('thread'));
    3030$forum = BoincForum::lookup_id($thread->forum);
    3131       
    3232if (!is_moderator($logged_in_user, $forum)) {
    33     error_page("not authorized");
     33    error_page(tra("not authorized"));
    3434}
    3535
    36 page_head("Moderate thread '$thread->title'");
     36page_head(tra("Moderate thread '%1'", $thread->title));
    3737
    3838echo "<form action=forum_moderate_thread_action.php?thread=$thread->id method=POST>\n";
    3939echo form_tokens($logged_in_user->authenticator);
     
    4545case 'lock':
    4646    echo "<input type=hidden name=action value=$action>";
    4747    row2("",
    48         "Select the reason category, or write a longer description of why you're hiding or locking the thread; then press OK."
     48        tra("Select the reason category, or write a longer description of why you're hiding or locking the thread; then press OK.")
    4949    );
    50     row2("Category",
     50    row2(tra("Category"),
    5151        "<select name=\"category\">
    52         <option value=\"1\">Obscene</option>
    53         <option value=\"2\">Flame/Hate mail</option>
    54         <option value=\"3\">Commercial spam</option>
    55         <option value=\"4\">Other</option>
     52        <option value=\"1\">".tra("Obscene")."</option>
     53        <option value=\"2\">".tra("Flame/Hate mail")."</option>
     54        <option value=\"3\">".tra("Commercial spam")."</option>
     55        <option value=\"4\">".tra("Other")."</option>
    5656        </select>"
    5757    );
    5858    break;
     
    6969    } 
    7070    $selectbox .= '</option>'; 
    7171   
    72     row2("Current forum", $forum->title);
    73     row2("Destination forum", $selectbox); 
     72    row2(tra("Current forum"), $forum->title);
     73    row2(tra("Destination forum"), $selectbox); 
    7474    break;
    7575case 'title':
    7676    echo "<input type=hidden name=action value=title>";
    77     row2("New title:",
     77    row2(tra("New title:"),
    7878        "<input size=80 name=\"newtitle\" value=\"".htmlspecialchars($thread->title)."\">"
    7979    );
    8080    break;
     
    8282    error_page("Unknown action");
    8383}
    8484
    85 row2("Reason<br><span class=note>Mailed if nonempty</span>",
     85row2(tra("Reason")."<br><span class=note>".tra("Mailed if nonempty")."</span>",
    8686    "<textarea rows=10 cols=80 name=\"reason\"></textarea>"
    8787);
    8888
    8989row2(
    9090    "",
    91     "<input type=\"submit\" name=\"submit\" value=\"OK\">"
     91    "<input type=\"submit\" name=\"submit\" value=\"".tra("OK")."\">"
    9292);
    9393
    9494end_table();
  • explain_state.php

     
    2424
    2525switch($field) {
    2626case "result_server_state":
    27     page_head("Server states");
     27    page_head(tra("Server states"));
    2828    echo "
    2929        <p>
    30         A tasks's <b>server state</b> indicates
    31         whether the task has been sent to a computer,
    32         and if so whether the computer has finished it.
    33         Possible values are:
     30        ".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:")."
    3431        <p>
    3532    ";
    3633    start_table();
    37     row2_plain("<b>Inactive</b>",
    38         "The task is not ready to send
    39         (for example, because its input files are unavailable)"
     34    row2_plain("<b>".tra("Inactive")."</b>",
     35        tra("The task is not ready to send (for example, because its input files are unavailable)")
    4036    );
    41     row2_plain("<b>Unsent</b>",
    42         "The task is ready to send, but hasn't been sent yet."
     37    row2_plain("<b>".tra("Unsent")."</b>",
     38        tra("The task is ready to send, but hasn't been sent yet.")
    4339    );
    44     row2_plain("<b>In Progress</b>",
    45         "The task has been sent; waiting for completion."
     40    row2_plain("<b>".tra("In Progress")."</b>",
     41        tra("The task has been sent; waiting for completion.")
    4642    );
    47     row2_plain("<b>Over</b>",
    48         "The task has been sent to a computer and either
    49         it has timed out or the computer has reported its completion."
     43    row2_plain("<b>".tra("Over")."</b>",
     44        tra("The task has been sent to a computer and either it has timed out or the computer has reported its completion.")
    5045    );
    5146    break;
    5247
    5348case "result_outcome":
    54     page_head("Outcomes");
     49    page_head(tra("Outcomes"));
    5550    echo "
    5651        <p>
    57         A tasks's <b>outcome</b> is defined if its server state is <b>over</b>.
    58         Possible values are:
     52        ".tra("A tasks's <b>outcome</b> is defined if its server state is <b>over</b>. Possible values are:")."
    5953        <p>
    6054    ";
    6155    start_table();
    62     row2_plain("<b>Unknown</b>",
    63         "The task was sent to a computer, but the computer has not
    64         yet completed the work and reported the outcome."
     56    row2_plain("<b>".tra("Unknown")."</b>",
     57        tra("The task was sent to a computer, but the computer has not yet completed the work and reported the outcome.")
    6558    );
    66     row2_plain("<b>Success</b>",
    67         "A computer completed and reported the task successfully."
     59    row2_plain("<b>".tra("Success")."</b>",
     60        tra("A computer completed and reported the task successfully.")
    6861    );
    69     row2_plain("<b>Couldn't send</b>",
    70         "The server wasn't able to send the task to a computer
    71         (perhaps because its resource requirements were too large)"
     62    row2_plain("<b>".tra("Couldn't send")."</b>",
     63        tra("The server wasn't able to send the task to a computer (perhaps because its resource requirements were too large)")
    7264    );
    73     row2_plain("<b>Client error</b>",
    74         "The task was sent to a computer and an error occurred."
     65    row2_plain("<b>".tra("Client error")."</b>",
     66        tra("The task was sent to a computer and an error occurred.")
    7567    );
    76     row2_plain("<b>No reply</b>",
    77         "The task was sent to a computer
    78         and no reply was received within the time limit."
     68    row2_plain("<b>".tra("No reply")."</b>",
     69        tra("The task was sent to a computer and no reply was received within the time limit.")
    7970    );
    80     row2_plain("<b>Didn't need</b>",
    81         "The task wasn't sent to a computer because
    82         enough other tasks were completed for this workunit."
     71    row2_plain("<b>".tra("Didn't need")."</b>",
     72        tra("The task wasn't sent to a computer because enough other tasks were completed for this workunit.")
    8373    );
    84     row2_plain("<b>Validate error</b>",
    85         "The task was reported but could not be validated,
    86         typically because the output files were lost on the server."
     74    row2_plain("<b>".tra("Validate error")."</b>",
     75        tra("The task was reported but could not be validated, typically because the output files were lost on the server.")
    8776    );
    8877    break;
    8978
    9079case "result_client_state":
    91     page_head("Client states");
    92     echo "<p>A result's <b>client state</b>
    93         indicates the stage of processing at which an error occurred.
     80    page_head(tra("Client states"));
     81    echo "<p>".tra("A result's <b>client state</b> indicates the stage of processing at which an error occurred.")."
    9482        <p>
    9583    ";
    9684    start_table();
    97     row2_plain("<b>New</b>",
    98         "The computer has not yet completed the task."
     85    row2_plain("<b>".tra("New")."</b>",
     86        tra("The computer has not yet completed the task.")
    9987    );
    100     row2_plain("<b>Done</b>",
    101         "The computer completed the task successfully."
     88    row2_plain("<b>".tra("Done")."</b>",
     89        tra("The computer completed the task successfully.")
    10290    );
    103     row2_plain("<b>Downloading</b>",
    104         "The computer couldn't download the application or input files."
     91    row2_plain("<b>".tra("Downloading")."</b>",
     92        tra("The computer couldn't download the application or input files.")
    10593    );
    106     row2_plain("<b>Computing</b>",
    107         "An error occurred during computation."
     94    row2_plain("<b>".tra("Computing")."</b>",
     95        tra("An error occurred during computation.")
    10896    );
    109     row2_plain("<b>Uploading</b>",
    110         "The computer couldn't upload the output files."
     97    row2_plain("<b>".tra("Uploading")."</b>",
     98        tra("The computer couldn't upload the output files.")
    11199    );
    112100    break;
    113101
    114102case "result_time":
    115     page_head("Time reported and deadline");
     103    page_head(tra("Time reported and deadline"));
    116104    echo "
    117105        <p>
    118         A task's <b>Time reported or deadline</b> field depends
    119         on whether the task has been reported yet:
     106        ".tra("A task's <b>Time reported or deadline</b> field depends on whether the task has been reported yet:")."
    120107        <p>
    121108    ";
    122109    start_table();
    123     row2("Already reported", "The date/time it was reported");
    124     row2("Not reported yet, deadline in the future",
    125         "Deadline, shown in green."
     110    row2(tra("Already reported"), tra("The date/time it was reported"));
     111    row2(tra("Not reported yet, deadline in the future"),
     112        tra("Deadline, shown in green.")
    126113    );
    127     row2("Not reported yet, deadline in the past",
    128         "Deadline, shown in red."
     114    row2(tra("Not reported yet, deadline in the past"),
     115        tra("Deadline, shown in red.")
    129116    );
    130117    break;
    131118
    132119default:
    133     page_head("Unknown field");
     120    page_head(tra("Unknown field"));
    134121}
    135122
    136123end_table();
  • create_account_action.php

     
    2323include_once("../inc/recaptchalib.php");
    2424
    2525function show_error($str) {
    26     page_head("Can't create account");
     26    page_head(tra("Can't create account"));
    2727    echo "$str<br>\n";
    2828    echo BoincDb::error();
    29     echo "<p>Click your browser's <b>Back</b> button to try again.\n<p>\n";
     29    echo "<p>".tra("Click your browser's <b>Back</b> button to try again.")."\n</p>\n";
    3030    page_tail();
    3131    exit();
    3232}
    3333
    3434$config = get_config();
    3535if (parse_bool($config, "disable_account_creation")) {
    36     page_head("Account creation is disabled");
     36    page_head(tra("Account creation is disabled"));
    3737    echo "
    38         <h3>Account creation is disabled</h3>
    39         Sorry, this project has disabled the creation of new accounts.
    40         Please try again later.
     38        <h3>".tra("Account creation is disabled")."</h3>
     39        ".tra("Sorry, this project has disabled the creation of new accounts.
     40Please try again later.")."
    4141    ";
    4242    exit();
    4343}
     
    4848          $_POST["recaptcha_challenge_field"], $_POST["recaptcha_response_field"]
    4949      );
    5050      if (!$resp->is_valid) {
    51           echo "" . tra("Your reCAPTCHA response was not correct. Please try again."). "";
     51          echo tra("Your reCAPTCHA response was not correct. Please try again.");
    5252          return;
    5353      }
    5454  }
     
    6161    $team = lookup_team($teamid);
    6262    $clone_user = lookup_user_id($team->userid);
    6363    if (!$clone_user) {
    64         echo "User $userid not found";
    65         exit();
     64        error_page("User $userid not found");
    6665    }
    6766    $project_prefs = $clone_user->project_prefs;
    6867} else {
     
    8281
    8382$new_name = post_str("new_name");
    8483if (strlen($new_name)==0) {
    85     show_error("You must supply a name for your account");
     84    show_error(tra("You must supply a name for your account"));
    8685}
    87 if ($new_name != strip_tags($new_name)) {
    88     show_error("HTML tags not allowed in name");
     86if ($new_name != sanitize_tags($new_name)) {
     87    show_error(tra("HTML tags not allowed in name"));
    8988}
    9089
    91 $new_email_addr = post_str("new_email_addr");
    92 $new_email_addr = strtolower($new_email_addr);
     90$new_email_addr = strtolower(post_str("new_email_addr"));
    9391if (!is_valid_email_addr($new_email_addr)) {
    94     show_error("Invalid email address:
    95         you must enter a valid address of the form
    96         name@domain"
    97     );
     92    show_error(tra("Invalid email address: you must enter a valid address of the form name@domain"));
    9893}
    9994$user = lookup_user_email_addr($new_email_addr);
    10095if ($user) {
    101     show_error("There's already an account with that email address.");
     96    show_error(tra("There's already an account with that email address."));
    10297}
    10398
    10499$passwd = post_str("passwd");
    105100$passwd2 = post_str("passwd2");
    106101if ($passwd != $passwd2) {
    107     show_error("New passwords are different");
     102    show_error(tra("New passwords are different"));
    108103}
    109104
    110105$min_passwd_length = parse_config($config, "<min_passwd_length>");
    111106if (!$min_passwd_length) $min_passwd_length = 6;
    112107
    113108if (!is_ascii($passwd)) {
    114     show_error("Passwords may only include ASCII characters.");
     109    show_error(tra("Passwords may only include ASCII characters."));
    115110}
    116111
    117112if (strlen($passwd)<$min_passwd_length) {
    118113    show_error(
    119         "New password is too short:
    120         minimum password length is $min_passwd_length characters."
     114        tra("New password is too short: minimum password length is %1 characters.", $min_passwd_length)
    121115    );
    122116}
    123117
     
    128122    $country = "International";
    129123}
    130124if (!is_valid_country($country)) {
    131     echo "bad country";
    132     exit();
     125    error_page("bad country");
    133126}
    134127
    135 $postal_code = post_str("postal_code", true);
     128$postal_code = sanitize_tags(post_str("postal_code", true));
    136129
    137130$user = make_user(
    138131    $new_email_addr, $new_name, $passwd_hash,
    139132    $country, $postal_code, $project_prefs, $teamid
    140133);
    141134if (!$user) {
    142     show_error("Couldn't create account");
     135    show_error(tra("Couldn't create account"));
    143136}
    144137
    145138if(defined('INVITE_CODES')) {
  • forum_search.php

     
    2828
    2929start_table();
    3030echo "<form action=\"forum_search_action.php\" method=\"post\">";
    31 row1("Search query");
    32 row2("Search for keywords:<br />
    33     <span class=\"smalltext\">Posts that contain all the specified words will be displayed</span>",
    34     '<input type="text" style="width: 290px" name="search_keywords" size="30" /><br />
    35     <span class="smalltext">For example: "screensaver freeze"</span>');
    36 row2("Search for author ID:<br />
    37     <span class=\"smalltext\">Only posts by this author will be displayed</span>",
    38     '<input type="text" style="width: 150px" name="search_author" size="10" /><br />
    39     <span class="smalltext">For example: "43214"</span>');
     31row1(tra("Search query"));
     32row2(tra("Search for keywords:")."<br />
     33    <span class=\"smalltext\">".tra("Posts that contain all the specified words will be displayed")."</span>",
     34    "<input type=\"text\" style=\"width: 290px\" name=\search_keywords\" size=\"30\" /><br />
     35    <span class=\"smalltext\">".tra("For example: \"screensaver freeze\"")."</span>");
     36row2(tra("Search for author ID:")."<br />
     37    <span class=\"smalltext\">".tra("Only posts by this author will be displayed")."</span>",
     38    "<input type=\"text\" style=\"width: 150px\" name=\"search_author\" size=\"10\" /><br />
     39    <span class=\"smalltext\">".tra("For example: \"43214\"")."</span>");
    4040
    41 row1("Search options");
    42 row2("Search limits<br />
    43     <span class=\"smalltext\">Search at most this many days back in time</span>",
    44     '<select name="search_max_time">
    45     <option value="1">1 day</option>
    46     <option value="3">3 days</option>
    47     <option value="7">7 days</option>
    48     <option value="15">15 days</option>
    49     <option value="30" selected>30 days</option>
    50     <option value="90">3 months</option>
    51     <option value="180">6 months</option>
    52     <option value="360">1 year</option>
    53     </select>');
     41row1(tra("Search options"));
     42row2(tra("Search limits")."<br />
     43    <span class=\"smalltext\">".tra("Search at most this many days back in time")."</span>",
     44    "<select name=\"search_max_time\">
     45    <option value=\"1\">".tra("1 day")."</option>
     46    <option value=\"3\">".tra("%1 days", "3")."</option>
     47    <option value=\"7\">".tra("%1 days", "7")."</option>
     48    <option value=\"15\">".tra("%1 days", "15")."</option>
     49    <option value=\"30\" selected>".tra("%1 days", "30")."</option>
     50    <option value=\"90\">".tra("%1 months", "3")."</option>
     51    <option value=\"180\">".tra("%1 months", "6")."</option>
     52    <option value=\"360\">".tra("1 year")."</option>
     53    </select>");
    5454
    5555$forumid = null;
    5656if (get_str("forumid",true)){
    5757    $forumid = get_str("forumid");
    5858}
    59 $forumlist="<option value=\"-1\">All</option>";
     59$forumlist="<option value=\"-1\">".tra("All")."</option>";
    6060$categories = BoincCategory::enum();
    6161foreach ($categories as $category) {
    6262    $forums = BoincForum::enum("parent_type=0 and category=$category->id");
     
    6868        }
    6969    }
    7070}
    71 row2("Forum<br />
    72     <span class=\"smalltext\">Only display posts from this forum</span>",
     71row2(tra("Forum")."<br />
     72    <span class=\"smalltext\">".tra("Only display posts from this forum")."</span>",
    7373    '<select name="search_forum">'.$forumlist.'</select');
    7474
    7575$sortlist = null;
     
    8080        $sortlist.="<option value=\"".$id."\">".$style."</option>";
    8181    }
    8282}
    83 row2("Sort by",
     83row2(tra("Sort by"),
    8484    '<select name="search_sort">'.$sortlist.'</select');
    8585
    8686row1("&nbsp;");
    87 row2("","<input type=\"submit\" value=\"Start the search\">");
     87row2("","<input type=\"submit\" value=\"".tra("Start the search")."\">");
    8888echo "</form>";
    8989end_table();
    9090
    9191page_tail();
    92 exit;
    9392
    9493$cvs_version_tracker[]="\$Id$";  //Generated automatically - do not edit
    9594?>
  • bbcode.php

     
    2020
    2121check_get_args(array());
    2222
    23 page_head("BBCode tags");
     23page_head(tra("BBCode tags"));
    2424echo "<p>
    25 BBCode tags let you format text in your profile and message-board postings.
     25".tra("BBCode tags let you format text in your profile and message-board postings.
    2626It's similar to HTML, but simpler. The tags start with a [ (where you would
    27 have used &lt; in HTML) and end with ] (where you would have used &gt; in
    28 HTML).</p>";
     27have used %1 in HTML) and end with ] (where you would have used %2 in
     28HTML).", "&lt;", "&gt;")."</p>";
    2929
    3030start_table();
    31 row1("Examples");
    32 row2_plain("[b]Bold[/b]", "<b>Bold</b>");
    33 row2_plain("[i]Italic[/i]", "<i>Italic</i>");
    34 row2_plain("[u]Underline[/u]", "<u>Underline</u>");
    35 row2_plain("[size=15]Big text[/size]", "<span style=\"font-size: 15px\">Big text</span>");
    36 row2_plain("[color=red]Red text[/color]", "<font color=\"red\">Red text</font></li>");
    37 row2_plain("[url=http://google.com/]Google[/url]", "<a href=\"http://google.com/\">Google</a>");
    38 row2_plain("[quote]Quoted text[/quote]", "use for quoted blocks of text");
    39 row2_plain("[img]http://example.com/pic.jpg[/img]", "use to display an image");
    40 row2_plain("[code]Code snippet here[/code]", "use to display some code");
    41 row2_plain("[pre]Pre-formatted text[/pre]", "use to display pre-formatted (usually monospaced) text");
    42 row2_plain("[list]<br>* Item 1<br>*Item2<br>[/list]", "<ul><li>Item 1</li><li>Item 2</li></ul>");
     31row1(tra("Examples"));
     32row2_plain("[b]".tra("Bold")."[/b]", "<b>".tra("Bold")."</b>");
     33row2_plain("[i]".tra("Italic")."[/i]", "<i>".tra("Italic")."</i>");
     34row2_plain("[u]".tra("Underline")."[/u]", "<u>".tra("Underline")."</u>");
     35row2_plain("[size=15]".tra("Big text")."[/size]", "<span style=\"font-size: 15px\">".tra("Big text")."</span>");
     36row2_plain("[color=red]".tra("Red text")."[/color]", "<font color=\"red\">".tra("Red text")."</font></li>");
     37row2_plain("[url=http://google.com/]".tra("link to website")."[/url]", "<a href=\"http://google.com/\">".tra("link to website")."</a>");
     38row2_plain("[quote]".tra("Quoted text")."[/quote]", tra("use for quoted blocks of text"));
     39row2_plain("[img]http://example.com/pic.jpg[/img]", tra("use to display an image"));
     40row2_plain("[code]".tra("Code snippet here")."[/code]", tra("use to display some code"));
     41row2_plain("[pre]".tra("Pre-formatted text")."[/pre]", tra("use to display pre-formatted (usually monospaced) text"));
     42row2_plain("[list]<br>* ".tra("Item 1")."<br>* ".tra("Item2")."<br>[/list]", "<ul><li>".tra("Item 1")."</li><li>".tra("Item 2")."</li></ul>");
    4343row2_plain("[trac]#1[/trac] or [trac]ticket:1[/trac]",
    44     "use to link to Trac ticket on BOINC website: <a href=\"http://boinc.berkeley.edu/trac/ticket/1\">#1</a>");
     44    tra("use to link to Trac ticket on BOINC website").": <a href=\"http://boinc.berkeley.edu/trac/ticket/1\">#1</a>");
    4545row2_plain("[trac]wiki:WebForum[/trac]",
    46     "use to link to Trac Wiki on BOINC website: <a href=\"http://boinc.berkeley.edu/trac/wiki/WebForum\">WebForum</a>");
     46    tra("use to link to Trac Wiki on BOINC website").": <a href=\"http://boinc.berkeley.edu/trac/wiki/WebForum\">WebForum</a>");
    4747row2_plain("[trac]changeset:12345[/trac]",
    48     "use to link to SVN changeset on BOINC website: <a href=\"http://boinc.berkeley.edu/trac/changeset/12345\">[12345]</a>");
     48    tra("use to link to SVN changeset on BOINC website").": <a href=\"http://boinc.berkeley.edu/trac/changeset/12345\">[12345]</a>");
    4949end_table();
    5050
    5151echo "<p>
    52 If you don't close a tag or don't specify a parameter correctly,
    53 the raw tag itself will display instead of the formatted text.</p>
     52".tra("If you don't close a tag or don't specify a parameter correctly,
     53the raw tag itself will display instead of the formatted text.")."</p>
    5454";
    5555page_tail();
    5656?>
  • forum_thread.php

     
    4444}
    4545
    4646if ($threadid < 1) {
    47     error_page(tra("Invalid thread ID!"));
     47    error_page("Invalid thread ID!");
    4848}
    4949
    5050$thread = BoincThread::lookup_id($threadid);
     
    6666        if ($logged_in_user) {
    6767            remove_subscriptions_forum($logged_in_user->id, $thread->id);
    6868        }
    69         error_page(
    70             tra("This thread has been hidden by moderators")
    71         );
     69        error_page(tra("This thread has been hidden by moderators."));
    7270    }
    7371}
    7472
     
    242240    if ($thread->status) {
    243241        show_button(
    244242            "forum_thread_status.php?action=clear&id=$thread->id",
    245             "Export",
    246             "Export this news item as a Notice"
     243            tra("Export"),
     244            tra("Export this news item as a Notice")
    247245        );
    248246    } else {
    249247        show_button(
    250248            "forum_thread_status.php?action=set&id=$thread->id",
    251             "Don't export",
    252             "Don't export this news item as a Notice"
     249            tra("Don't export"),
     250            tra("Don't export this news item as a Notice")
    253251        );
    254252    }
    255253}
     
    259257    <input type=\"hidden\" name=\"id\" value=\"", $thread->id, "\">" .
    260258    tra("Sort");
    261259echo select_from_array("sort", $thread_sort_styles, $sort_style);
    262 echo "<input type=\"submit\" value=\"Sort\">
     260echo "<input type=\"submit\" value=\"tra(Sort)\">
    263261    </td></tr></table></form>
    264262";
    265263
  • home.php

     
    4242    page_head(tra("Welcome to %1", PROJECT));
    4343    echo "<p>".tra("View and edit your account preferences using the links below.")."</p>\n";
    4444    if ($via_web) {
    45         echo "
    46             <p> If you have not already done so,
    47             <a href=\"http://boinc.berkeley.edu/download.php\">download BOINC client software</a>.</p>
    48         ";
     45        echo "<p> "
     46        .tra("If you have not already done so, %1download BOINC client software%2.", "<a href=\"http://boinc.berkeley.edu/download.php\">", "</a>")."</p>";
    4947    }
    5048} else {
    5149    page_head(tra("Your account"));
  • forum_report_post.php

     
    4242//
    4343
    4444if ($user->total_credit<$forum->rate_min_total_credit || $user->expavg_credit<$forum->rate_min_expavg_credit) {
    45     error_page("You need more average or total credit to report a post.");
     45    error_page(tra("You need more average or total credit to report a post."));
    4646}
    4747
    4848//__-------------- Action part
     
    6161
    6262//__--------------- Display part
    6363if ($success_page==1) {
    64     page_head('Report Registered');
    65     echo "Your report has been recorded.
    66         Thanks for your input.
    67         <p>
    68         A moderator will now look at your report and decide what will happen -
    69         this may take a little while, so please be patient.
    70     ";
    71     echo "<a href=\"forum_thread.php?id=", $thread->id, "#", $post->id, "\">Return to thread</a>";
     64    page_head(tra("Report Registered"));
     65    echo tra("Your report has been recorded. Thanks you for your input.")."<p>"
     66        .tra("A moderator will now look at your report and decide what will happen - this may take a little while, so please be patient");
     67
     68    echo "<a href=\"forum_thread.php?id=", $thread->id, "#", $post->id, "\">".tra("Return to thread")."</a>";
    7269} elseif ($success_page==0){
    73     page_head('Report a forum post');
     70    page_head(".tra(""Report a forum post"").");
    7471    if (!$no_forum_rating) {
    75         echo "<p>Before reporting this post,
    76             consider using the +/- rating system instead.
    77             If enough users rate a post negatively it will eventually be hidden.
    78             <br>You can find the rating system at the bottom of the post.
     72        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>
    7973        ";
    8074    }
    8175    start_forum_table(array(tra("Author"), tra("Message"),""));
    8276    show_post($post, $thread, $forum, $user, 0, 0);
    8377    echo "<form action=\"forum_report_post.php\" method=\"get\">\n";
    8478    echo form_tokens($user->authenticator);
    85     row1("Report post");
    86     row2("Why do you find the post offensive:<br><font size=-1>Please include enough information so that a person that
    87     has not yet read the thread will quickly be able to identify the issue.</font>",
     79    row1(tra("Report post"));
     80    row2(tra("Why do you find the post offensive: %1Please include enough information so that a person that
     81has not yet read the thread will quickly be able to identify the issue.%2", "<span class=\"smalltext\">", "</span>"),
    8882        "<textarea name=\"reason\" rows=12 cols=54></textarea>"
    8983    );
    90     row2("", "<input type=\"submit\" name=\"submit\" value=\"OK\">");
     84    row2("", "<input type=\"submit\" name=\"submit\" value=\"".tra("OK")."\">");
    9185    echo "<input type=\"hidden\" name=\"post\" value=\"".$post->id."\">";
    9286    echo "</form>";
    9387    end_table();
    9488} elseif ($success_page==-1) {
    95     page_head('Report not registered');
    96     echo "<p>Your report could not be recorded.
    97         Please wait a while and try again.
    98         <p>If this is not a temporary error,
    99         please report it to the project developers.
     89    page_head(tra("Report not registered"));
     90    echo "<p>".tra("Your report could not be recorded. Please wait a while and try again.")."</p>
     91        <p>".tra("If this is not a temporary error, please report it to the project developers.")."</p>
    10092    ";
    101     echo "<a href=\"forum_thread.php?id=", $thread->id, "#", $post->id, "\">Return to thread</a>";
     93    echo "<a href=\"forum_thread.php?id=", $thread->id, "#", $post->id, "\">".tra("Return to thread")."</a>";
    10294}
    10395page_tail();
    10496?>
  • account_finish_action.php

     
    2424$name = post_str("name");
    2525
    2626if (strlen($name)==0) {
    27     error_page("You must supply a name for your account");
     27    error_page(tra("You must supply a name for your account"));
    2828}
    29 if ($new_name != strip_tags($new_name)) {
    30     error_page("HTML tags not allowed in name");
     29if ($new_name != sanitize_tags($new_name)) {
     30    error_page(tra("HTML tags not allowed in name"));
    3131}
    3232
    3333$country = post_str("country");
    3434if (!is_valid_country($country)) {
    35     error_page( "invalid country");
     35    error_page("invalid country");
    3636}
    3737$country = BoincDb::escape_string($country);
    38 $postal_code = BoincDb::escape_string(strip_tags(post_str("postal_code", true)));
     38$postal_code = BoincDb::escape_string(sanitize_tags(post_str("postal_code", true)));
    3939$auth = BoincDb::escape_string($auth);
    4040
    4141$name = BoincDb::escape_string($name);
  • get_passwd.php

     
    2222
    2323check_get_args(array());
    2424
    25 page_head("Forgot your account info?");
     25page_head(tra("Forgot your account info?"));
    2626
    27 echo "
    28 <h3>1) If you know your account's email address,
    29     and you can receive email there:</h3>
    30 <p>
    31 Enter the email address below, and click OK.
    32 You will be sent email instructions for resetting your password.
    33 ";
     27echo "<h3>"
     28    .tra("1) If you know your account's email address, and you can receive email there:")."</h3><p>"
     29    .tra("Enter the email address below, and click OK. You will be sent email instructions for resetting your password.");
    3430
    3531$master_url = parse_config(get_config(), "<master_url>");
    3632$x = strstr($master_url, "//");
     
    4137
    4238start_table();
    4339echo "<form method=post action=mail_passwd.php>\n";
    44 row2("Email address","<input type=\"text\" size=40 name=email_addr>");
    45 row2("", "<input type=submit value=OK>");
     40row2(tra("Email address"),"<input type=\"text\" size=40 name=email_addr>");
     41row2("", "<input type=submit value=\"".tra("OK")."\">");
    4642echo "</form>";
    4743end_table();
    4844
    49 echo "
    50 <p>
    51 <h3>2) If you forgot your account's email address,
    52 or you can't receive email there:</h3>
     45echo "<p><h3>"
     46    .tra("2) If you forgot your account's email address, or you can't receive email there:")."</h3>"
     47    .tra("If you have run BOINC under this account, you can still access it. Here's how:")."
    5348
    54 If you have run BOINC under the account,
    55 you can still access it.
    56 Here's how:
    57 
    5849<ul>
    59 <li> Go to the BOINC data directory on your computer
    60 (on Windows this is usually <b>C:\\Documents and Settings\All Users\Application Data\BOINC</b> or <b>C:\\Program Files\BOINC</b>.
    61 <li> Find your account file for this project;
    62 it will be named <b>$account_file</b>.
    63 <li> Open the file in a text editor like Notepad.
    64 You'll see something like
     50<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>.")."
     51<li> ".tra("Find your account file for this project; it will be named <b>%1</b>.", $account_file)."
     52<li> ".tra("Open the file in a text editor like Notepad. You'll see something like")."
    6553<pre>
    6654&lt;account>
    6755    &lt;master_url>http://lhcathome.cern.ch/&lt;/master_url>
     
    7159&lt;/account>
    7260</pre>
    7361
    74 <li> Select and Copy the string between &lt;authenticator>
    75 and &lt;/authenticator>
    76 (<b>8b8496fdd26df7dc0423ecd43c09a56b</b> in the above example).
     62<li> ".tra("Select and Copy the string between %1 and %2 (%3 in the above example).", "&lt;authenticator>", "&lt;/authenticator>", "<b>8b8496fdd26df7dc0423ecd43c09a56b</b>")."
    7763
    78 <li> Paste the string into the field below, and click OK.
    79 <li> You will now be logged in to your account;
    80 update the email and password of your account.
     64<li> ".tra("Paste the string into the field below, and click OK.")."
     65<li> ".tra("You will now be logged in to your account; update the email and password of your account.")."
    8166</ul>
    8267";
    8368start_table();
    8469
    8570echo "<form action=login_action.php method=post>\n";
    86 row2("Log in with authenticator", "<input type=\"text\" name=authenticator size=40>");
    87 row2("Stay logged in on this computer",
     71row2(tra("Log in with authenticator"), "<input type=\"text\" name=authenticator size=40>");
     72row2(tra("Stay logged in on this computer"),
    8873    "<input type=checkbox name=send_cookie checked>"
    8974);
    90 row2("", "<input type=submit value=OK>");
     75row2("", "<input type=submit value=\"".tra("OK")."\">");
    9176echo "</form>";
    9277
    9378end_table();
  • forum_rate.php

     
    2323
    2424$config = get_config();
    2525if (parse_bool($config, "no_forum_rating")) {
    26     page_head("Rating offline");
    27     echo "This function is turned off by the project";
     26    page_head(tra("Rating offline"));
     27    echo tra("This function is turned off by the project");
    2828    page_tail();
    2929    exit(0);
    3030}
     
    5555    // before allowing them to rate a post.
    5656    //
    5757    if ($user->total_credit<$forum->rate_min_total_credit || $user->expavg_credit<$forum->rate_min_expavg_credit) {
    58         error_page("You need more average or total credit to rate a post.");
     58        error_page(tra("You need more average or total credit to rate a post."));
    5959    }
    6060   
    6161    if (BoincPostRating::lookup($user->id, $post->id)) {
    62         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>");
     62        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>");
    6363    } else {
    6464        $success = BoincPostRating::replace($user->id, $post->id, $rating);
    6565        show_result_page($success, $post, $thread, $choice);
     
    6969function show_result_page($success, $post, $thread, $choice) {
    7070    if ($success) {
    7171        if ($choice) {
    72             page_head('Input Recorded');
    73                 echo "Your input has been recorded.  Thanks for your help.";
     72            page_head(tra("Input Recorded"));
     73                echo tra("Your input has been recorded. Thanks for your help.");
    7474        } else {
    75             page_head('Vote Registered');
    76             echo "Your rating has been recorded.  Thanks for your input.";
     75            page_head(tra("Vote Registered"));
     76            echo tra("Your rating has been recorded. Thanks for your input.");
    7777        }
    78         echo "<a href=\"forum_thread.php?nowrap=true&id=", $thread->id, "#", $post->id, "\">Return to thread</a>";
     78        echo "<a href=\"forum_thread.php?nowrap=true&id=", $thread->id, "#", $post->id, "\">".tra("Return to thread")."</a>";
    7979    } else {
    80         page_head('Vote Submission Problem');   
     80        page_head(tra("Vote Submission Problem"));   
    8181        if ($post) {
    82             echo "There was a problem recording your vote in our database.  Please try again later.";
    83             echo "<a href=\"forum_thread.php?id=", $thread->id, "#", $post->id, "\">Return to thread</a>";
     82            echo tra("There was a problem recording your vote in our database. Please try again later.");
     83            echo "<a href=\"forum_thread.php?id=", $thread->id, "#", $post->id, "\">".tra("Return to thread")."</a>";
    8484        } else {
    85             echo "The post you specified does not exist, or your rating was invalid.";
     85            echo tra("The post you specified does not exist, or your rating was invalid.");
    8686        }
    8787    }
    8888    page_tail();
  • host_app_versions.php

     
    2222
    2323function rsc_name($t) {
    2424    switch ($t) {
    25     case 2: return "CPU";
    26     case 3: return "nvidia GPU";
    27     case 4: return "ATI GPU";
     25    case 2: return tra("CPU");
     26    case 3: return tra("nvidia GPU");
     27    case 4: return tra("ATI GPU");
    2828    }
    29     return "Unknown";
     29    return tra("Unknown");
    3030}
    3131
    3232function av_desc($gavid) {
    3333    if ($gavid >= 1000000) {
    3434        $appid = (int)($gavid/1000000);
    3535        $app = BoincApp::lookup_id($appid);
    36         if (!$app) return "Anonymous platform, missing app";
     36        if (!$app) return tra("Anonymous platform, missing app");
    3737        $rsc_type = $gavid % 1000000;
    3838        $r = rsc_name($rsc_type);
    39         return "$app->user_friendly_name (anonymous platform, $r)";
     39        return "$app->user_friendly_name (".tra("anonymous platform").", $r)";
    4040
    4141    } else {
    4242        $av = BoincAppVersion::lookup_id($gavid);
    43         if (!$av) return "Missing app version";
     43        if (!$av) return tra("Missing app version");
    4444        $app = BoincApp::lookup_id($av->appid);
    45         if (!$app) return "Missing app";
     45        if (!$app) return tra("Missing app");
    4646        $platform = BoincPlatform::lookup_id($av->platformid);
    47         if (!$platform) return "Missing platform";
     47        if (!$platform) return tra("Missing platform");
    4848        $pc = (strlen($av->plan_class))?"($av->plan_class)":"";
    4949        $v = number_format($av->version_num/100, 2);
    5050        return "$app->user_friendly_name $v $platform->name $pc";
     
    5353
    5454function show_hav($hav) {
    5555    row1(av_desc($hav->app_version_id));
    56     row2("Number of tasks completed", $hav->pfc_n);
    57     row2("Max tasks per day", $hav->max_jobs_per_day);
    58     row2("Number of tasks today", $hav->n_jobs_today);
    59     row2("Consecutive valid tasks", $hav->consecutive_valid);
     56    row2(tra("Number of tasks completed"), $hav->pfc_n);
     57    row2(tra("Max tasks per day"), $hav->max_jobs_per_day);
     58    row2(tra("Number of tasks today"), $hav->n_jobs_today);
     59    row2(tra("Consecutive valid tasks"), $hav->consecutive_valid);
    6060    $x = number_format($hav->turnaround_avg/86400, 2);
    6161    if ($hav->et_avg) {
    6262        $gflops = 1e-9/$hav->et_avg;
    63         row2("Average processing rate", $gflops);
     63        row2(tra("Average processing rate"), $gflops);
    6464    }
    65     row2("Average turnaround time", "$x days");
     65    row2(tra("Average turnaround time"), "$x days");
    6666}
    6767
    6868$hostid = get_int('hostid');
  • forum_help_desk.php

     
    2424
    2525$user = get_logged_in_user(false);
    2626
    27 page_head("Questions and answers");
     27page_head(tra("Questions and answers"));
    2828
    29 echo "<p>
    30     Talk live via Skype with a volunteer, in any of several languages.
    31     Go to
    32     <a href=\"http://boinc.berkeley.edu/help.php\">BOINC Online Help</a>.</p>
    33 ";
     29echo "<p>".
     30    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>").
     31    "</p>";
    3432
    3533show_forum_header($user);
    3634
     
    4442        show_mark_as_read_button($user);
    4543        start_forum_table(array(
    4644            tra("Topic"),
    47             tra("# Questions"),
     45            tra("Questions"),
    4846            tra("Last post")
    4947        ));
    5048    }
  • friend.php

     
    6161        error_page(tra("You can't be friends with yourself"));
    6262    }
    6363    $destuser = BoincUser::lookup_id($destid);
    64     if (!$destuser) error_page(tra("No such user"));
     64    if (!$destuser) error_page("No such user");
    6565
    6666    check_pending($user, $destuser);
    6767    check_ignoring($user, $destuser);
     
    7171        <form method=post action=friend.php>
    7272        <input type=hidden name=userid value=$destid>
    7373        <input type=hidden name=action value=add_confirm>" .
    74         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.",
    75         "<b>".$destuser->name."</b>","<b>".$destuser->name."</b>") ."
     74        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.",
     75        "<b>".$destuser->name."</b>") ."
    7676        <p>" .
    7777        tra("Add an optional message here:") ."
    7878        <br>
    7979        <textarea name=message cols=64 rows=4></textarea>
    8080        <p>
    81         <input type=submit value=OK>
     81        <input type=submit value=\"".tra("OK")."\">
    8282        </form>
    8383    ";
    8484    page_tail();
     
    8989function handle_add_confirm($user) {
    9090    $destid = post_int('userid');
    9191    $destuser = BoincUser::lookup_id($destid);
    92     if (!$destuser) error_page(tra("No such user"));
     92    if (!$destuser) error_page("No such user");
    9393
    9494    check_pending($user, $destuser);
    9595    check_ignoring($user, $destuser);
    9696
    9797    $msg = post_str('message', true);
    98     if ($msg) $msg = strip_tags(BoincDb::escape_string($msg));
     98    if ($msg) $msg = sanitize_tags(BoincDb::escape_string($msg));
    9999
    100100    $now = time();
    101101    $ret = BoincFriend::replace(
     
    132132    }
    133133    $srcid = get_int('userid');
    134134    $srcuser = BoincUser::lookup_id($srcid);
    135     if (!$srcuser) error_page(tra("No such user"));
     135    if (!$srcuser) error_page("No such user");
    136136    $friend = BoincFriend::lookup($srcid, $user->id);
    137     if (!$friend) error_page(tra("Request not found"));
     137    if (!$friend) error_page("Request not found");
    138138    page_head(tra("Friend request"));
    139139        echo time_str($friend->create_time)."<p>\n";
    140140    $x = user_links($srcuser, true);
     
    155155function handle_accept($user) {
    156156    $srcid = get_int('userid');
    157157    $srcuser = BoincUser::lookup_id($srcid);
    158     if (!$srcuser) error_page(tra("No such user"));
     158    if (!$srcuser) error_page("No such user");
    159159
    160160    $friend = BoincFriend::lookup($srcid, $user->id);
    161161    if (!$friend) {
    162         error_page(tra("No request"));
     162        error_page("No request");
    163163    }
    164164    $friend->update("reciprocated=1");
    165165
    166166    // "accept message" not implemented in interface yet
    167167    $msg = post_str('message', true);
    168     if ($msg) $msg = strip_tags(BoincDb::escape_string($msg));
     168    if ($msg) $msg = sanitize_tags(BoincDb::escape_string($msg));
    169169    $now = time();
    170170    $ret = BoincFriend::replace("user_src=$user->id, user_dest=$srcid, message='$msg', create_time=$now, reciprocated=1");
    171171    if (!$ret) {
     
    213213function handle_accepted($user) {
    214214    $destid = get_int('userid');
    215215    $destuser = BoincUser::lookup_id($destid);
    216     if (!$destuser) error_page(tra("No such user"));
     216    if (!$destuser) error_page("No such user");
    217217    $notify = BoincNotify::lookup($user->id, NOTIFY_FRIEND_ACCEPT, $destid);
    218218    if ($notify) {
    219219        $notify->delete();
     
    228228function handle_cancel_confirm($user) {
    229229    $destid = get_int('userid');
    230230    $destuser = BoincUser::lookup_id($destid);
    231     if (!$destuser) error_page(tra("No such user"));
     231    if (!$destuser) error_page("No such user");
    232232    page_head(tra("Cancel friendship?"));
    233233    echo
    234234        tra("Are you sure you want to cancel your friendship with %1?",
     
    244244function handle_cancel($user) {
    245245    $destid = get_int('userid');
    246246    $destuser = BoincUser::lookup_id($destid);
    247     if (!$destuser) error_page(tra("No such user"));
     247    if (!$destuser) error_page("No such user");
    248248    BoincFriend::delete($user->id, $destid);
    249249    page_head(tra("Friendship cancelled"));
    250250    echo tra("Your friendship with %1 has been cancelled.",$destuser->name);
     
    285285    handle_cancel($user);
    286286    break;
    287287default:
    288     error_page(tra("Unknown action"));
     288    error_page("Unknown action");
    289289}
    290290
    291291?>
  • host_update_credit.php

     
    2525db_init();
    2626$user = get_logged_in_user();
    2727
    28 page_head("Updating computer credit");
     28page_head(tra("Updating computer credit"));
    2929
    3030$hostid = get_int("hostid");
    3131
    3232$host = lookup_host($hostid);
    3333if (!$host || $host->userid != $user->id) {
    34     error_page("We have no record of that computer");
     34    error_page(tra("We have no record of that computer"));
    3535}
    3636
    3737host_update_credit($hostid);
    38 echo "<br>Host credit updated";
     38echo "<br>".tra("Host credit updated");
    3939page_tail();
    4040
    4141?>
  • host_venue_action.php

     
    3030
    3131$host = BoincHost::lookup_id($hostid);
    3232if (!$host) {
    33     error_page("No such host");
     33    error_page(tra("No such host"));
    3434}
    3535if ($host->userid != $user->id) {
    36     error_page("Not your host");
     36    error_page(tra("Not your host"));
    3737}
    3838
    3939$retval = $host->update("venue='$venue'");
    4040if ($retval) {
    41     page_head("Host venue updated");
     41    page_head(tra("Host venue updated"));
    4242    if ($venue == '') {
    43         $venue = '(none)';
     43        $venue = '('.tra("none").')';
    4444    }
    4545    echo "
    46         The venue of this host has been set to <b>$venue</b>.
     46        ".tra("The venue of this host has been set to %1.", "<b>$venue</b>")."
    4747        <p>
    48         This change will take effect the next time the
    49         host communicates with this project.
     48        ".tra("This change will take effect the next time the host communicates with this project.")."
    5049        <p>
    51         <a href=show_host_detail.php?hostid=$hostid>Return to host page</a>.
     50        <a href=show_host_detail.php?hostid=$hostid>".tra("Return to host page")."</a>.
    5251    ";
    5352    page_tail();
    5453} else {
  • host_edit_action.php

     
    2121require_once("../inc/host.inc");
    2222
    2323function fail($msg) {
    24     echo "Error: $msg";
     24    echo tra("Error:")." $msg";
    2525    page_tail();
    2626    exit();
    2727}
     
    2929function get_host($hostid, $user) {
    3030    $host = BoincHost::lookup_id($hostid);
    3131    if (!$host || $host->userid != $user->id) {
    32         fail("We have no record of that computer");
     32        fail(tra("We have no record of that computer"));
    3333    }
    3434    return $host;
    3535}
    3636
    3737$user = get_logged_in_user();
    3838
    39 page_head("Merge computer records");
     39page_head(tra("Merge computer records"));
    4040
    4141$nhosts = get_int("nhosts");
    4242$hostid = get_int("id_0");
     
    6262    $latest_host = BoincHost::lookup_id($latest_host->id);
    6363}
    6464echo "
    65     <p><a href=hosts_user.php>Return to list of your computers</a>
     65    <p><a href=hosts_user.php>".tra("Return to list of your computers")."</a>
    6666";
    6767page_tail();
    6868
  • forum_rss.php

     
    3838if (!$forum) error_page("no such forum");
    3939
    4040if (get_int('setup', true)) {
    41     page_head("$forum->name RSS feed");
    42     echo "
    43         This message board is available as an RSS feed.
    44         Options:
    45         <form action=forum_rss.php>
    46         <input type=hidden name=forumid value=$forumid>
     41    page_head(tra("%1 RSS feed", $forum->title));
     42    echo tra("This message board is available as an RSS feed.")
     43        .tra("Options:")."
     44        <form action=\"forum_rss.php\" method=\"get\">
     45        <input type=\"hidden\" name=\"forumid\" value=\"$forumid\">
    4746        <p>
    48         Include only posts by user ID <input name=userid> (default: all users).
     47        ".tra("Include only posts by user ID %1 (default: all users).", "<input name=\"userid\">")."
    4948        <p>
    50         Include only posts from the last <input name=ndays> days (default: 30).
     49        ".tra("Include only posts from the last %1 days (default: 30).", "<input name=\"ndays\">")."
    5150        <p>
    52         Truncate posts <input type=checkbox name=truncate checked>
     51        ".tra("Truncate posts: %1 (Include only first 265 characters of each post)", "<input type=\"checkbox\" name=\"truncate\" checked>")."
    5352        <p>
    54         Threads only <input type=checkbox name=threads_only>
     53        ".tra("Threads only: %1 (Include only the first post of every thread)", "<input type=\"checkbox\" name=\"threads_only\">")."
    5554        <p>
    56         <input type=submit value=OK>
     55        <input type=\"submit\" value=\"".tra("OK")."\">
    5756    ";
    5857    page_tail();
    5958    exit;
  • ffmail_form.php

     
    1616// You should have received a copy of the GNU Lesser General Public License
    1717// along with BOINC.  If not, see <http://www.gnu.org/licenses/>.
    1818
     19// TODO: - find out if this is used (add some logging mechanism or so)
     20//       - if used rewrite code to use display functions from util.inc
     21//       - if used find a way to give the user a language choice (projects must translate messages themself)
     22
    1923require_once("../inc/util.inc");
    2024
    2125check_get_args(array());
     
    2428$user = get_logged_in_user();
    2529
    2630if (!@file_get_contents('../ops/ffmail/subject')) {
    27     error_page(
    28         'This project hasn\'t created an email message -
    29         please notify its administrators'
    30     );
     31    error_page(tra("This project hasn\'t created an email message - please notify its administrators"));
    3132}
    3233
    33 page_head("Tell your friends about ".PROJECT);
     34page_head(tra("Tell your friends about %1", PROJECT));
    3435
    3536echo "
    3637<table width=600><tr><td>
    37 Help us by telling your friends, family and coworkers about ".PROJECT.".
     38".tra("Help us by telling your friends, family and coworkers about %1", PROJECT)."
    3839<p>
    39 Fill in this form with the names and email addresses
    40 of people you think might be interested in ".PROJECT.".
    41 We'll send them an email in your name,
    42 and you can add your own message if you like.
     40".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)."
    4341<form method=get action=ffmail_action.php>
    4442<table cellpadding=4>
    45 <tr><td class=heading>Your name:</td><td class=heading>Your email address:</td></tr>
     43<tr><td class=heading>".tra("Your name:")."</td><td class=heading>".tra("Your email address:")."</td></tr>
    4644<tr><td><b>$user->name</b></td><td><b>$user->email_addr</b></td></tr>
    4745
    4846<input type=hidden name=uname value=\"$user->name\">
    4947<input type=hidden name=uemail value=\"$user->email_addr\">
    5048
    51 <tr><td class=heading>Friend's name:</td><td class=heading>Friend's email address:</td></tr>
     49<tr><td class=heading>".tra("Friend's name:")."</td><td class=heading>".tra("Friend's email address:")."</td></tr>
    5250";
    5351for ($i=0; $i<5; $i++) {
    5452    echo "
     
    5654    ";
    5755}
    5856echo "
    59 <tr><td class=heading colspan=2>Additional message (optional)</td></tr>
     57<tr><td class=heading colspan=2>".tra("Additional message (optional)")."</td></tr>
    6058<tr><td colspan=2><textarea name=comment rows=8 cols=50></textarea></td></tr>
    61 <tr><td align=center><input type=submit name=action value=Preview></td>
    62     <td align=center><input type=submit name=action value=Send></td>
     59<tr><td align=center><input type=submit name=action value=".tra("Preview")."></td>
     60    <td align=center><input type=submit name=action value=".tra("Send")."></td>
    6361</tr>
    6462</table>
    6563</form>
  • forum_subscribe.php

     
    4343
    4444function subscribe($forum, $thread, $user) {
    4545    if (BoincSubscription::replace($user->id, $thread->id)) {
    46         page_head("Subscription successful");
     46        page_head(tra("Subscription successful"));
    4747        show_forum_header($user);
    4848        show_title($forum, $thread);
    49         echo "<p>You are now subscribed to <b>", cleanup_title($thread->title), "</b>.
    50         You will be notified whenever there is a new post.";
     49        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>");
    5150    } else {
    52         page_head("Subscription failed");
    53         echo "<p>We are currently unable to subscribe you to this thread (<b>", cleanup_title($thread->title), "</b>).
    54         Please try again later..";
     51        page_head(tra("Subscription failed"));
     52        echo "<p>".tra("We are currently unable to subscribe you to %1. Please try again later..", "<b>".cleanup_title($thread->title)."</b>");
    5553    }
    56     echo "</p><p><br /><a href=\"forum_thread.php?id=".$thread->id."\">Return to thread</a></p>";
     54    echo "</p><p><br /><a href=\"forum_thread.php?id=".$thread->id."\">".tra("Return to thread")."</a></p>";
    5755    page_tail();
    5856}
    5957
    6058function unsubscribe($forum, $thread, $user) {
    6159    BoincSubscription::delete($user->id, $thread->id);
    6260    if (!BoincSubscription::lookup($user->id, $thread->id)) {
    63         page_head("Unsubscription successful");
     61        page_head(tra("Unsubscription successful"));
    6462        show_forum_header($user);
    6563        show_title($forum, $thread);
    66         echo "<p>You are no longer subscribed to <b>", cleanup_title($thread->title), "</b>.
    67         You will no longer receive notifications for this thread.";
     64        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>");
    6865    } else {
    69         page_head("Unsubscription failed");
    70         echo "<p>We are currently unable to unsubscribe you to this thread (<b>", cleanup_title($thread->title), "</b>).
    71         Please try again later..";
     66        page_head(tra("Unsubscription failed"));
     67        echo "<p>".tra("We are currently unable to unsubscribe you from %1. Please try again later..", "<b>".cleanup_title($thread->title)."</b>");
    7268    }
    73     echo "</p><p><br /><a href=\"forum_thread.php?id=".$thread->id."\">Return to thread</a></p>";
     69    echo "</p><p><br /><a href=\"forum_thread.php?id=".$thread->id."\">".tra("Return to thread")."</a></p>";
    7470    page_tail();
    7571}
    7672
    7773if (!$thread || !$action) {
    78     error_page("Unknown subscription action");
     74    error_page(tra("Unknown subscription action"));
    7975}
    8076
    8177$user = get_logged_in_user();
  • donated.php

     
    2222
    2323$st = get_str("st", true);
    2424
    25 page_head("PayPal - Transaction Completed");
     25page_head(tra("PayPal - Transaction Completed"));
    2626
    2727if ($st == "Completed") {
    28     echo "<div>Thank you for donating!<br>\n";
    29     echo "Your donation for has been completed.<br>\n";
    30     echo "Your donation will be added to the progress bar after confirmation by PayPal.</div>";
     28    echo "<div>".tra("Thank you for donating!")."<br>\n";
     29    echo tra("Your donation for has been completed.")."<br>\n";
     30    echo tra("Your donation will be added to the progress bar after confirmation by PayPal.")."</div>";
    3131} else {
    32     echo "<strong>You have canceled your donation</strong>";
     32    echo "<strong>".tra("You have canceled your donation.")."</strong>";
    3333}
    3434
    3535page_tail();
  • account_finish.php

     
    2323require_once('../inc/boinc_db.inc');
    2424require_once('../inc/util.inc');
    2525require_once('../inc/countries.inc');
    26 require_once('../inc/translation.inc');
    2726
    2827check_get_args(array("auth"));
    2928
     
    3231if (!$user) {
    3332    error_page("no such account");
    3433}
    35 page_head("Finish account setup");
     34page_head(tra("Finish account setup"));
    3635
    3736echo "
    3837    <form action=account_finish_action.php method=post>
  • forum_moderate_thread_action.php

     
    3535if (!$forum) error_page("no forum");
    3636
    3737if (!is_moderator($logged_in_user, $forum)) {
    38     error_page("You are not authorized to moderate this post.");
     38    error_page(tra("You are not authorized to moderate this post."));
    3939}
    4040
    4141$explanation = "";
     
    9595    $action_name = "renamed from '$thread->title' to '$new_title'";
    9696    break;
    9797default:
    98     error_page("Unknown action ");
     98    error_page("Unknown action");
    9999}
    100100
    101101if (!$result) {
    102     error_page("Moderation failed");
     102    error_page(tra("Action failed: possible database problem"));
    103103}
    104104
    105105$reason = post_str('reason', true);
  • forum_forum.php

     
    3131if (!$start) $start = 0;
    3232
    3333$forum = BoincForum::lookup_id($id);
    34 if (!$forum) error_page("no forum");
     34if (!$forum) error_page("forum ID not found");
    3535$user = get_logged_in_user(false);
    3636
    3737if (!is_forum_visible_to_user($forum, $user)) {
    3838    if ($user) {
    3939        remove_subscriptions_forum($user->id, $id);
    4040    }
    41     error_page("Not visible");
     41    error_page(tra("Not visible to you"));
    4242}
    4343
    4444BoincForumPrefs::lookup($user);
     
    6767switch ($forum->parent_type) {
    6868case 0:
    6969    $category = BoincCategory::lookup_id($forum->category);
    70     if ($category->is_helpdesk){
     70    if ($category->is_helpdesk) {
    7171        page_head(tra("Questions and Answers").' : '.$forum->title);
    7272        echo '<link href="forum_help_desk.php" rel="up" title="Forum Index">';
    7373    } else {
     
    7979    break;
    8080case 1:
    8181    $team = BoincTeam::lookup_id($forum->category);
    82     page_head("Team message board for <a href=team_display.php?teamid=$team->id>$team->name</a>");
     82    page_head(tra("Team message board for %1", "<a href=team_display.php?teamid=$team->id>$team->name</a>"));
    8383    show_forum_header($user);
    8484    show_team_forum_title($forum);
    8585    break;
     
    9595
    9696if (user_can_create_thread($user, $forum)) {
    9797    show_button(
    98         "forum_post.php?id=$id", "New thread", "Add a new thread to this forum"
     98        "forum_post.php?id=$id", tra("New thread"), tra("Add a new thread to this forum")
    9999    );
    100100}
    101101
     
    114114show_forum($forum, $start, $sort_style, $user);
    115115
    116116echo "
    117     <p>
    118     This message board is available as an
    119     <a href=forum_rss.php?forumid=$forum->id&setup=1>RSS feed
    120     <img src=img/feed_logo.png></a>
    121 ";
     117    <p>".
     118    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>");
    122119
    123120page_tail();
    124121
     
    174171
    175172        echo "<td width=\"1%\" class=\"threadicon\"><nobr>";
    176173        if ($thread->hidden) {
    177             show_image(IMAGE_HIDDEN, "This thread is hidden", "hidden");
     174            show_image(IMAGE_HIDDEN, tra("This thread is hidden"), tra("hidden"));
    178175        } else if ($unread) {
    179176            if ($thread->sticky) {
    180177                if ($thread->locked) {
    181                     show_image(NEW_IMAGE_STICKY_LOCKED, "This thread is sticky and locked, and you haven't read it yet", "sticky/locked/unread");
     178                    show_image(NEW_IMAGE_STICKY_LOCKED, tra("This thread is sticky and locked, and you haven't read it yet"), tra("sticky/locked/unread"));
    182179                } else {
    183                     show_image(NEW_IMAGE_STICKY, "This thread is sticky and you haven't read it yet", "sticky/unread");
     180                    show_image(NEW_IMAGE_STICKY, tra("This thread is sticky and you haven't read it yet"), tra("sticky/unread"));
    184181                }
    185182            } else {
    186183                if ($thread->locked) {
    187                     show_image(NEW_IMAGE_LOCKED, "You haven't read this thread yet, and it's locked", "unread/locked");
     184                    show_image(NEW_IMAGE_LOCKED, tra("You haven't read this thread yet, and it's locked"), tra("unread/locked"));
    188185                } else {
    189                     show_image(NEW_IMAGE, "You haven't read this thread yet", "unread");
     186                    show_image(NEW_IMAGE, tra("You haven't read this thread yet"), tra("unread"));
    190187                }
    191188            }
    192189        } else {
    193190            if ($thread->sticky) {
    194191                if ($thread->locked) {
    195                     show_image(IMAGE_STICKY_LOCKED, "This thread is sticky and locked", "sticky/locked");
     192                    show_image(IMAGE_STICKY_LOCKED, tra("This thread is sticky and locked"), tra("sticky/locked"));
    196193                } else {
    197                     show_image(IMAGE_STICKY, "This thread is sticky", "sticky");
     194                    show_image(IMAGE_STICKY, tra("This thread is sticky"), tra("sticky"));
    198195                }
    199196            } else {
    200197                if ($thread->locked) {
    201                     show_image(IMAGE_LOCKED, "This thread is locked", "locked");
     198                    show_image(IMAGE_LOCKED, tra("This thread is locked"), tra("locked"));
    202199                } else {
    203                     show_image(IMAGE_POST, "You read this thread", "read");
     200                    show_image(IMAGE_POST, tra("You read this thread"), tra("read"));
    204201                }
    205202            }
    206203        }
  • user_search.php

     
    147147    if (strlen($search_string)<3) {
    148148        error_page(tra("search string must be at least 3 characters"));
    149149    }
    150     $s = boinc_real_escape_string($search_string);
     150    $s = BoincDb::escape_string($search_string);
    151151    $s = escape_pattern($s);
    152152    $fields = "id, create_time, name, country, total_credit, expavg_credit, teamid, url, has_profile, donated";
    153153    $users = BoincUser::enum_fields($fields, "name like '$s%'", "limit $count");
     
    185185        case 'name_prefix':
    186186            break;
    187187        default:
    188             error_page(tra("missing search type"));
     188            error_page("missing search type");
    189189        }
    190190
    191191        $filter = null;
  • html.php

     
    1616// You should have received a copy of the GNU Lesser General Public License
    1717// along with BOINC.  If not, see <http://www.gnu.org/licenses/>.
    1818
    19 
    2019require_once("../inc/util.inc");
    2120
    2221check_get_args(array());
    2322
    24 page_head("Allowed HTML tags");
     23page_head(tra("Allowed HTML tags"));
    2524
    26 echo "
    27 The following HTML tags are allowed in profiles, team descriptions,
    28 signatures, etc.:
     25echo tra("The following HTML tags are allowed in team descriptions:")."
    2926<ul>
    30 <li> &lt;b> or &lt;strong> (bold)
    31 <li> &lt;i> or &lt;em> (italics)
    32 <li> &lt;a> (hyperlink)
    33 <li> &lt;p> (paragraph)
    34 <li> &lt;br> (break)
    35 <li> &lt;pre> (preformatted)
    36 <li> &lt;img> (image; height cannot exceed 450 pixels.
    37 Please do not link to images without
    38 permission of the web site where the image is hosted.)
     27<li> &lt;b> or &lt;strong> (".tra("bold").")
     28<li> &lt;i> or &lt;em> (".tra("italics").")
     29<li> &lt;a> (".tra("hyperlink").")
     30<li> &lt;p> (".tra("paragraph").")
     31<li> &lt;br> (".tra("break").")
     32<li> &lt;pre> (".tra("preformatted").")
     33<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.").")
    3934</ul>
    40 You can also use ampersand notation for special characters.
    41 ";
     35".tra("You can also use ampersand notation for special characters.");
    4236
    4337page_tail();
    4438?>
  • host_edit_form.php

     
    2727$hostid = get_int("hostid");
    2828$host = BoincHost::lookup_id($hostid);
    2929if (!$host || $host->userid != $user->id) {
    30     error_page("We have no record of that computer");
     30    error_page(tra("We have no record of that computer"));
    3131}
    3232
    3333$detail = get_int('detail', true);
    3434
    35 page_head("Merge computers");
     35page_head(tra("Merge computers"));
    3636
    3737$t = time_str($host->create_time);
    38 echo "
    39     Sometimes BOINC assigns separate identities to the same computer by mistake.
    40     You can correct this by merging old identities with the newest one.
    41     <form name=blah action=host_edit_action.php>
     38echo tra("Sometimes BOINC assigns separate identities to the same computer by mistake. You can correct this by merging old identities with the newest one.")."
     39    <form name=host_list action=host_edit_action.php>
    4240    <input type=hidden name=id_0 value=$hostid>
    4341    <p>
    4442";
     
    5553    if ($nhosts==500) break;
    5654}
    5755if ($nhosts == 1) {
    58     echo "<br>No hosts are eligible for merging with this one.";
     56    echo "<br>".tra("No hosts are eligible for merging with this one.");
    5957    if (!$detail) {
    60         echo "<p><a href=host_edit_form.php?hostid=$hostid&detail=1>Show details</a>
     58        echo "<p><a href=host_edit_form.php?hostid=$hostid&detail=1>".tra("Show details")."</a>
    6159        ";
    6260    }
    6361    page_tail();
    6462    exit();
    6563}
    6664echo "
     65    <p>"
     66    .tra("Check the computers that are the same as %1 (created %2, computer ID %3):", $host->domain_name, $t, $host->id)."
    6767    <p>
    68     Check the computers that are the same as $host->domain_name
    69     (created $t, computer ID $host->id):
    70     <p>
    7168";
    7269start_table();
    73 row_heading_array(array("", "name", "created", "computer ID"));
     70row_heading_array(array("", tra("name"), tra("created"), tra("computer ID")));
    7471
    7572$i = 1;
    7673foreach ($hosts as $host2) {
    7774    $t = time_str($host2->create_time);
    7875    $x = $host2->domain_name;
    7976    if ($x == "") {
    80         $x = "[no hostname]";
     77        $x = "[".tra("no hostname")."]";
    8178    }
    8279    row_array(array(
    8380        "<input type=checkbox name=id_$i value=$host2->id>",
     
    9491        function set_all() {
    9592";
    9693for ($i=1; $i<$nhosts; $i++) {
    97     echo "document.blah.id_$i.checked=1;\n";
     94    echo "document.host_list.id_$i.checked=1;\n";
    9895}
    9996echo "
    10097        }
    10198        function clear_all() {
    10299";
    103100for ($i=1; $i<$nhosts; $i++) {
    104     echo "document.blah.id_$i.checked=0;\n";
     101    echo "document.host_list.id_$i.checked=0;\n";
    105102}
    106103echo "
    107104        }
     
    109106    <p><a href=javascript:set_all()>Select all</a>
    110107    <p><a href=javascript:clear_all()>Unselect all</a>
    111108    <input type=hidden name=nhosts value=$nhosts>
    112     <p><input type=submit value='Merge hosts'>
     109    <p><input type=submit value='".tra("Merge hosts")."'>
    113110    </form>
    114111";
    115112
    116113if (!$detail) {
    117     echo "<p><a href=host_edit_form.php?hostid=$hostid&detail=1>Show details</a>
     114    echo "<p><a href=host_edit_form.php?hostid=$hostid&detail=1>".tra("Show details")."</a>
    118115    ";
    119116}
    120117
  • forum_moderate_post_action.php

     
    2525    $x = "";
    2626    $reason = post_str('reason', true);
    2727    if ($reason){
    28         $x .= "
    29 Moderator comment: $reason
     28        $x .= "\nModerator comment: $reason
    3029";
    3130    }
    3231    return $x;
    3332}
    3433
    3534function hide_explanation() {
    36     $x = "\nYour post was categorized as ";
    3735    switch (post_int("category", true)) {
    38     case 1: $x .= "Obscene"; break;
    39     case 2: $x .= "Flame/Hate mail"; break;
    40     case 3: $x .= "Commercial spam"; break;
    41     case 4: $x .= "Double post"; break;
    42     case 5: $x .= "User Request"; break;
    43     default: $x .= "Other"; break;
     36        case 1: $c = "Obscene"; break;
     37        case 2: $c = "Flame/Hate mail"; break;
     38        case 3: $c = "Commercial spam"; break;
     39        case 4: $c = "Double post"; break;
     40        case 5: $c = "User Request"; break;
     41        default: $c = "Other"; break;
    4442    }
     43    $x = "\nYour post was categorized as ".$c;
    4544    $x .= mod_comment();
    4645    return $x;
    4746}
     
    5554$forum = BoincForum::lookup_id($thread->forum);
    5655
    5756if (!is_moderator($user, $forum)) {
    58     error_page("You are not authorized to moderate this post.");
     57    error_page(tra("You are not authorized to moderate this post."));
    5958}
    6059
    6160// See if "action" is provided - either through post or get
    6261if (!post_str('action', true)) {
    6362    if (!get_str('action', true)){
    64         error_page("You must specify an action...");
     63        error_page(tra("You must specify an action..."));
    6564    } else {
    6665        $action = get_str('action');
    6766    }
     
    8382    if (!$new_thread) error_page("No such thread");
    8483    $new_forum = BoincForum::lookup_id($new_thread->forum);
    8584    if ($forum->parent_type != $new_forum->parent_type) {
    86         error_page("Can't move to different category type");
     85        error_page(tra("Can't move to different category type"));
    8786    }
    8887    if ($forum->parent_type != 0) {
    8988        if ($forum->category != $new_forum->category) {
    90             error_page("Can't move to different category");
     89            error_page(tra("Can't move to different category"));
    9190        }
    9291    }
    9392    $result = move_post($post, $thread, $forum, $new_thread, $new_forum);
     
    108107        }
    109108    }
    110109    if (!$auth) {
    111         error_page("Not authorized to banish users");
     110        error_page(tra("Not authorized to banish users"));
    112111    }
    113112    $userid = post_int('userid');
    114     $user = BoincUser::lookup_id($userid);
    115     if (!$user) {
    116         error_page("no user");
     113    $bad_user = BoincUser::lookup_id($userid);
     114    if (!$bad_user) {
     115        error_page("user ID not found");
    117116    }
    118     BoincForumPrefs::lookup($user);
     117    BoincForumPrefs::lookup($bad_user);
    119118    $duration = post_int('duration');
    120119    if ($duration == -1) {
    121120        $t = 2147483647; // Maximum integer value
     
    123122        $t = time() + $duration;
    124123    }
    125124    $reason = post_str("reason", true);
    126     $result = $user->prefs->update("banished_until=$t");
    127     page_head("Banishment");
     125    $result = $bad_user->prefs->update("banished_until=$t");
     126    page_head(tra("Banishment"));
    128127    if ($result) {
    129         echo "User ".$user->name." has been banished.";
    130         send_banish_email($forum, $user, $t, $reason);
     128        echo tra("User %1 has been banished.", $bad_user->name);
     129        send_banish_email($forum, $bad_user, $t, $reason);
    131130    } else {
    132         echo "DB failure";
     131        error_page(tra("Action failed: possible database problem"));
    133132    }
    134133    page_tail();
    135134    exit();
    136135} else {
    137     error_page("Unknown action ");
     136    error_page("Unknown action");
    138137}
    139138
    140139if (!$result) {
    141     error_page("Action failed: possible database problem");
     140    error_page(tra("Action failed: possible database problem"));
    142141}
    143142
    144143send_moderation_email($forum, $post, $thread, $explanation, $action_name);
  • forum_index.php

     
    5050        $t = $forum->title;
    5151        if (!strlen($t)) $t = $team->name;
    5252        $d = $forum->description;
    53         if (!strlen($d)) $d = "Discussion among members of $team->name";
     53        if (!strlen($d)) $d = tra("Discussion among members of %1", $team->name);
    5454        break;
    5555    }
    5656    $j = $i % 2;
     
    120120if ($user) {
    121121    $subs = BoincSubscription::enum("userid=$user->id");
    122122    if (count($subs)) {
    123         echo "<p><span class=title>Subscribed threads</span><p>";
     123        echo "<p><span class=title>".tra("Subscribed threads")."</span><p>";
    124124        show_thread_and_context_header();
    125125        $i = 0;
    126126        foreach ($subs as $sub) {
  • team_lookup.php

     
    6666$name_lc = strtolower($team_name);
    6767$name_lc = escape_pattern($name_lc);
    6868
    69 $clause = "name like '%".boinc_real_escape_string($name_lc)."%' order by expavg_credit desc limit 100";
     69$clause = "name like '%".BoincDb::escape_string($name_lc)."%' order by expavg_credit desc limit 100";
    7070$teams = BoincTeam::enum($clause);
    7171
    7272if ($format == 'xml') {
     
    8383
    8484page_head(tra("Search Results"));
    8585if (count($teams)) {
    86     echo "<h2>".tra("Search results for '%1'", strip_tags($team_name))."</h2>";
     86    echo "<h2>".tra("Search results for '%1'", sanitize_tags($team_name))."</h2>";
    8787    echo "<p>";
    8888    echo tra("You may view these teams' members, statistics, and information.");
    8989    echo "<ul>";
  • profile_search_action.php

     
    2626    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";
    2727}
    2828
    29 $search_string = get_str('search_string');
    30 $search_string = strip_tags($search_string);
    31 $search_string = boinc_real_escape_string($search_string);
     29$search_string = BoincDb::escape_string(sanitize_tags(get_str('search_string')));
    3230$offset = get_int('offset', true);
    3331if (!$offset) $offset=0;
    3432$count = 10;
  • prefs_edit.php

     
    2020include_once("../inc/util.inc");
    2121include_once("../inc/prefs.inc");
    2222
    23 db_init();
     23check_get_args(array("action", "subset", "venue", "cols", "tnow", "ttok"));
    2424
    2525$user = get_logged_in_user();
    2626
  • edit_email_action.php

     
    2828$email_addr = strtolower(post_str("email_addr"));
    2929$passwd = post_str("passwd", true);
    3030
    31 page_head("Change email address of account");
     31page_head(tra("Change email address of account"));
    3232
    3333if (!is_valid_email_addr($email_addr)) {
    34     echo "New email address '$email_addr' is invalid";
     34    echo tra("New email address '%1' is invalid.", $email_addr);
    3535} else if (is_banned_email_addr($email_addr)) {
    36     echo "New email address '$email_addr' is invalid";
     36    echo tra("New email address '%1' is invalid.", $email_addr);
    3737} else if ($email_addr == $user->email_addr) {
    38     echo "New email address is same as existing address; no change.";
     38    echo tra("New email address is same as existing address. Nothing is changed.");
    3939} else {
    4040    $existing = lookup_user_email_addr($email_addr);
    4141    if ($existing) {
    42         echo "There's already an account with that email address";
     42        echo tra("There's already an account with that email address");
    4343    } else {
    4444        $passwd_hash = md5($passwd.$user->email_addr);
    4545
     
    5151            $passwd_hash = md5($passwd.$user->email_addr);
    5252        }
    5353        if ($passwd_hash != $user->passwd_hash) {
    54             echo "Invalid password.";
     54            echo tra("Invalid password.");
    5555        } else {
    5656            $passwd_hash = md5($passwd.$email_addr);
    5757            $email_addr = BoincDb::escape_string($email_addr);
     
    5959                "email_addr='$email_addr', passwd_hash='$passwd_hash', email_validated=0"
    6060            );
    6161            if ($result) {
    62                 echo "
    63                     The email address of your account is now $email_addr.
    64                 ";
     62                echo tra("The email address of your account is now %1.", $email_addr);
    6563                if (defined("SHOW_NONVALIDATED_EMAIL_ADDR")) {
    66                     echo "<p>Please <a href=validate_email_addr.php>validate this email address</a>.\n";
     64                    echo "<p>".tra("Please %1validate this email address%2.", "<a href=validate_email_addr.php>", "</a>")."\n";
    6765                }
    6866            } else {
    69                 echo "
    70                     We can't update your email address
    71                     due to a database problem.  Please try again later.
    72                 ";
     67                echo tra("We can't update your email address due to a database problem.  Please try again later.");
    7368            }
    7469        }
    7570    }
  • forum_banishment_vote_action.php

     
    3030check_tokens($logged_in_user->authenticator);
    3131
    3232if (!$logged_in_user->prefs->privilege(S_MODERATOR)) {
    33     error_page("You are not authorized to banish users.");
     33    error_page(tra("You are not authorized to banish users."));
    3434}
    3535
    3636// See if "action" is provided - either through post or get
    3737if (!post_str('action', true)) {
    3838    if (!get_str('action', true)){
    39             error_page("You must specify an action...");
     39            error_page(tra("You must specify an action..."));
    4040    } else {
    4141        $action = get_str('action');
    4242    }
     
    4848$user=BoincUser::lookup_id($userid);
    4949
    5050if ($action!="start"){
    51     error_page("Unknown action ");
     51    error_page("Unknown action");
    5252}
    5353
     54// TODO: create a function for this in forum_banishment_vote.inc to make it more flexible
    5455switch (post_int("category", true)) {
    5556    case 1:
    56         $mod_category = "Obscene";
     57        $mod_category = tra("Obscene");
    5758    case 2:
    58         $mod_category = "Flame/Hate mail";
     59        $mod_category = tra("Flame/Hate mail");
    5960    case 3:
    60         $mod_category = "User Request";
     61        $mod_category = tra("User Request");
    6162    default:
    62         $mod_category = "Other";
     63        $mod_category = tra("Other");
    6364}
    6465
    6566if (post_str('reason', true)){
  • edit_user_info_action.php

     
    2727check_tokens($user->authenticator);
    2828
    2929$name = post_str("user_name");
    30 if ($name != strip_tags($name)) {
     30if ($name != sanitize_tags($name)) {
    3131    error_page(tra("HTML tags are not allowed in your name."));
    3232}
    3333if (strlen($name) == 0) {
    3434    error_page(tra("You must supply a name for your account."));
    3535}
    36 $url = post_str("url", true);
    37 $url = strip_tags($url);
     36$url = sanitize_tags(post_str("url", true));
    3837$country = post_str("country");
    3938if ($country == "") {
    4039    $country = "International";
    4140}
    4241if (!is_valid_country($country)) {
    43     error_page(tra("bad country"));
     42    error_page("bad country");
    4443}
    4544$country = BoincDb::escape_string($country);
    46 $postal_code = post_str("postal_code", true);
    47 $postal_code = strip_tags($postal_code);
     45$postal_code = sanitize_tags(post_str("postal_code", true));
    4846
    4947$name = BoincDb::escape_string($name);
    5048$url = BoincDb::escape_string($url);
  • team_forum.php

     
    5050    $id = BoincForum::insert("(category, parent_type) values ($team->id, 1)");
    5151    $forum = BoincForum::lookup_id($id);
    5252    if (!$forum) {
    53         error_page(tra("couldn't create message board"));
     53        error_page(tra("Couldn't create message board"));
    5454    }
    5555    edit_form($user, $team, $forum, true);
    5656}
     
    104104
    105105function remove($team) {
    106106    $forum = BoincForum::lookup("parent_type=1 and category=$team->id");
    107     if (!$forum) error_page(tra("message board not found"));
     107    if (!$forum) error_page("message board not found");
    108108   
    109109    // delete threads and posts
    110110    //
     
    131131}
    132132
    133133function edit_action($forum) {
    134     $title = strip_tags(post_str('title'));
     134    $title = sanitize_tags(post_str('title'));
    135135    $title = BoincDb::escape_string($title);
    136     $description = strip_tags(post_str('description'));
     136    $description = sanitize_tags(post_str('description'));
    137137    $description = BoincDb::escape_string($description);
    138138    $post_min_interval = post_int('post_min_interval');
    139139    $post_min_total_credit = post_int('post_min_total_credit');
     
    151151function show_forum($team) {
    152152    $forum = BoincForum::lookup("parent_type=1 and category=$team->id");
    153153    if (!$forum) {
    154         error_page(tra("team has no forum"));
     154        error_page(tra("Team has no forum"));
    155155    }
    156156    Header("Location: forum_forum.php?id=$forum->id");
    157157}
     
    161161
    162162$team = BoincTeam::lookup_id($teamid);
    163163if (!$team) {
    164     error_page(tra("no such team"));
     164    error_page("no such team");
    165165}
    166166
    167167$cmd = get_str('cmd', true);
     
    186186    require_founder_login($user, $team);
    187187    check_tokens($user->authenticator);
    188188    $forum = BoincForum::lookup("parent_type=1 and category=$teamid");
    189     if (!$forum) error_page(tra("no such forum"));
     189    if (!$forum) error_page("no such forum");
    190190    edit_action($forum);
    191191} else if ($cmd == "remove_confirm") {
    192192    $user = get_logged_in_user();
     
    197197    require_founder_login($user, $team);
    198198    remove($team);
    199199} else if ($cmd != "") {
    200     error_page(tra("unknown command %1", $cmd));
     200    error_page("unknown command $cmd");
    201201} else {
    202202    show_forum($team);
    203203}
  • forum_reply.php

     
    7373    }
    7474    check_tokens($logged_in_user->authenticator);
    7575    if (!akismet_check($logged_in_user, $content)) {
    76         $warning = "Your post has been flagged as spam by the Akismet
    77             anti-spam system.  Please modify your text and try again.
    78         ";
     76        $warning = tra("Your post has been flagged as spam by the Akismet anti-spam system. Please modify your text and try again.");
    7977        $preview = tra("Preview");
    8078    } else {
    8179        create_post(
     
    126124    global $logged_in_user, $bbcode_html;
    127125    global $content, $preview;
    128126
    129     $x1 = "Message:".html_info().post_warning();
     127    $x1 = tra("Message:").html_info().post_warning();
    130128    $x2 = "";
    131129    if ($parent_post) {
    132         $x2 .=" reply to <a href=#".$parent_post->id.">Message ID ".$parent_post->id."</a>:";
     130        $x2 .=" ".tra("reply to %1Message ID%2:", "<a href=#".$parent_post->id.">", " ".$parent_post->id."</a>");
    133131    }
    134132    $x2 .= "<form action=forum_reply.php?thread=".$thread->id;
    135133
     
    146144    } else if (!$no_quote) {
    147145        if ($parent_post) $x2 .= quote_text(htmlspecialchars($parent_post->content))."\n";
    148146    }
    149     if (!$logged_in_user->prefs->no_signature_by_default){
     147    if (!$logged_in_user->prefs->no_signature_by_default) {
    150148        $enable_signature="checked=\"true\"";
    151149    } else {
    152150        $enable_signature="";
    153151    }
    154152    $x2 .= "</textarea><p>
    155153        <input type=\"submit\" name=\"preview\" value=\"".tra("Preview")."\">
    156         <input type=\"submit\" value=\"Post reply\">
     154        <input type=\"submit\" value=\"".tra("Post reply")."\">
    157155        &nbsp;&nbsp;&nbsp;
    158         <input name=\"add_signature\" id=\"add_signature\" value=\"add_it\" ".$enable_signature." type=\"checkbox\">
    159         <label for=\"add_signature\">Add my signature to this reply</label>
     156        <input type=\"checkbox\" name=\"add_signature\" id=\"add_signature\" value=\"add_it\" ".$enable_signature.">
     157        <label for=\"add_signature\">".tra("Add my signature to this reply")."</label>
    160158
    161159        </form>
    162160    ";
  • edit_forum_preferences_action.php

     
    3232BoincForumPrefs::lookup($user);
    3333
    3434if (post_str("action", true)=="reset_confirm"){
    35     page_head("Confirm reset");
    36     echo "This action will erase any changes you have made
    37         in your community preferences.
    38         To cancel, click your browser's Back button.
     35    page_head(tra("Confirm reset"));
     36    echo tra("This action will erase any changes you have made in your community preferences. To cancel, click your browser's Back button.")."
    3937        <p>
    4038        <form action=edit_forum_preferences_action.php method=post>
    4139        <input type=hidden name=action value=reset>
    42         <input type=submit value=\"Reset preferences\">
     40        <input type=submit value=\"".tra("Reset preferences")."\">
    4341        </form>
    4442    ";
    4543    page_tail();
     
    8987        $size = getImageSize($file);
    9088        if ($size[2]!=2 and $size[2]!=3){
    9189            //Not the right kind of file
    92             error_page("Error: Not the right kind of file, only PNG and JPEG are supported.");
     90            error_page(tra("Error: Not the right kind of file, only PNG and JPEG are supported."));
    9391        }
    9492        $width = $size[0];
    9593        $height = $size[1];
     
    115113$pm_notification = post_int("pm_notification");
    116114$signature = post_str("signature", true);
    117115if (strlen($signature)>250) {
    118     error_page(
    119         "Your signature was too long, please keep it less than 250 chars"
    120     );
     116    error_page(tra("Your signature was too long, please keep it less than 250 characters."));
    121117}
    122118$forum_sort = post_int("forum_sort");
    123119$thread_sort = post_int("thread_sort");
     
    140136    if ($user_to_add!="" and $user_to_add==strval(intval($user_to_add))){
    141137        $other_user = BoincUser::lookup_id($user_to_add);
    142138        if (!$other_user) {
    143             echo "No such user: $other_user";
     139            echo tra("No such user: %1", $other_user);
    144140        } else {
    145141            add_ignored_user($user, $other_user);
    146142        }
     
    154150    if ($_POST["remove".trim($ignored_users[$i])]!=""){
    155151        $other_user = BoincUser::lookup_id($ignored_users[$i]);
    156152        if (!$other_user) {
    157             echo "No such user: $other_user";
     153            echo tra("No such user: %1", $other_user);
    158154        } else {
    159155            remove_ignored_user($user, $other_user);
    160156        }
  • forum_user_posts.php

     
    7070        }
    7171    }
    7272}
    73 page_head("Posts by $user->name");
     73page_head(tra("Posts by %1", $user->name));
    7474
    7575$posts = BoincPost::enum("user=$userid order by id desc");
    7676$n = 0;
     
    113113if ($offset) {
    114114        $x = $offset - $count;
    115115    echo "<a href=forum_user_posts.php?userid=$userid&offset=$x>
    116                 <b>Previous $count</b>
     116                <b>".tra("Previous %1", $count)."</b>
    117117                </a>
    118118    ";
    119119        if ($show_next) echo " | ";
     
    122122if ($show_next) {
    123123    $offset += $count;
    124124    echo "<a href=forum_user_posts.php?userid=$userid&offset=$offset>
    125                 <b>Next $count</b>
     125                <b>".tra("Next %1", $count)."</b>
    126126                </a>
    127127    ";
    128128}
  • add_venue.php

     
    2121require_once("../inc/util.inc");
    2222require_once("../inc/prefs.inc");
    2323
     24check_get_args(array("action", "subset", "venue", "cols"));
     25
    2426db_init();
    2527
    2628$user = get_logged_in_user();
  • forum_edit.php

     
    3838
    3939if (!is_moderator($logged_in_user, $forum)) {
    4040    if (time() > $post->timestamp + MAXIMUM_EDIT_TIME) {
    41         error_page(
    42             "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."
    43         );
     41        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)));
    4442    }
    4543}
    4644
    4745$post_owner = BoincUser::lookup_id($post->user);
    4846if (($logged_in_user->id != $post_owner->id) || (can_reply($thread, $forum, $logged_in_user) == false)) {
    49     error_page ("You are not authorized to edit this post.");
     47    error_page (tra("You are not authorized to edit this post."));
    5048}
    5149
    5250$thread_owner = BoincUser::lookup_id($thread->owner);
     
    7472   
    7573        if ($can_edit_title){
    7674            $title = trim($title);
    77             $title = strip_tags($title);
     75            $title = sanitize_tags($title);
    7876            $title = BoincDb::escape_string($title);
    7977            $thread->update("title='$title'");
    8078        }
     
    8583    }
    8684}
    8785
    88 page_head('Forum','','','', $bbcode_js);
     86page_head(tra("Forum"),'','','', $bbcode_js);
    8987
    9088show_forum_header($logged_in_user);
    9189switch ($forum->parent_type) {
     
    109107echo "<form action=\"forum_edit.php?id=".$post->id."\" method=\"POST\" name=\"post\" onsubmit=\"return checkForm(this)\">\n";
    110108echo form_tokens($logged_in_user->authenticator);
    111109start_table();
    112 row1("Edit your message");
     110row1(tra("Edit your message"));
    113111if ($can_edit_title) {
    114112    //If this is the user can edit the thread title display a way of doing so
    115113    if ($preview) {
  • hosts_user.php

     
    4646if ($userid) {
    4747    $user = lookup_user_id($userid);
    4848    if (!$user) {
    49         error_page("No such user");
     49        error_page(tra("No such user"));
    5050    }
    5151
    5252    if ($user->show_hosts) {
    5353        page_head(tra("Computers belonging to %1", $user->name));
    5454    } else {
    55         page_head("Computers hidden");
    56         echo tra("This user has chosen not to show information about their computers.");
     55        page_head(tra("Computers hidden"));
     56        echo tra(tra("This user has chosen not to show information about his or her computers."));
    5757        page_tail();
    5858        exit();
    5959    }
     
    6161} else {
    6262    $user = get_logged_in_user();
    6363    $userid = $user->id;
    64     page_head("Your computers");
     64    page_head(tra("Your computers"));
    6565    $private = true;
    6666}
    6767
  • apps.php

     
    1818
    1919require_once("../inc/boinc_db.inc");
    2020require_once("../inc/util.inc");
    21 require_once("../inc/translation.inc");
    2221
    2322check_get_args(array("xml"));
    2423
  • forum_search_action.php

     
    8787
    8888    $search_string="%";
    8989    foreach ($keyword_list as $key => $word){
    90         $search_string.=mysql_escape_string($word)."%";
    91     }
     90        $search_string.=BoincDb::escape_string($word)."%";
     91    } 
    9292    $optional_join = "";
    9393    // if looking in a single forum, need to join w/ thread table
    9494    // because that's where the link to forum is
     
    209209}
    210210
    211211if (!count($thread) && !count($posts)){
    212     echo "<p>Sorry, couldn't find anything matching your search query. You
    213     can try to broaden your search by using less words (or less specific words).</p>
    214     <p>You can also
    215     <a href=\"http://www.google.com/search?domains=".URL_BASE."&sitesearch=".URL_BASE."/forum_thread.php&q=".htmlentities($search_keywords)."\">
    216     try the same search on Google.</a></p>";
     212    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>
     213    <p>"
     214    .tra("You can also %1try the same search on Google.%2",
     215         "<a href=\"http://www.google.com/search?domains=".URL_BASE."&sitesearch=".URL_BASE."/forum_thread.php&q=".htmlentities($search_keywords)."\">",
     216         "</a>")
     217    ."</p>";
    217218}
    218 echo "<p><a href=\"forum_search.php\">Perform another search</a></p>";
     219echo "<p><a href=\"forum_search.php\">".tra("Perform another search")."</a></p>";
    219220page_tail();
    220 exit;
    221221
    222222$cvs_version_tracker[]="\$Id$";  //Generated automatically - do not edit
    223223?>
  • forum_thread_status.php

     
    4040        $ret = $thread->update("status=0");
    4141    }
    4242    if (!$ret){
    43         error_page("Could not update the status of the thread: ".$thread->id);
     43        error_page(tra("Could not update the status of the thread: %1", $thread->id));
    4444    }
    4545} else {
    46     error_page("You must be the creator of the thread to update its status");
     46    error_page(tra("You must be the creator of the thread to update its status."));
    4747}
    4848
    4949// --------------
    5050
    51 page_head("Thread status updated");
    52 echo "<p>The status has been updated.</p>";
    53 echo "<p><a href=\"forum_thread.php?nowrap=true&id=".$thread->id."\">Return to the thread</a></p>";
     51page_head(tra("Thread status updated"));
     52echo "<p>".tra("The status has been updated.")."</p>";
     53echo "<p><a href=\"forum_thread.php?nowrap=true&id=".$thread->id."\">".tra("Return to thread")."</a></p>";
    5454page_tail();
    5555?>
  • create_profile.php

     
    274274    $response1 = sanitize_html($response1);
    275275    $response2 = sanitize_html($response2);
    276276    if ($profile) {
    277         $query = " response1 = '".boinc_real_escape_string($response1)."',"
    278             ." response2 = '".boinc_real_escape_string($response2)."',"
    279             ." language = '".boinc_real_escape_string($language)."',"
     277        $query = " response1 = '".BoincDb::escape_string($response1)."',"
     278            ." response2 = '".BoincDb::escape_string($response2)."',"
     279            ." language = '".BoincDb::escape_string($language)."',"
    280280            ." has_picture = '$hasPicture',"
    281281            ." verification = '$profile->verification'"
    282282            ." WHERE userid = '$user->id'";
     
    287287    } else {
    288288        $query = 'SET '
    289289            ." userid = '$user->id',"
    290             ." language = '".boinc_real_escape_string($language)."',"
    291             ." response1 = '".boinc_real_escape_string($response1)."',"
    292             ." response2 = '".boinc_real_escape_string($response2)."',"
     290            ." language = '".BoincDb::escape_string($language)."',"
     291            ." response1 = '".BoincDb::escape_string($response1)."',"
     292            ." response2 = '".BoincDb::escape_string($response2)."',"
    293293            ." has_picture = '$hasPicture',"
    294294            ." verification=0";
    295295        $result = BoincProfile::insert($query);
  • edit_forum_preferences_form.php

     
    2828$user = get_logged_in_user();
    2929BoincForumPrefs::lookup($user);
    3030
    31 page_head("Community preferences");
     31page_head(tra("Community preferences"));
    3232
    3333// output a script for counting chars left in text field
    3434//
     
    4848
    4949// ------------ Notification -----------
    5050
    51 row1("Notifications");
     51row1(tra("Notifications"));
    5252$ch0 = $user->prefs->pm_notification==0?"checked":"";
    5353$ch1 = $user->prefs->pm_notification==1?"checked":"";
    5454$ch2 = $user->prefs->pm_notification==2?"checked":"";
    5555row2(
    56     "How should we notify you of new private messages, friend requests, posts in subscribed threads, and other events?",
    57     "<input type=radio name=pm_notification value=0 $ch0> On my Account page (no email)
    58     <br><input type=radio name=pm_notification value=1 $ch1> Immediately, by email
    59     <br><input type=radio name=pm_notification value=2 $ch2> In a single daily email
     56    tra("How should we notify you of new private messages, friend requests, posts in subscribed threads, and other events?"),
     57    "<input type=radio name=pm_notification value=0 $ch0> ".tra("On my Account page (no email)")."
     58    <br><input type=radio name=pm_notification value=1 $ch1> ".tra("Immediately, by email")."
     59    <br><input type=radio name=pm_notification value=2 $ch2> ".tra("In a single daily email")."
    6060    "
    6161);
    6262
     
    7272} else {
    7373    $select_0 = "checked=\"true\"";
    7474}
    75 row1("Message-board identity");
    76 row2("Avatar
    77     <br><span class=\"note\">An image representing you on the message boards.
    78     <br>Format: JPG or PNG. Size: at most 4 KB, 100x100 pixels</span>",
     75row1(tra("Message-board identity"));
     76row2(tra("Avatar")."
     77    <br><span class=\"note\">".tra("An image representing you on the message boards.")."
     78    <br>".tra("Format: JPG or PNG. Size: at most 4 KB, 100x100 pixels")."</span>",
    7979    "<input type=\"radio\" id=\"avatar_select_0\" name=\"avatar_select\" value=\"0\" ".$select_0.">
    80         <label for=\"avatar_select_0\">Don't use an avatar</label><br>
     80        <label for=\"avatar_select_0\">".tra("Don't use an avatar")."</label><br>
    8181    <input type=\"radio\" id=\"avatar_select_1\" name=\"avatar_select\" value=\"1\" ".$select_1.">
    82         <label for=\"avatar_select_1\">Use a Globally Recognized Avatar provided by <a href=\"http://gravatar.com\">Gravatar.com</a></label><br>
     82        <label for=\"avatar_select_1\">".tra("Use a Globally Recognized Avatar provided by %1", "<a href=\"http://gravatar.com\">Gravatar.com</a>")."</label><br>
    8383    <input type=\"radio\" id=\"avatar_select_2\" name=\"avatar_select\" value=\"2\" ".$select_2.">
    84         <label for=\"avatar_select_2\">Use this uploaded avatar:</label> <input type=\"file\" name=\"picture\">"
     84        <label for=\"avatar_select_2\">".tra("Use this uploaded avatar:")."</label> <input type=\"file\" name=\"picture\">"
    8585);
    8686if (strlen($user->prefs->avatar)){
    87     row2("Avatar preview<br><span class=\"note\">This is how your avatar will look</span>",
     87    row2(tra("Avatar preview")."<br><span class=\"note\">".tra("This is how your avatar will look")."</span>",
    8888    "<img src=\"".$user->prefs->avatar."\" width=\"100\" height=\"100\">");
    8989}
    9090
    91 if (!$user->prefs->no_signature_by_default){
    92     $signature_by_default="checked=\"checked\"";
    93 } else {
    94     $signature_by_default="";
    95 }
     91$signature_by_default = $user->prefs->no_signature_by_default==false?"checked=\"checked\"":"";
     92
    9693$signature=$user->prefs->signature;
    9794$maxlen=250;
    9895row2(
    99     "Signature for message board posts"
     96    tra("Signature for message board posts")
    10097    .html_info()
    101     ."<br><br>Check out <a href=http://boinc.berkeley.edu/links.php#sigs>various free services</a>
    102     <br> providing dynamic 'signature images'
    103     <br> showing your latest credit info, project news, etc.",
     98    ."<br><br>"
     99    .tra("Check out %1various free services%2
     100<br> providing dynamic 'signature images'
     101<br> showing your latest credit info, project news, etc.", "<a href=http://boinc.berkeley.edu/links.php#sigs>", "</a>"),
    104102    "<textarea name=\"signature\" rows=4 cols=50 id=\"signature\" onkeydown=\"textCounter(this.form.signature, this.form.remLen,$maxlen);\"
    105103    onkeyup=\"textCounter(this.form.signature, this.form.remLen,250);\">".$signature."</textarea>
    106     <br><input name=\"remLen\" type=\"text\" id=\"remLen\" value=\"".($maxlen-strlen($signature))."\" size=\"3\" maxlength=\"3\" readonly> chars remaining
    107     <br><input type=\"checkbox\" name=\"signature_by_default\" ".$signature_by_default."> Attach signature by default "
     104    <br><input name=\"remLen\" type=\"text\" id=\"remLen\" value=\"".($maxlen-strlen($signature))."\" size=\"3\" maxlength=\"3\" readonly> ".tra("characters remaining")."
     105    <br><input type=\"checkbox\" name=\"signature_by_default\" ".$signature_by_default."> ".tra("Attach signature by default")
    108106);
    109107if ($user->prefs->signature!=""){
    110     row2("Signature preview".
    111         "<br><span class=note>This is how your signature will look in the forums</span>",
     108    row2(tra("Signature preview").
     109        "<br><span class=note>".tra("This is how your signature will look in the forums")."</span>",
    112110        output_transform($user->prefs->signature)
    113111    );
    114112}
    115113
    116114// ------------ Message display  -----------
    117115
    118 if ($user->prefs->hide_avatars){
    119     $forum_hide_avatars = "checked=\"checked\"";
    120 } else {
    121     $forum_hide_avatars = "";
    122 }
    123 if ($user->prefs->hide_signatures){
    124     $forum_hide_signatures = "checked=\"checked\"";
    125 } else {
    126     $forum_hide_signatures = "";
    127 }
     116$forum_hide_avatars = $user->prefs->hide_avatars?"checked=\"checked\"":"";
     117$forum_hide_signatures = $user->prefs->hide_signatures?"checked=\"checked\"":"";
     118$forum_link_popup = $user->prefs->link_popup?"checked=\"checked\"":"";
     119$forum_image_as_link = $user->prefs->images_as_links?"checked=\"checked\"":"";
     120$forum_jump_to_unread = $user->prefs->jump_to_unread?"checked=\"checked\"":"";
     121$forum_ignore_sticky_posts = $user->prefs->ignore_sticky_posts?"checked=\"checked\"":"";
     122$forum_highlight_special = $user->prefs->highlight_special?"checked=\"checked\"":"";
    128123
    129 if ($user->prefs->link_popup){
    130     $forum_link_popup="checked=\"checked\"";
    131 } else {
    132     $forum_link_popup="";
    133 }
    134 if ($user->prefs->images_as_links){
    135     $forum_image_as_link="checked=\"checked\"";
    136 } else {
    137     $forum_image_as_link="";
    138 }
    139 if ($user->prefs->jump_to_unread){
    140     $forum_jump_to_unread="checked=\"checked\"";
    141 } else {
    142     $forum_jump_to_unread="";
    143 }
    144 if ($user->prefs->ignore_sticky_posts){
    145     $forum_ignore_sticky_posts="checked=\"checked\"";
    146 } else {
    147     $forum_ignore_sticky_posts="";
    148 }
    149 if ($user->prefs->highlight_special){
    150     $forum_highlight_special="checked=\"checked\"";
    151 } else {
    152     $forum_highlight_special="";
    153 }
    154 
    155124$forum_minimum_wrap_postcount = intval($user->prefs->minimum_wrap_postcount);
    156125$forum_display_wrap_postcount = intval($user->prefs->display_wrap_postcount);
    157126
    158 row1("Message display");
     127row1(tra("Message display"));
    159128row2(
    160     "What to display",
    161     "<input type=\"checkbox\" name=\"forum_hide_avatars\" ".$forum_hide_avatars."> Hide avatar images<br>
    162     <input type=\"checkbox\" name=\"forum_hide_signatures\" ".$forum_hide_signatures."> Hide signatures<br>
    163     <input type=\"checkbox\" name=\"forum_images_as_links\" ".$forum_image_as_link."> Show images as links<br>
    164     <input type=\"checkbox\" name=\"forum_link_popup\" ".$forum_link_popup."> Open links in new window/tab<br>
    165     <input type=\"checkbox\" name=\"forum_highlight_special\" ".$forum_highlight_special."> Highlight special users<br>
     129    tra("What to display"),
     130    "<input type=\"checkbox\" name=\"forum_hide_avatars\" ".$forum_hide_avatars."> ".tra("Hide avatar images")."<br>
     131    <input type=\"checkbox\" name=\"forum_hide_signatures\" ".$forum_hide_signatures."> ".tra("Hide signatures")."<br>
     132    <input type=\"checkbox\" name=\"forum_images_as_links\" ".$forum_image_as_link."> ".tra("Show images as links")."<br>
     133    <input type=\"checkbox\" name=\"forum_link_popup\" ".$forum_link_popup."> ".tra("Open links in new window/tab")."<br>
     134    <input type=\"checkbox\" name=\"forum_highlight_special\" ".$forum_highlight_special."> ".tra("Highlight special users")."<br>
    166135    "
    167136);
    168137
    169 row2("How to sort",
    170     "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>
    171     <input type=\"checkbox\" name=\"forum_jump_to_unread\" ".$forum_jump_to_unread."> Jump to first new post in thread automatically<br>
    172     <input type=\"checkbox\" name=\"forum_ignore_sticky_posts\" ".$forum_ignore_sticky_posts.">Do not reorder sticky posts<br>
    173     <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 />
    174     <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 />
     138row2(tra("How to sort"),
     139    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>
     140    <input type=\"checkbox\" name=\"forum_jump_to_unread\" ".$forum_jump_to_unread."> ".tra("Jump to first new post in thread automatically")."<br>
     141    <input type=\"checkbox\" name=\"forum_ignore_sticky_posts\" ".$forum_ignore_sticky_posts.">".tra("Do not reorder sticky posts")."<br>
     142    <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 />
     143    <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 />
    175144    "
    176145);
    177146
    178147// ------------ Message filtering  -----------
    179148
    180 row1("Message filtering");
     149row1(tra("Message filtering"));
    181150
    182151$filtered_userlist = get_ignored_list($user);
    183152$forum_filtered_userlist = "";
     
    189158            echo "Missing user $id";
    190159            continue;
    191160        }
    192         $forum_filtered_userlist .= "<input type =\"submit\" name=\"remove".$filtered_user->id."\" value=\"Remove\"> ".$filtered_user->id." - ".user_links($filtered_user)."<br>";
     161        $forum_filtered_userlist .= "<input type =\"submit\" name=\"remove".$filtered_user->id."\" value=\"".tra("Remove")."\"> ".$filtered_user->id." - ".user_links($filtered_user)."<br>";
    193162    }
    194163}
    195164
    196 row2("Filtered users".
    197     "<br><span class=note>Ignore message board posts and private messages from these  users.</span>",
     165row2(tra("Filtered users").
     166    "<br><span class=note>".tra("Ignore message board posts and private messages from these users.")."</span>",
    198167    "$forum_filtered_userlist
    199         <input type=\"text\" name=\"forum_filter_user\" size=12> User ID (For instance: 123456789)
    200         <br><input type=\"submit\" name=\"add_user_to_filter\" value=\"Add user to filter\">
     168        <input type=\"text\" name=\"forum_filter_user\" size=12> ".tra("User ID (For instance: 123456789)")."
     169        <br><input type=\"submit\" name=\"add_user_to_filter\" value=\"".tra("Add user to filter")."\">
    201170    "
    202171);
    203172
    204 row1("Update");
    205 row2("Click here to update preferences", "<input type=submit value=\"Update\">");
     173row1(tra("Update"));
     174row2(tra("Click here to update preferences"), "<input type=submit value=\"".tra("Update")."\">");
    206175echo "</form>\n";
    207 row1("Reset");
    208 row2("Or click here to reset preferences to the defaults",
    209     "<form method=\"post\" action=\"edit_forum_preferences_action.php\"><input type=\"submit\" value=\"Reset\"><input type=\"hidden\" name=\"action\" value=\"reset_confirm\"></form>"
     176row1(tra("Reset"));
     177row2(tra("Or click here to reset preferences to the defaults"),
     178    "<form method=\"post\" action=\"edit_forum_preferences_action.php\"><input type=\"submit\" value=\"".tra("Reset")."\"><input type=\"hidden\" name=\"action\" value=\"reset_confirm\"></form>"
    210179);
    211180end_table();
    212181page_tail();
  • forum_moderate_post.php

     
    3737    error_page("No action specified");
    3838}
    3939if (!is_moderator($logged_in_user, $forum)) {
    40     error_page("You are not authorized to moderate this post.");
     40    error_page(tra("You are not authorized to moderate this post."));
    4141}   
    4242
    43 page_head('Moderate post');
     43page_head(tra("Moderate post"));
    4444
    4545echo "<form action=\"forum_moderate_post_action.php?id=".$post->id."\" method=\"POST\">\n";
    4646echo form_tokens($logged_in_user->authenticator);
     
    4949if (get_str('action')=="hide") {
    5050    //display input that selects reason
    5151    echo "<input type=hidden name=action value=hide>";
    52     row1("Hide post");
    53     row2("Reason",
     52    row1(tra("Hide post"));
     53    row2(tra("Reason"),
    5454    "<select name=\"category\">
    55     <option value=\"1\">Obscene</option>
    56     <option value=\"2\">Flame/Hate mail</option>
    57     <option value=\"3\">Commercial spam</option>
    58     <option value=\"4\">Doublepost</option>
    59     <option value=\"5\">User Request</option>
    60     <option value=\"6\">Other</option>
     55    <option value=\"1\">".tra("Obscene")."</option>
     56    <option value=\"2\">".tra("Flame/Hate mail")."</option>
     57    <option value=\"3\">".tra("Commercial spam")."</option>
     58    <option value=\"4\">".tra("Doublepost")."</option>
     59    <option value=\"5\">".tra("User Request")."</option>
     60    <option value=\"6\">".tra("Other")."</option>
    6161</select>");
    6262} elseif (get_str('action')=="move") {
    63     row1("Move post");
     63    row1(tra("Move post"));
    6464    echo "<input type=hidden name=action value=move>";
    65     row2("Destination thread ID:", "<input name=\"threadid\">");
    66     //todo display where to move the post as a dropdown instead of having to get ID   
     65    row2(tra("Destination thread ID:"), "<input name=\"threadid\">");
     66    // TODO: display where to move the post as a dropdown instead of having to get ID   
    6767} elseif (get_str('action')=="banish_user") {
    6868    $userid = get_int('userid');
    6969    $user = BoincUser::lookup_id($userid);
    7070    BoincForumPrefs::lookup($user);
    7171    if (!$user) {
    72         error_page("no user");
     72        error_page("no user found");
    7373    }
    7474    $x = $user->prefs->banished_until;
    7575    if ($x>time()) {
    76         error_page("User is already banished");
     76        error_page(tra("User is already banished"));
    7777    }
    78     row1("Banish user");
    79     row1("Are you sure you want to banish ".$user->name."?
    80         This will prevent ".$user->name." from posting for chosen time period.<br />
    81         It should be done only if ".$user->name."
    82         has consistently exhibited trollish behavior.");
    83     row2("Ban duration", "<select name=\"duration\">
    84             <option value=\"14400\">4 hours</option>
    85             <option value=\"86400\">1 day</option>
    86             <option value=\"604800\">1 week</option>
    87             <option value=\"1209600\" selected=\"selected\">2 weeks</option>
    88             <option value=\"2592000\">1 month</option>
    89             <option value=\"-1\">Forever</option>
     78    row1(tra("Banish user"));
     79    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));
     80    row2(tra("Ban duration"), "<select name=\"duration\">
     81            <option value=\"14400\">".tra("4 hours")."</option>
     82            <option value=\"86400\">".tra("1 day")."</option>
     83            <option value=\"604800\">".tra("1 week")."</option>
     84            <option value=\"1209600\" selected=\"selected\">".tra("2 weeks")."</option>
     85            <option value=\"2592000\">".tra("1 month")."</option>
     86            <option value=\"-1\">".tra("Forever")."</option>
    9087        </select>");
    9188    echo "<input type=\"hidden\" name=\"action\" value=\"banish_user\">\n";
    9289    echo "<input type=\"hidden\" name=\"id\" value=\"".$postid."\">\n";
    9390    echo "<input type=\"hidden\" name=\"userid\" value=\"".$userid."\">\n";
    9491    echo "<input type=\"hidden\" name=\"confirmed\" value=\"yes\">\n";
    9592} else {
    96     error_page( "Unknown action");
     93    error_page("Unknown action");
    9794}
    9895
    99 row2("Optional explanation
    100     <br><span class=note>This is included in email to user</span>",
     96row2(tra("Optional explanation %1 This is included in email to user.%2", "<br><span class=note>", "</span>"),
    10197    "<textarea name=\"reason\" rows=\"10\" cols=\"80\"></textarea>");
    10298
    10399row2(
    104100    "",
    105     "<input type=\"submit\" name=\"submit\" value=\"OK\">"
     101    "<input type=\"submit\" name=\"submit\" value=\"".tra("OK")."\">"
    106102);
    107103
    108104end_table();
  • profile_menu.php

     
    5050        $user = lookup_user_id($profile->userid);
    5151        echo uotd_thumbnail($profile, $user);
    5252        echo user_links($user)."<br>";
    53         echo sub_sentence(output_transform(strip_tags($profile->response1)), ' ', 150, true);
     53        echo sub_sentence(output_transform(sanitize_tags($profile->response1)), ' ', 150, true);
    5454    }
    5555
    5656echo "</td></tr>";
  • team_edit_action.php

     
    2727$teamid = post_int("teamid");
    2828$team = BoincTeam::lookup_id($teamid);
    2929
    30 if (!$team) error_page(tra("no such team"));
     30if (!$team) error_page("no such team");
    3131require_admin($user, $team);
    3232
    33 $team_url = BoincDb::escape_string(strip_tags(post_str("url", true)));
     33$team_url = BoincDb::escape_string(sanitize_tags(post_str("url", true)));
    3434$x = strstr($team_url, "http://");
    3535if ($x) {
    3636    $team_url = substr($team_url, 7);
    3737}
    38 $team_name = BoincDb::escape_string(strip_tags(post_str("name")));
     38$team_name = BoincDb::escape_string(sanitize_tags(post_str("name")));
    3939$team_name_lc = strtolower($team_name);
    4040
    4141$tnh = post_str("name_html", true);
     
    5050    $country = "International";
    5151}
    5252if (!is_valid_country($country)) {
    53     error_page(tra("bad country"));
     53    error_page("bad country");
    5454}
    5555$joinable = post_str('joinable', true)?1:0;
    5656