Ticket #981: prefs_i18n.diff

File prefs_i18n.diff, 44.2 KB (added by Christian Beer, 14 years ago)

Adds localization to all preference files

  • inc/prefs.inc

    EigenschaftsÀnderungen: .
    ___________________________________________________________________
    GeÀndert: svn:ignore
       - .httpd.conf
    boinc.sln
    boinc.suo
    boinc_web.phpproj
    
       + .httpd.conf
    boinc.sln
    boinc.suo
    boinc_web.phpproj
    boinc-i18n.kpf
    
    
     
    6565
    6666// strings describing various preference fields
    6767//
    68 define("CPU_LIMIT_DESC", "Processor usage");
     68define("CPU_LIMIT_DESC", tra("Processor usage"));
    6969define("SUSPEND_WHILE_ON_BATTERIES_DESC",
    70     "Suspend work while computer is on battery power?
    71     <br><span class=note>(matters only for portable computers)</span>"
     70    tra("Suspend work while computer is on battery power? %1
     71        (matters only for portable computers)%2", "<br><span class=note>", "</span>")
    7272);
    7373define("RUN_IF_USER_ACTIVE_DESC",
    74     "Suspend work while computer is in use?"
     74    tra("Suspend work while computer is in use?")
    7575);
    7676define("RUN_GPU_IF_USER_ACTIVE_DESC",
    77     "Suspend GPU work while computer is in use?
    78     <br><span class=note>Enforced by version 6.7+</span>"
     77    tra("Suspend GPU work while computer is in use? %1
     78        Enforced by version 6.7+", "<br><span class=note>", "</span>")
    7979);
    80 define("IDLE_TIME_TO_RUN_DESC", "'In use' means mouse/keyboard activity in last");
     80define("IDLE_TIME_TO_RUN_DESC", tra("'In use' means mouse/keyboard activity in last"));
    8181define("SUSPEND_IF_NO_RECENT_INPUT_DESC",
    82     "Suspend work if no mouse/keyboard activity in last
    83     <br><span class=note>(Needed to enter low-power mode on some computers)</span>"
     82    tra("Suspend work if no mouse/keyboard activity in last %1
     83        (Needed to enter low-power mode on some computers)%2", "<br><span class=note>", "</span>")
    8484);
    8585define("SUSPEND_CPU_USAGE_DESC",
    86     "Suspend work if CPU usage is above<br><span class=note>0 means no restriction<br>Enforced by version 6.10.30+</span>"
     86    tra("Suspend work if CPU usage is above %1
     87        0 means no restriction<br>Enforced by version 6.10.30+%2", "<br><span class=note>", "</span>")
    8788);
    88 define("START_END_DESC", "Do work only between the hours of");
    89 define("START_END_DESC2", "<br><span class=note>(no restriction if equal)</span>");
     89define("START_END_DESC", tra("Do work only between the hours of"));
     90define("START_END_DESC2", "<br><span class=note>".tra("(no restriction if equal)")."</span>");
    9091define("LEAVE_APPS_IN_MEMORY_DESC",
    91     "Leave tasks in memory while suspended?
    92     <br><span class=note>(suspended tasks will consume swap space if 'yes')</span>");
    93 define("CPU_SCHEDULING_DESC", "Switch between tasks every
    94     <br><span class=note>(recommended: 60 minutes)</span>");
     92    tra("Leave tasks in memory while suspended? %1
     93        (suspended tasks will consume swap space if 'yes')%2", "<br><span class=note>", "</span>")
     94);
     95define("CPU_SCHEDULING_DESC",
     96    tra("Switch between tasks every %1
     97        (recommended: 60 minutes)%2", "<br><span class=note>", "</span>")
     98);
    9599define("CONFIRM_BEFORE_CONNECTING_DESC",
    96     "Confirm before connecting to Internet?
    97     <br><span class=note>(matters only if you have a modem, ISDN or VPN connection)</span>"
     100    tra("Confirm before connecting to Internet? %1
     101        (matters only if you have a modem, ISDN or VPN connection)%2", "<br><span class=note>", "</span>")
    98102);
    99103define("HANGUP_IF_DIALED_DESC",
    100     "Disconnect when done?
    101     <br><span class=note>(matters only if you have a modem, ISDN or VPN connection)</span>"
     104    tra("Disconnect when done? %1
     105        (matters only if you have a modem, ISDN or VPN connection)%2", "<br><span class=note>", "</span>")
    102106);
    103107define("WORK_BUF_MIN_DAYS_DESC",
    104     "Computer is connected to the Internet about every
    105     <br><span class=note>(Leave blank or 0 if always connected.
    106     <br>BOINC will try to maintain at least this much work.)</span>
    107     "
     108    tra("Computer is connected to the Internet about every %1
     109        (Leave blank or 0 if always connected.<br>
     110        BOINC will try to maintain at least this much work.)%2", "<br><span class=note>", "</span>")
    108111);
    109112define("WORK_BUF_ADDITIONAL_DAYS_DESC",
    110     "Maintain enough work for an additional"
     113    tra("Maintain enough work for an additional")
    111114);
    112 define("MAX_NCPUS_PCT_DESC", "On multiprocessors, use at most<span class=note><br>Enforced by version 6.1+</span>");
    113 define("MAX_NCPUS_PCT_DESC2", "% of the processors");
    114 define("MAX_CPUS_DESC", "On multiprocessors, use at most");
    115 define("MAX_CPUS_DESC2", "processors");
    116 define("USE_AT_MOST", "Use at most");
    117 define("USE_AT_MOST2", "Use at most<span class=note><br>(Can be used to reduce CPU heat)</span>");
    118 define("USE_AT_MOST3", "Use at most");
    119 define("CPU_USAGE_LIMIT_DESC2", "percent of CPU time");
    120 define("DISK_INTERVAL_DESC", "Tasks checkpoint to disk at most every");
    121 define("DISK_LIMIT_DESC", "Disk and memory usage");
    122 define("DISK_MIN_FREE_GB_DESC", "Leave at least");
    123 define("DISK_SCHED_MIN_FREE_DESC1", "<br><span class=note>(Values smaller than ");
    124 define("DISK_SCHED_MIN_FREE_DESC2", " are ignored)</span>");
    125 define("DISK_MAX_USED_PCT_DESC2", "% of total disk space");
    126 define("VM_MAX_USED_PCT_DESC2", "% of page file (swap space)");
    127 define("RAM_MAX_USED_BUSY_PCT_DESC2", "% of memory when computer is in use");
    128 define("RAM_MAX_USED_IDLE_PCT_DESC2", "% of memory when computer is not in use");
    129 define("NETWORK_LIMIT_DESC", "Network usage");
    130 define("MAX_BYTES_SEC_DOWN_DESC", "Maximum download rate:");
    131 define("MAX_BYTES_SEC_UP_DESC", "Maximum upload rate:");
    132 define("NET_START_END_DESC", "Use network only between the hours of");
     115define("MAX_NCPUS_PCT_DESC",
     116    tra("On multiprocessors, use at most %1 Enforced by version 6.1+%2", "<br><span class=note>", "</span>")
     117);
     118define("MAX_NCPUS_PCT_DESC2", tra("% of the processors"));
     119define("MAX_CPUS_DESC", tra("On multiprocessors, use at most"));
     120define("MAX_CPUS_DESC2", tra("processors"));
     121define("USE_AT_MOST", tra("Use at most"));
     122define("USE_AT_MOST2",
     123    tra("Use at most %1 (Can be used to reduce CPU heat)%2", "<br><span class=note>", "</span>")
     124);
     125define("USE_AT_MOST3", tra("Use at most"));
     126define("CPU_USAGE_LIMIT_DESC2", tra("percent of CPU time"));
     127define("DISK_INTERVAL_DESC", tra("Tasks checkpoint to disk at most every"));
     128define("DISK_LIMIT_DESC", tra("Disk and memory usage"));
     129define("DISK_MIN_FREE_GB_DESC", tra("Leave at least"));
     130define("DISK_SCHED_MIN_FREE_DESC",
     131    "<br><span class=note>".tra("(Values smaller than %s are ignored)")."</span>"
     132);
     133define("DISK_MAX_USED_PCT_DESC2", tra("% of total disk space"));
     134define("VM_MAX_USED_PCT_DESC2", tra("% of page file (swap space)"));
     135define("RAM_MAX_USED_BUSY_PCT_DESC2", tra("% of memory when computer is in use"));
     136define("RAM_MAX_USED_IDLE_PCT_DESC2", tra("% of memory when computer is not in use"));
     137define("NETWORK_LIMIT_DESC", tra("Network usage"));
     138define("MAX_BYTES_SEC_DOWN_DESC", tra("Maximum download rate:"));
     139define("MAX_BYTES_SEC_UP_DESC", tra("Maximum upload rate:"));
     140define("NET_START_END_DESC", tra("Use network only between the hours of"));
    133141define("DONT_VERIFY_IMAGES_DESC",
    134     "Skip image file verification?
    135     <br><span class=note>Check this ONLY if your Internet provider
    136     modifies image files (UMTS does this, for example).
    137     <br>Skipping verification reduces the security of BOINC.</span>"
     142    tra("Skip image file verification? %1
     143        Check this ONLY if your Internet provider modifies image files (UMTS does this, for example).<br />
     144        Skipping verification reduces the security of BOINC.%2", "<br><span class=note>", "</span>")
    138145);
    139 define('ATI_SELECT_DESC', "Use ATI GPU if present<br><span class=note>(enforced by 6.10+ clients)</span>");
    140 define('CUDA_SELECT_DESC', "Use NVIDIA GPU if present<br><span class=note>(enforced by 6.10+ clients)</span>");
    141 define('CPU_SELECT_DESC', "Use CPU<br><span class=note>(enforced by 6.10+ clients)</span>");
     146define('ATI_SELECT_DESC',
     147    tra("Use ATI GPU if present %1 (enforced by 6.10+ clients)%2", "<br><span class=note>", "</span>")
     148);
     149define('CUDA_SELECT_DESC',
     150    tra("Use NVIDIA GPU if present %1 (enforced by 6.10+ clients)%2", "<br><span class=note>", "</span>")
     151);
     152define('CPU_SELECT_DESC',
     153    tra("Use CPU % 1 (enforced by 6.10+ clients)%2", "<br><span class=note>", "</span>")
     154);
    142155
    143156
    144157define("BYTE_CONVERSION", 1000.0);
    145 define("BYTE_UNITS", "Kbytes/sec");
    146 define("BYTE_ABBR", "KB/s");
     158define("BYTE_UNITS", tra("Kbytes/sec"));
     159define("BYTE_ABBR", tra("KB/s"));
    147160define("ALLOW_BETA_WORK",
    148     "Run test applications?<br>
    149     <span class=note>This helps us develop applications,
    150     but may cause jobs to fail on your computer</span>"
     161    tra("Run test applications? %1
     162        This helps us develop applications, but may cause jobs to fail on your computer%2", "<br><span class=note>", "</span>")
    151163);
    152164
    153165// These texts are used in multiple places in prefs_edit.php and add_venue.php
    154 define("PREFS_FORM_DESC1", "These preferences apply to all the BOINC projects in which you participate.<br><br>");
    155 define("PREFS_FORM_ERROR_DESC", "<b>Unable to update preferences.</b> The values marked in red below were out of range or not numeric.<br><br>");
     166define("PREFS_FORM_DESC1", tra("These preferences apply to all the BOINC projects in which you participate.")."<br><br>");
     167define("PREFS_FORM_ERROR_DESC",
     168    tra("%1Unable to update preferences.%2 The values marked in red below were out of range or not numeric.", "<strong>", "</strong>").
     169    "<br><br>"
     170);
    156171
    157172global $text;
    158173global $parse_result;
     
    202217    if ($x == "home") return;
    203218    if ($x == "work") return;
    204219    if ($x == "school") return;
    205     error_page("bad venue: $x");
     220    error_page(tra("bad venue: %1", $x));
    206221}
    207222
    208223function check_subset($x) {
    209224    if ($x == "global") return;
    210225    if ($x == "project") return;
    211     error_page("bad subset: $x");
     226    error_page(tra("bad subset: %1", $x));
    212227}
    213228
    214229// functions to convert between max_bytes_sec_* as stored in the
     
    271286        $venue_name = $attrs["name"];
    272287        $top_parse_result = $parse_result;
    273288        $parse_result = default_prefs_global();
    274         //echo "VENUE PREFS AFTER INIT: <pre>";
    275         //var_dump($parse_result);
    276         //echo "</pre>";
    277289        break;
    278290    }
    279291    $text = "";
     
    288300
    289301    switch($name) {
    290302    case "venue":
    291         //echo "VENUE PREFS AFTER PARSE: <pre>";
    292         //var_dump($parse_result);
    293         //echo "</pre>";
    294303        $top_parse_result->$venue_name = $parse_result;
    295304        $parse_result = $top_parse_result;
    296305        break;
     
    619628    $type = $value === "--" ? "--" : $type;
    620629    switch($type) {
    621630    case "yesno":
    622         echo $value ?"yes":"no";
     631        echo $value ?tra("yes"):tra("no");
    623632        break;
    624633    case "noyes":
    625         echo $value ?"no":"yes";
     634        echo $value ?tra("no"):tra("yes");
    626635        break;
    627636    case "limit":
    628637        $x = max_bytes_display_mode($value);
    629638        $y = "$x " . BYTE_ABBR;
    630         echo $x ? "$y" : "no limit";
     639        echo $x ? "$y" : tra("no limit");
    631640        break;
    632641    case "minutes":
    633642        if ($value) {
     
    652661    $pre_add  = "<a href=add_venue.php?venue=";
    653662    $pre_edit  = "<a href=prefs_edit.php?venue=";
    654663    $pre_remove = "<a href=prefs_remove.php?venue=";
    655     $post_add = "&amp;subset=$subset&cols=1$tokens>Add</a>";
    656     $post_edit = "&amp;subset=$subset&cols=1$tokens>Edit</a>";
    657     $post_remove = "&amp;subset=$subset&cols=1$tokens>Remove</a>";
    658     $gen = "<a href=prefs_edit.php?subset=$subset&amp;cols=1$tokens>Edit</a>";
     664    $post_add = "&amp;subset=$subset&cols=1$tokens>".tra("Add")."</a>";
     665    $post_edit = "&amp;subset=$subset&cols=1$tokens>".tra("Edit")."</a>";
     666    $post_remove = "&amp;subset=$subset&cols=1$tokens>".tra("Remove")."</a>";
     667    $gen = "<a href=prefs_edit.php?subset=$subset&amp;cols=1$tokens>".tra("Edit")."</a>";
    659668
    660669    $hom  = isset($prefs->home) ? $pre_edit."home".$post_edit : $pre_add."home".$post_add;
    661670    $schl = isset($prefs->school) ? $pre_edit."school".$post_edit : $pre_add."school".$post_add;
     
    689698    row_defs(SUSPEND_WHILE_ON_BATTERIES_DESC, "suspend_while_on_batteries", "", "yesno", $prefs);
    690699    row_defs(RUN_IF_USER_ACTIVE_DESC, "suspend_if_user_active", "", "yesno", $prefs);
    691700    row_defs(RUN_GPU_IF_USER_ACTIVE_DESC, "suspend_gpu_if_user_active", "", "yesno", $prefs);
    692     row_defs(IDLE_TIME_TO_RUN_DESC, "idle_time_to_run", " minutes", "", $prefs);
     701    row_defs(IDLE_TIME_TO_RUN_DESC, "idle_time_to_run", tra("minutes"), "", $prefs);
    693702
    694     row_defs(SUSPEND_IF_NO_RECENT_INPUT_DESC, "suspend_if_no_recent_input", "minutes", "minutes", $prefs);
     703    row_defs(SUSPEND_IF_NO_RECENT_INPUT_DESC, "suspend_if_no_recent_input", tra("minutes"), "minutes", $prefs);
    695704    row_defs(SUSPEND_CPU_USAGE_DESC, "suspend_cpu_usage", "%", "", $prefs);
    696705
    697706    row_hours(START_END_DESC, "run", $prefs);
    698707
    699708    row_defs(LEAVE_APPS_IN_MEMORY_DESC, "leave_apps_in_memory", "", "yesno", $prefs);
    700     row_defs(CPU_SCHEDULING_DESC, "cpu_scheduling_period_minutes", " minutes", "", $prefs);
     709    row_defs(CPU_SCHEDULING_DESC, "cpu_scheduling_period_minutes", tra("minutes"), "", $prefs);
    701710    row_defs(MAX_CPUS_DESC, "max_cpus", MAX_CPUS_DESC2, "", $prefs);
    702711    row_defs(MAX_NCPUS_PCT_DESC, "max_ncpus_pct", MAX_NCPUS_PCT_DESC2, "", $prefs);
    703712    row_defs(USE_AT_MOST2, "cpu_usage_limit", CPU_USAGE_LIMIT_DESC2, "", $prefs);
    704713
    705714    row_top(DISK_LIMIT_DESC);
    706     row_defs(USE_AT_MOST, "disk_max_used_gb", " GB disk space", "", $prefs);
    707     row_defs(DISK_MIN_FREE_GB_DESC, "disk_min_free_gb", " GB disk space free", "", $prefs);
     715    row_defs(USE_AT_MOST, "disk_max_used_gb", tra("GB disk space"), "", $prefs);
     716    row_defs(DISK_MIN_FREE_GB_DESC, "disk_min_free_gb", tra("GB disk space free"), "", $prefs);
    708717    row_defs(USE_AT_MOST, "disk_max_used_pct", DISK_MAX_USED_PCT_DESC2, "", $prefs);
    709     row_defs(DISK_INTERVAL_DESC, "disk_interval", " seconds", "", $prefs);
     718    row_defs(DISK_INTERVAL_DESC, "disk_interval", tra("seconds"), "", $prefs);
    710719    row_defs(USE_AT_MOST, "vm_max_used_pct", VM_MAX_USED_PCT_DESC2, "", $prefs);
    711720    row_defs(USE_AT_MOST3, "ram_max_used_busy_pct", RAM_MAX_USED_BUSY_PCT_DESC2, "", $prefs);
    712721    row_defs(USE_AT_MOST3, "ram_max_used_idle_pct", RAM_MAX_USED_IDLE_PCT_DESC2, "", $prefs);
    713722
    714723    row_top(NETWORK_LIMIT_DESC);
    715     row_defs(WORK_BUF_MIN_DAYS_DESC, "work_buf_min_days", " days", "", $prefs);
    716     row_defs(WORK_BUF_ADDITIONAL_DAYS_DESC, "work_buf_additional_days", " days", "", $prefs);
     724    row_defs(WORK_BUF_MIN_DAYS_DESC, "work_buf_min_days", tra("days"), "", $prefs);
     725    row_defs(WORK_BUF_ADDITIONAL_DAYS_DESC, "work_buf_additional_days", tra("days"), "", $prefs);
    717726    row_defs(CONFIRM_BEFORE_CONNECTING_DESC, "confirm_before_connecting", "", "yesno", $prefs);
    718727    row_defs(HANGUP_IF_DIALED_DESC, "hangup_if_dialed", "", "yesno", $prefs);
    719728    row_defs(MAX_BYTES_SEC_DOWN_DESC, "max_bytes_sec_down", "", "limit", $prefs);
     
    731740
    732741function prefs_show_global($prefs) {
    733742    row1(CPU_LIMIT_DESC);
    734     row2(SUSPEND_WHILE_ON_BATTERIES_DESC, $prefs->suspend_while_on_batteries?"yes":"no");
    735     row2(RUN_IF_USER_ACTIVE_DESC, $prefs->suspend_if_user_active?"yes":"no");
    736     row2(RUN_GPU_IF_USER_ACTIVE_DESC, $prefs->suspend_gpu_if_user_active?"yes":"no");
    737     row2(IDLE_TIME_TO_RUN_DESC, "$prefs->idle_time_to_run minutes");
     743    row2(SUSPEND_WHILE_ON_BATTERIES_DESC, $prefs->suspend_while_on_batteries?tra("yes"):tra("no"));
     744    row2(RUN_IF_USER_ACTIVE_DESC, $prefs->suspend_if_user_active?tra("yes"):tra("no"));
     745    row2(RUN_GPU_IF_USER_ACTIVE_DESC, $prefs->suspend_gpu_if_user_active?tra("yes"):tra("no"));
     746    row2(IDLE_TIME_TO_RUN_DESC, tra("%1 minutes", $prefs->idle_time_to_run));
    738747
    739748    $x = show_double($prefs->suspend_if_no_recent_input);
    740     row2(SUSPEND_IF_NO_RECENT_INPUT_DESC, "$x minutes");
     749    row2(SUSPEND_IF_NO_RECENT_INPUT_DESC, tra("%1 minutes", $x));
    741750    $x = show_double($prefs->suspend_cpu_usage);
    742751    row2(SUSPEND_CPU_USAGE_DESC, "$x %");
    743752
    744753    if ($prefs->start_hour == $prefs->end_hour) {
    745         $x = "(no restriction)";
     754        $x = tra("(no restriction)");
    746755    } else {
    747756        $s = hour_str($prefs->start_hour);
    748757        $e = hour_str($prefs->end_hour);
    749         $x = "$s and $e";
     758        $x = "$s ".tra("and")." $e";
    750759    }
    751760    row2(START_END_DESC, $x);
    752     row2(LEAVE_APPS_IN_MEMORY_DESC, $prefs->leave_apps_in_memory?"yes":"no");
    753     row2(CPU_SCHEDULING_DESC, "$prefs->cpu_scheduling_period_minutes minutes");
     761    row2(LEAVE_APPS_IN_MEMORY_DESC, $prefs->leave_apps_in_memory?tra("yes"):tra("no"));
     762    row2(CPU_SCHEDULING_DESC, tra("%1 minutes", $prefs->cpu_scheduling_period_minutes));
    754763    $x = $prefs->max_cpus?$prefs->max_cpus:'---';
    755764    row2(MAX_CPUS_DESC, "$x ".MAX_CPUS_DESC2);
    756765    $x = $prefs->max_ncpus_pct?$prefs->max_ncpus_pct:'---';
    757766    row2(MAX_NCPUS_PCT_DESC, "$x ".MAX_NCPUS_PCT_DESC2);
    758767    row2(USE_AT_MOST2, "$prefs->cpu_usage_limit ".CPU_USAGE_LIMIT_DESC2);
    759768    row1(DISK_LIMIT_DESC);
    760     row2(USE_AT_MOST, "$prefs->disk_max_used_gb GB disk space");
     769    row2(USE_AT_MOST, tra("%1 GB disk space", $prefs->disk_max_used_gb));
    761770
    762771    $dp = get_disk_space_config();
    763772
    764773    $msg = null;
    765774    if ($dp->new_sched_flag) {
    766         $msg = DISK_SCHED_MIN_FREE_DESC1.$dp->sched_disk_min_free_gb.DISK_SCHED_MIN_FREE_DESC2;
     775        $msg = sprintf(DISK_SCHED_MIN_FREE_DESC, $dp->sched_disk_min_free_gb);
    767776    }
    768     row2(DISK_MIN_FREE_GB_DESC.$msg, "$prefs->disk_min_free_gb GB disk space free");
     777    row2(DISK_MIN_FREE_GB_DESC.$msg, tra("%1 GB disk space free", $prefs->disk_min_free_gb));
    769778    row2(USE_AT_MOST, "$prefs->disk_max_used_pct".DISK_MAX_USED_PCT_DESC2);
    770779    row2(DISK_INTERVAL_DESC, "$prefs->disk_interval seconds");
    771780    row2(USE_AT_MOST, "$prefs->vm_max_used_pct".VM_MAX_USED_PCT_DESC2);
    772781    row2(USE_AT_MOST3, "$prefs->ram_max_used_busy_pct".RAM_MAX_USED_BUSY_PCT_DESC2);
    773782    row2(USE_AT_MOST3, "$prefs->ram_max_used_idle_pct".RAM_MAX_USED_IDLE_PCT_DESC2);
    774783    row1(NETWORK_LIMIT_DESC);
    775     row2(WORK_BUF_MIN_DAYS_DESC, "$prefs->work_buf_min_days days");
    776     row2(WORK_BUF_ADDITIONAL_DAYS_DESC, "$prefs->work_buf_additional_days days");
    777     row2(CONFIRM_BEFORE_CONNECTING_DESC, $prefs->confirm_before_connecting?"yes":"no");
    778     row2(HANGUP_IF_DIALED_DESC, $prefs->hangup_if_dialed?"yes":"no");
     784    row2(WORK_BUF_MIN_DAYS_DESC, tra("%1 days", $prefs->work_buf_min_days));
     785    row2(WORK_BUF_ADDITIONAL_DAYS_DESC, tra("%1 days", $prefs->work_buf_additional_days));
     786    row2(CONFIRM_BEFORE_CONNECTING_DESC, $prefs->confirm_before_connecting?tra("yes"):tra("no"));
     787    row2(HANGUP_IF_DIALED_DESC, $prefs->hangup_if_dialed?tra("yes"):tra("no"));
    779788    $x = max_bytes_display_mode($prefs->max_bytes_sec_down);
    780789    $y = "$x " . BYTE_ABBR;
    781     row2(MAX_BYTES_SEC_DOWN_DESC, $x?"$y":"no limit");
     790    row2(MAX_BYTES_SEC_DOWN_DESC, $x?"$y":tra("no limit"));
    782791    $x = max_bytes_display_mode($prefs->max_bytes_sec_up);
    783792    $y = "$x " . BYTE_ABBR;
    784     row2(MAX_BYTES_SEC_UP_DESC, $x?"$y":"no limit");
     793    row2(MAX_BYTES_SEC_UP_DESC, $x?"$y":tra("no limit"));
    785794    if ($prefs->net_start_hour == $prefs->net_end_hour) {
    786         $x = "(no restriction)";
     795        $x = tra("(no restriction)");
    787796    } else {
    788797        $s = hour_str($prefs->net_start_hour);
    789798        $e = hour_str($prefs->net_end_hour);
    790         $x = "$s and $e";
     799        $x = "$s ".tra("and")." $e";
    791800    }
    792801    row2(NET_START_END_DESC, $x);
    793     row2(DONT_VERIFY_IMAGES_DESC, $prefs->dont_verify_images?"yes":"no");
     802    row2(DONT_VERIFY_IMAGES_DESC, $prefs->dont_verify_images?tra("yes"):tra("no"));
    794803}
    795804
    796805function prefs_show_resource($prefs, $columns=false) {
    797806    global $app_types;
    798     $x = "Resource share<br>
    799         <span class=note>If you participate in multiple BOINC projects,
    800         this is the proportion of your resources used by ".PROJECT."</span>
    801     ";
     807    $x = tra("Resource share %1
     808             If you participate in multiple BOINC projects,
     809             this is the proportion of your resources used by %2%3",
     810             "<br><span class=note>", PROJECT, "</span>"
     811        );
    802812    if ($columns) {
    803813        row_defs($x, "resource_share", "", "" ,$prefs);
    804814        if ($app_types->count > 1) {
     
    816826        row2($x, $prefs->resource_share);
    817827        if ($app_types->count > 1) {
    818828            if ($app_types->cpu) {
    819                 row2(CPU_SELECT_DESC, $prefs->no_cpu?"no":"yes");
     829                row2(CPU_SELECT_DESC, $prefs->no_cpu?tra("no"):tra("yes"));
    820830            }
    821831            if ($app_types->cuda) {
    822                 row2(CUDA_SELECT_DESC, $prefs->no_cuda?"no":"yes");
     832                row2(CUDA_SELECT_DESC, $prefs->no_cuda?tra("no"):tra("yes"));
    823833            }
    824834            if ($app_types->ati) {
    825                 row2(ATI_SELECT_DESC, $prefs->no_ati?"no":"yes");
     835                row2(ATI_SELECT_DESC, $prefs->no_ati?tra("no"):tra("yes"));
    826836            }
    827837        }
    828838    }
     
    832842    if ($columns) {
    833843        row_defs(ALLOW_BETA_WORK, "allow_beta_work", "", "yesno" ,$prefs);
    834844    } else {
    835         row2(ALLOW_BETA_WORK, $prefs->allow_beta_work?"yes":"no");
     845        row2(ALLOW_BETA_WORK, $prefs->allow_beta_work?tra("yes"):tra("no"));
    836846    }
    837847}
    838848
    839849function prefs_show_privacy($user) {
    840850    $x = "";
    841851    if (defined('EMAIL_FROM')) {
    842         $x = "<br><span class=note>Emails will be sent from ".EMAIL_FROM.";
    843             make sure your spam filter accepts this address.</span>";
     852        $x = "<br><span class=note>".
     853            tra("Emails will be sent from %1; make sure your spam filter accepts this address.", EMAIL_FROM).
     854            "</span>";
    844855    }
    845     row2("Is it OK for ".PROJECT." and your team (if any) to email you? $x",
    846         $user->send_email?"yes":"no"
     856    row2(tra("Is it OK for %1 and your team (if any) to email you?", PROJECT)." $x",
     857        $user->send_email?tra("yes"):tra("no")
    847858    );
    848     row2("Should ".PROJECT." show your computers on its web site?", $user->show_hosts?"yes":"no");
     859    row2(tra("Should %1 show your computers on its web site?", PROJECT), $user->show_hosts?tra("yes"):tra("no"));
    849860}
    850861
    851862function prefs_show_project($prefs, $columns=false) {
     
    861872}
    862873
    863874function subset_name($subset) {
    864     if ($subset == "global") return "Computing";
     875    if ($subset == "global") return tra("Computing");
    865876    return PROJECT;
    866877}
    867878
     
    873884    if (isset($prefs->$venue)) $x = $prefs->$venue;
    874885
    875886    if ($x) {
    876         row1("Separate preferences for $venue", 2, "heading");
     887        row1(tra("Separate preferences for %1", $venue), 2, "heading");
    877888        echo "<tr><td colspan=2>";
    878889        start_table();
    879890        if ($subset == "global") {
     
    883894            if ($project_has_beta) prefs_show_beta($x);
    884895            prefs_show_project($x);
    885896        }
    886         row2("<br>", "<a href=prefs_edit.php?venue=$venue&amp;subset=$subset$tokens>Edit preferences</a> | <a href=prefs_remove.php?venue=$venue&amp;subset=$subset$tokens>Remove</a>");
     897        row2("<br>", "<a href=prefs_edit.php?venue=$venue&amp;subset=$subset$tokens>".tra("Edit preferences")."</a> | <a href=prefs_remove.php?venue=$venue&amp;subset=$subset$tokens>".tra("Remove")."</a>");
    887898        end_table();
    888899        echo "</td></tr>\n";
    889900    } else {
    890         row1("<a href=add_venue.php?venue=$venue&amp;subset=$subset$tokens>Add separate preferences for $venue</a>", 2, "heading");
     901        row1("<a href=add_venue.php?venue=$venue&amp;subset=$subset$tokens>".tra("Add separate preferences for %1", $venue)."</a>", 2, "heading");
    891902    }
    892903}
    893904
     
    896907    $project_prefs = prefs_parse_project($user->project_prefs);
    897908
    898909    start_table();
    899     $switch_link = " <font size=\"-2\"><a href=prefs.php?subset=project&cols=". (int)!$columns .">(Switch View)</a></font>";
     910    $switch_link = " <font size=\"-2\"><a href=prefs.php?subset=project&cols=". (int)!$columns .">".tra("(Switch View)")."</a></font>";
    900911    if ($columns) {
    901         row1("Combined preferences".$switch_link, 2, "heading");
     912        row1(tra("Combined preferences").$switch_link, 2, "heading");
    902913        echo "<tr><td colspan=2>";
    903914        start_table();
    904915        prefs_show_privacy($user);
    905916        venue_show($user);
    906         row_top("Project specific settings");
     917        row_top(tra("Project specific settings"));
    907918        prefs_show_resource($project_prefs, true);
    908919        if ($project_has_beta) prefs_show_beta($project_prefs, true);
    909920        prefs_show_project($project_prefs, true);
     
    912923        echo "</td></tr>\n";
    913924    } else {
    914925        if (isset($project_prefs->home) || isset($project_prefs->work) || isset($project_prefs->school)) {
    915             row1("Primary (default) preferences".$switch_link, 2, "heading");
     926            row1(tra("Primary (default) preferences").$switch_link, 2, "heading");
    916927        }
    917928        echo "<tr><td colspan=2>";
    918929        start_table();
     
    922933        venue_show($user);
    923934        prefs_show_project($project_prefs, false);
    924935        $tokens = url_tokens($user->authenticator);
    925         row2("", "<a href=prefs_edit.php?subset=project$tokens>Edit ".PROJECT." preferences</a>");
     936        row2("", "<a href=prefs_edit.php?subset=project$tokens>".tra("Edit %1 preferences", PROJECT)."</a>");
    926937        end_table();
    927938        echo "</td></tr>\n";
    928939        prefs_display_venue($project_prefs, "home", "project");
     
    935946function print_prefs_display_global($user, $columns=false) {
    936947    $global_prefs = prefs_parse_global($user->global_prefs);
    937948
    938     echo "<span class=note>
    939         These apply to all BOINC projects in which you participate.
    940         <br>
    941         On computers attached to multiple projects,
    942         the most recently modified preferences will be used.
    943         </span>
    944         <br><br>
    945     ";
     949    echo "<span class=note>".
     950         tra("These apply to all BOINC projects in which you participate.<br>
     951             On computers attached to multiple projects, the most recently modified preferences will be used.").
     952         "</span><br><br>";
    946953    if (isset($global_prefs->mod_time)) {
    947         echo "
    948             Preferences last modified: ", pretty_time_str($global_prefs->mod_time), "
    949         ";
     954        echo tra("Preferences last modified:")." ".pretty_time_str($global_prefs->mod_time);
    950955    }
    951     echo "
    952         <br><br>
    953     ";
    954     $switch_link = " <font size=\"-2\"><a href=prefs.php?subset=global&cols=". (int)!$columns .">(Switch View)</a></font>";
     956    echo "<br><br>";
     957    $switch_link = " <font size=\"-2\"><a href=prefs.php?subset=global&cols=". (int)!$columns .">".tra("(Switch View)")."</a></font>";
    955958    start_table();
    956959    if ($columns) {
    957         row1("Combined preferences".$switch_link, 2, "heading");
     960        row1(tra("Combined preferences").$switch_link, 2, "heading");
    958961        echo "<tr><td colspan=2>";
    959962        start_table();
    960963        prefs_show_columns_global($global_prefs);
     
    963966
    964967    } else {
    965968        if (isset($global_prefs->home) || isset($global_prefs->work) || isset($global_prefs->school)) {
    966             row1("Primary (default) preferences".$switch_link, 2, "heading");
     969            row1(tra("Primary (default) preferences").$switch_link, 2, "heading");
    967970        }
    968971        echo "<tr><td colspan=2>";
    969972        start_table();
    970973        prefs_show_global($global_prefs);
    971974        $tokens = url_tokens($user->authenticator);
    972         row2("<br>", "<a href=prefs_edit.php?subset=global$tokens>Edit preferences</a>");
     975        row2("<br>", "<a href=prefs_edit.php?subset=global$tokens>".tra("Edit preferences")."</a>");
    973976        end_table();
    974977        echo "</td></tr>\n";
    975978
     
    10001003
    10011004    if ($action == "add") {
    10021005        $script = "add_venue.php";
    1003         $submit_value = "Add preferences";
     1006        $submit_value = tra("Add preferences");
    10041007    }
    10051008    if ($action == "edit") {
    10061009        $script = "prefs_edit.php";
    1007         $submit_value = "Update preferences";
     1010        $submit_value = tra("Update preferences");
    10081011    }
    10091012    echo "<form action=$script><input type=hidden name=subset value=$subset>
    10101013        ".form_tokens($user->authenticator);
     
    10381041// Functions to display preference subsets as forms
    10391042//
    10401043function prefs_form_global($user, $prefs, $error=false) {
    1041     //echo "IN PREFS_FORM_GLOBAL: <pre>";
    1042     //var_dump($prefs);
    1043     //echo "</pre>";
     1044
    10441045    row1(CPU_LIMIT_DESC);
    1045     $y = "yes <input type=radio name=suspend_while_on_batteries value=yes "
    1046         .($prefs->suspend_while_on_batteries?"checked":"")
    1047         ."> no <input type=radio name=suspend_while_on_batteries value=no "
    1048         .($prefs->suspend_while_on_batteries?"":"checked")
    1049         .">
    1050     ";
     1046    $y = prefs_form_radio_buttons("suspend_while_on_batteries", $prefs->suspend_while_on_batteries);
    10511047    row2(SUSPEND_WHILE_ON_BATTERIES_DESC, $y);
    10521048
    1053     $y = "yes <input type=radio name=suspend_if_user_active value=yes "
    1054         .($prefs->suspend_if_user_active?"checked":"")
    1055         ."> no <input type=radio name=suspend_if_user_active value=no "
    1056         .($prefs->suspend_if_user_active?"":"checked")
    1057         .">
    1058     ";
     1049    $y = prefs_form_radio_buttons("suspend_if_user_active", $prefs->suspend_if_user_active);
    10591050    row2(RUN_IF_USER_ACTIVE_DESC, $y);
    10601051
    1061     $y = "yes <input type=radio name=suspend_gpu_if_user_active value=yes "
    1062         .($prefs->suspend_gpu_if_user_active?"checked":"")
    1063         ."> no <input type=radio name=suspend_gpu_if_user_active value=no "
    1064         .($prefs->suspend_gpu_if_user_active?"":"checked")
    1065         .">
    1066     ";
     1052    $y = prefs_form_radio_buttons("suspend_gpu_if_user_active", $prefs->suspend_gpu_if_user_active);
    10671053    row2(RUN_GPU_IF_USER_ACTIVE_DESC, $y);
    10681054
    1069     $y = "<input size=5 name=idle_time_to_run value='$prefs->idle_time_to_run'> minutes ";
     1055    $y = "<input size=5 name=idle_time_to_run value='$prefs->idle_time_to_run'> ".tra("minutes");
    10701056    $show_error = false;
    10711057    if (isset($error->idle_time_to_run)) $show_error= true;
    10721058    row2(IDLE_TIME_TO_RUN_DESC, $y, $show_error);
    10731059
    1074     $y = "<input size=5 name=suspend_if_no_recent_input value='$prefs->suspend_if_no_recent_input'> minutes ";
     1060    $y = "<input size=5 name=suspend_if_no_recent_input value='$prefs->suspend_if_no_recent_input'> ".tra("minutes");
    10751061    $show_error = false;
    10761062    if (isset($error->suspend_if_no_recent_input)) $show_error= true;
    10771063    row2(SUSPEND_IF_NO_RECENT_INPUT_DESC, $y, $show_error);
     
    10821068    row2(SUSPEND_CPU_USAGE_DESC, $y, $show_error);
    10831069
    10841070    $x = START_END_DESC.START_END_DESC2;
    1085     $y = hour_select($prefs->start_hour, "start_hour")."and".hour_select($prefs->end_hour, "end_hour");
     1071    $y = hour_select($prefs->start_hour, "start_hour").tra("and").hour_select($prefs->end_hour, "end_hour");
    10861072    row2($x, $y);
    10871073
    10881074    $x = LEAVE_APPS_IN_MEMORY_DESC;
    1089     $y = "yes <input type=radio name=leave_apps_in_memory value=yes "
    1090         .($prefs->leave_apps_in_memory?"checked":"")
    1091         ."> no <input type=radio name=leave_apps_in_memory value=no "
    1092         .($prefs->leave_apps_in_memory?"":"checked")
    1093         .">
    1094     ";
     1075    $y = prefs_form_radio_buttons("leave_apps_in_memory", $prefs->leave_apps_in_memory);
    10951076    row2($x, $y);
    10961077
    1097     $y = "<input size=5 name=cpu_scheduling_period_minutes value='$prefs->cpu_scheduling_period_minutes'> minutes ";
     1078    $y = "<input size=5 name=cpu_scheduling_period_minutes value='$prefs->cpu_scheduling_period_minutes'> ".tra("minutes");
    10981079    $show_error = false;
    10991080    if (isset($error->cpu_scheduling_period_minutes)) $show_error= true;
    11001081    row2(CPU_SCHEDULING_DESC, $y, $show_error);
     
    11251106    $show_error = false;
    11261107    if (isset($error->disk_max_used_gb)) $show_error= true;
    11271108    row2(USE_AT_MOST,
    1128         "<input size=7 name=disk_max_used_gb value='$prefs->disk_max_used_gb'> Gbytes",
     1109        "<input size=7 name=disk_max_used_gb value='$prefs->disk_max_used_gb'> ".tra("Gbytes"),
    11291110        $show_error
    11301111    );
    11311112
     
    11331114
    11341115    $msg=null;
    11351116    if ($dp->new_sched_flag) {
    1136         $msg = DISK_SCHED_MIN_FREE_DESC1.$dp->sched_disk_min_free_gb.DISK_SCHED_MIN_FREE_DESC2;
     1117        $msg = sprintf(DISK_SCHED_MIN_FREE_DESC, $dp->sched_disk_min_free_gb);
    11371118    }
    11381119
    11391120    $show_error = false;
    11401121    if (isset($error->disk_min_free_gb)) $show_error= true;
    11411122    row2(DISK_MIN_FREE_GB_DESC.$msg,
    1142         "<input size=7 name=disk_min_free_gb value='$prefs->disk_min_free_gb'> Gbytes free",
     1123        "<input size=7 name=disk_min_free_gb value='$prefs->disk_min_free_gb'> ".tra("Gbytes free"),
    11431124        $show_error
    11441125    );
    11451126
     
    11531134    $show_error = false;
    11541135    if (isset($error->disk_interval)) $show_error= true;
    11551136    row2(DISK_INTERVAL_DESC,
    1156         "<input size=6 name=disk_interval value=$prefs->disk_interval> seconds",
     1137        "<input size=6 name=disk_interval value=$prefs->disk_interval> ".tra("seconds"),
    11571138        $show_error
    11581139    );
    11591140
     
    11801161
    11811162    row1(NETWORK_LIMIT_DESC);
    11821163    $x = WORK_BUF_MIN_DAYS_DESC;
    1183     $y = "<input size=5 name=work_buf_min_days value='$prefs->work_buf_min_days'> days";
     1164    $y = "<input size=5 name=work_buf_min_days value='$prefs->work_buf_min_days'> ".tra("days");
    11841165    $show_error = false;
    11851166    if (isset($error->work_buf_min_days)) $show_error= true;
    11861167    row2($x, $y, $show_error);
    11871168
    11881169    $x = WORK_BUF_ADDITIONAL_DAYS_DESC;
    1189     $y = "<input size=5 name=work_buf_additional_days value='$prefs->work_buf_additional_days'> days";
     1170    $y = "<input size=5 name=work_buf_additional_days value='$prefs->work_buf_additional_days'> ".tra("days");
    11901171    $show_error = false;
    11911172    if (isset($error->work_buf_additional_days)) $show_error= true;
    11921173    row2($x, $y, $show_error);
    11931174
    11941175    $x = CONFIRM_BEFORE_CONNECTING_DESC;
    1195     $y = "yes <input type=radio name=confirm_before_connecting value=yes "
    1196         .($prefs->confirm_before_connecting?"checked":"")
    1197         ."> no <input type=radio name=confirm_before_connecting value=no "
    1198         .($prefs->confirm_before_connecting?"":"checked")
    1199         .">
    1200     ";
     1176    $y = prefs_form_radio_buttons("confirm_before_connecting", $prefs->confirm_before_connecting);
    12011177    row2($x, $y);
    12021178
    12031179    $x = HANGUP_IF_DIALED_DESC;
    1204     $y = "yes <input type=radio name=hangup_if_dialed value=yes "
    1205         .($prefs->hangup_if_dialed?"checked":"")
    1206         ."> no <input type=radio name=hangup_if_dialed value=no "
    1207         .($prefs->hangup_if_dialed?"":"checked")
    1208         .">
    1209     ";
     1180    $y = prefs_form_radio_buttons("hangup_if_dialed", $prefs->hangup_if_dialed);
    12101181    row2($x, $y);
    12111182
    12121183    $d = max_bytes_display_mode($prefs->max_bytes_sec_down);
     
    12291200    );
    12301201
    12311202    $x = NET_START_END_DESC.START_END_DESC2;
    1232     $y = hour_select($prefs->net_start_hour, "net_start_hour")."and".hour_select($prefs->net_end_hour, "net_end_hour");
     1203    $y = hour_select($prefs->net_start_hour, "net_start_hour").tra("and").hour_select($prefs->net_end_hour, "net_end_hour");
    12331204    row2($x, $y);
    12341205    $x = DONT_VERIFY_IMAGES_DESC;
    1235     $y = "yes <input type=radio name=dont_verify_images value=yes "
    1236         .($prefs->dont_verify_images?"checked":"")
    1237         ."> no <input type=radio name=dont_verify_images value=no "
    1238         .($prefs->dont_verify_images?"":"checked")
    1239         .">
    1240     ";
     1206    $y = prefs_form_radio_buttons("dont_verify_images", $prefs->dont_verify_images);
    12411207    row2($x, $y);
    12421208
    12431209}
    12441210
    12451211function prefs_form_privacy($user) {
    1246     $y = "yes <input type=radio name=send_email value=yes "
    1247         .($user->send_email?"checked":"")
    1248         ."> no <input type=radio name=send_email value=no "
    1249         .($user->send_email?"":"checked")
    1250         .">
    1251     ";
    1252     row2("Is it OK for ".PROJECT." and your team (if any) to email you?", $y);
     1212    $y = prefs_form_radio_buttons("send_email", $user->send_email);
     1213    row2(tra("Is it OK for %1 and your team (if any) to email you?", PROJECT), $y);
    12531214
    1254     $y = "yes <input type=radio name=show_hosts value=yes "
    1255         .($user->show_hosts?"checked":"")
    1256         ."> no <input type=radio name=show_hosts value=no "
    1257         .($user->show_hosts?"":"checked")
    1258         .">
    1259     ";
    1260     row2("Should ".PROJECT." show your computers on its web site?", $y);
     1215    $y = prefs_form_radio_buttons("show_hosts", $user->show_hosts);
     1216    row2(tra("Should %1 show your computers on its web site?", PROJECT), $y);
    12611217}
    12621218
    12631219function prefs_form_resource($prefs, $error=false) {
     
    12651221    $show_error = false;
    12661222    if (isset($error->resource_share)) $show_error= true;
    12671223    row2(
    1268         "<b>Resource share:</b>
    1269         <span class=note><br>Determines the proportion of your computer's resources
    1270         allocated to this project.
    1271         Example: if you participate in two BOINC projects with
    1272         resource shares of 100 and 200,
    1273         the first will get 1/3 of your resources and the second will get 2/3.
    1274         </span>",
     1224        "<strong>".tra("Resource share").":</strong>
     1225        <br><span class=note>".
     1226        tra("Determines the proportion of your computer's resources
     1227            allocated to this project. Example: if you participate in two
     1228            BOINC projects with resource shares of 100 and 200, the first
     1229            will get 1/3 of your resources and the second will get 2/3.").
     1230        "</span>",
    12751231        "<input name=resource_share value='$prefs->resource_share'>",
    12761232        $show_error
    12771233    );
     
    12951251}
    12961252
    12971253function prefs_form_beta($prefs, $error=false) {
    1298     $ychecked = $prefs->allow_beta_work?"checked":"";
    1299     $nchecked = $prefs->allow_beta_work?"":"checked";
    1300     row2(
    1301         ALLOW_BETA_WORK,
    1302         "yes <input type=radio checkbox name=allow_beta_work value=1 $ychecked>
    1303         no <input type=radio checkbox name=allow_beta_work value=0 $nchecked>"
    1304     );
     1254    $y = prefs_form_radio_buttons("allow_beta_work", $prefs->allow_beta_work);
     1255    row2(ALLOW_BETA_WORK, $y);
    13051256}
    13061257
    13071258function prefs_form_project($prefs_xml, $error=false) {
     
    13091260    project_specific_prefs_edit($prefs, $error);
    13101261}
    13111262
     1263// returns a set of translated yes/no radio buttons for editing prefs forms
     1264// Example: prefs_form_radio_buttons("allow_beta_work", $user->allow_beta_work);
     1265//
     1266// @param string $name name of the radio buttons
     1267// @param bool $yesno toggles the preset of the buttons; true=yes, false=no
     1268function prefs_form_radio_buttons($name, $yesno) {
     1269    $rb = tra("yes")." <input type=radio name=$name value=yes "
     1270        .($yesno?"checked":"")
     1271        ."> ".tra("no")." <input type=radio name=$name value=no "
     1272        .(!$yesno?"":"checked")
     1273        .">\n";
     1274    return $rb;
     1275}
     1276
    13121277function venue_show($user) {
    13131278    $venue = $user->venue;
    13141279    if ($venue =='') $venue = '---';
    1315     row2("Default computer location", $venue);
     1280    row2(tra("Default computer location"), $venue);
    13161281}
    13171282
    13181283function venue_form($user) {
     
    13211286    if ($user->venue == 'home') $h = 'selected';
    13221287    if ($user->venue == 'work') $w = 'selected';
    13231288    if ($user->venue == 'school') $s = 'selected';
    1324     row2('Default computer location',
     1289    row2(tra("Default computer location"),
    13251290        "<select name=default_venue>
    13261291        <option value=\"\" $n>---
    1327         <option value=home $h>Home
    1328         <option value=work $w>Work
    1329         <option value=school $s>School
     1292        <option value=home $h>".tra("Home")."
     1293        <option value=work $w>".tra("Work")."
     1294        <option value=school $s>".tra("School")."
    13301295        </select>"
    13311296    );
    13321297}
     
    14521417}
    14531418
    14541419function prefs_beta_parse_form(&$prefs) {
    1455     $prefs->allow_beta_work = false;
    1456     $x = $_GET['allow_beta_work'];
    1457     if ($x) {
    1458         $prefs->allow_beta_work = true;
    1459     }
     1420    $prefs->allow_beta_work = ($_GET['allow_beta_work'] == "yes")?1:0;
    14601421}
    14611422
    14621423function prefs_privacy_parse_form(&$user) {
     
    16051566    $query = "update user set global_prefs='$prefs_xml' where id=$user->id";
    16061567    $retval = mysql_query($query);
    16071568    if (!$retval) {
    1608         echo "Update failed: ".htmlspecialchars($query)."\n";
     1569        echo tra("Update failed: ").htmlspecialchars($query)."\n";
    16091570        echo mysql_error();
    16101571        exit();
    16111572    }
  • user/prefs_remove.php

     
    4343    }
    4444    Header("Location: prefs.php?subset=$subset$c");
    4545} else {
    46     page_head("Confirm delete preferences");
     46    page_head(tra("Confirm delete preferences"));
    4747    $tokens = url_tokens($user->authenticator);
    48     echo "
    49         <p>
    50         Are you sure you want to delete your separate ", subset_name($subset),
    51         " preferences for $venue?
    52         <br><br>
    53     ";
     48    echo "<p>".
     49        tra("Are you sure you want to delete your separate %1 preferences for %2?", subset_name($subset), $venue).
     50        "</p><br><br>\n";
    5451    show_button(
    5552        "prefs_remove.php?subset=$subset&amp;venue=$venue&amp;confirmed=yes$c$tokens",
    56         'Yes', "Remove preferences"
     53        tra("Yes"), tra("Remove preferences")
    5754    );
    58     show_button("prefs.php?subset=$subset$c", "Cancel", "Cancel");
     55    show_button("prefs.php?subset=$subset$c", tra("Cancel"), tra("Cancel"));
    5956    page_tail();
    6057}
    6158
  • user/prefs.php

     
    3030$columns = get_int("cols", true);
    3131$updated = get_int("updated", true);
    3232
    33 page_head(subset_name($subset)." preferences");
     33page_head(subset_name($subset)." ".tra("preferences"));
    3434if (isset($updated)) {
    3535        echo "<p style='color: red'>
    36         Your preferences have been updated.
    37         Client-related preferences
    38         will take effect when your computer communicates
    39         with ".PROJECT." or
    40         you issue the \"Update\" command from the BOINC client.
     36        ".tra("Your preferences have been updated. Client-related preferences
     37              will take effect when your computer communicates with %1
     38              or you issue the %2Update%3 command from the BOINC client.",
     39              PROJECT, "<strong>", "</strong>")."
    4140        </p>
    4241    ";
    4342}
  • user/prefs_edit.php

     
    4242        else $prefs = $main_prefs;
    4343        $error = prefs_global_parse_form($prefs);
    4444        if ($error != false) {
    45             $title = "Edit ".subset_name($subset)." preferences";
     45            $title = tra("Edit %1 preferences", subset_name($subset));
    4646            if ($venue) $title = "$title for $venue";
    4747            page_head($title);
    4848            $x = $venue?"&venue=$venue":"";
     
    6868        $error = prefs_resource_parse_form($prefs);
    6969        if (isset($project_has_beta) && $project_has_beta) prefs_beta_parse_form($prefs);
    7070        if ($error != false || $project_error != false) {
    71             $title = "Edit ".subset_name($subset)." preferences";
    72             if ($venue) $title = "$title for $venue";
     71            $title = tra("Edit %1 preferences", subset_name($subset));
     72            if ($venue) $title = tra("%1 for %2", $title, $venue);
    7373            page_head($title);
    7474            $x = $venue?"&venue=$venue":"";
    7575
     
    9797        }
    9898    }
    9999} else {
    100     $title = "Edit ".subset_name($subset)." preferences";
    101     if ($venue) $title = "$title for $venue";
     100    $title = tra("Edit %1 preferences", subset_name($subset));
     101    if ($venue) $title = tra("%1 for %2", $title, $venue);
    102102    page_head($title);
    103103    $x = $venue?"&venue=$venue":"";
    104104
     
    116116    }
    117117    print_prefs_form("edit", $subset, $venue, $user, $prefs, $columns);
    118118}
    119 echo "<a href=prefs.php?subset=$subset$x$c>Back to preferences</a>\n";
     119echo "<a href=prefs.php?subset=$subset$x$c>".tra("Back to preferences")."</a>\n";
    120120page_tail();
    121121
    122122$cvs_version_tracker[]="\$Id$";  //Generated automatically - do not edit
  • user/add_venue.php

     
    4040        $prefs->$venue = $prefs;
    4141        $error = prefs_global_parse_form($new_prefs);
    4242        if ($error != false) {
    43             $title = "Edit ".subset_name($subset)." preferences";
     43            $title = tra("Edit %1 preferences", subset_name($subset));
    4444            if ($venue) $title = "$title for $venue";
    4545            page_head($title);
    4646            $x = $venue?"&venue=$venue":"";
     
    6565        if (isset($project_has_beta) && $project_has_beta) prefs_beta_parse_form($new_prefs);
    6666
    6767        if ($error != false || $project_error != false) {
    68             $title = "Edit ".subset_name($subset)." preferences";
     68            $title = tra("Edit %1 preferences", subset_name($subset));
    6969            if ($venue) $title = "$title for $venue";
    7070            page_head($title);
    7171            $x = $venue?"&venue=$venue":"";
     
    8383        }
    8484    }
    8585} else {
    86     $title = "Add ".subset_name($subset)." preferences for $venue";
     86    $title = tra("Add %1 preferences for %2", subset_name($subset), $venue);
    8787    page_head($title);
    8888
    8989    if ($subset == "global") {