From 335f5506a9b7a3f70e738270f27d3c3ccddad9ff Mon Sep 17 00:00:00 2001 From: David Anderson Date: Sun, 10 Jan 2010 04:28:54 +0000 Subject: [PATCH] - user web: make user search translatable svn path=/trunk/boinc/; revision=20118 --- checkin_notes | 6 ++++++ html/user/donations.php | 21 ++++++++++++++------ html/user/user_search.php | 41 ++++++++++++++++++++------------------- 3 files changed, 42 insertions(+), 26 deletions(-) diff --git a/checkin_notes b/checkin_notes index 45c8d85a7d..ceb69cf8cd 100644 --- a/checkin_notes +++ b/checkin_notes @@ -252,3 +252,9 @@ David 9 Jan 2010 sim.cpp,h time_stats.cpp work_fetch.cpp + +David 9 Jan 2010 + - user web: make user search translatable + html/user/ + donations.php + user_search.php diff --git a/html/user/donations.php b/html/user/donations.php index fb1537b0cb..1abd1f02f5 100644 --- a/html/user/donations.php +++ b/html/user/donations.php @@ -34,12 +34,21 @@ page_head(PROJECT." donations"); if (function_exists("donations_intro")) { donations_intro(); } else { - echo "
This project is accepting donations via PayPal.
\n"; - echo "
To donate, fill in the amount you want to donate using the field below. PayPal is accepting - multiple currencies (Canadian Dollars, Euros, Pounds Sterling, U.S. Dollars, Yen, Australian Dollars, New Zealand Dollars, - Swiss Francs, Hong Kong Dollars, Singapore Dollars, Swedish Kronor, Danish Kroner, Polish Zloty, Norwegian Kroner, - Hungarian Forint, Czech Koruna). You can use included currency converter to see the donation amount equivalent in different - currencies (please note that the rates are only estimates and the actual amount may differ).
"; + echo "
This project is accepting donations via + PayPal.
+
+ To donate, fill in the amount you want to donate using the field below. + PayPal is accepting multiple currencies + (Canadian Dollars, Euros, Pounds Sterling, U.S. Dollars, + Yen, Australian Dollars, New Zealand Dollars, + Swiss Francs, Hong Kong Dollars, Singapore Dollars, Swedish Kronor, + Danish Kroner, Polish Zloty, Norwegian Kroner, + Hungarian Forint, Czech Koruna). + You can use included currency converter + to see the donation amount equivalent in different currencies + (please note that the rates are only estimates + and the actual amount may differ).
+ "; } echo "\n"; diff --git a/html/user/user_search.php b/html/user/user_search.php index ab5753139c..7b075cdebe 100644 --- a/html/user/user_search.php +++ b/html/user/user_search.php @@ -49,7 +49,8 @@ require_once("../inc/user.inc"); function filter_user($user, $filter) { if ($filter->do_country && $user->country!=$filter->country) return false; if ($filter->do_profile) { - if (!($user->has_profile!=0 xor $filter->has_profile)) return false; + if ($user->has_profile and !$filter->has_profile) return false; + if (!$user->has_profile and $filter->has_profile) return false; } if ($filter->do_team) { if ($filter->team xor $user->teamid!=0) return false; @@ -60,7 +61,7 @@ function filter_user($user, $filter) { function show_user($user) { echo " - ", user_links($user), " + ", $user->id, user_links($user), " "; if ($user->teamid) { $team = BoincTeam::lookup_id($user->teamid); @@ -98,7 +99,7 @@ function do_search($order, $filter) { } } start_table(); - table_header("Name", "Team", "Average credit", "Total credit", "Country", "Joined"); + table_header(tra("Name"), tra("Team"), tra("Average credit"), tra("Total credit"), tra("Country"), tra("Joined")); foreach ($filtered_list as $user) { show_user($user); } @@ -109,26 +110,26 @@ function search_form() { page_head("User search"); echo "
"; start_table(); - row1("Search type", 2, "heading"); - row2("User name starts with ", ""); - row2("Decreasing sign-up time", ""); - row2("Decreasing average credit", ""); - row2("Decreasing total credit", ""); - row1("Filters", 2, "heading"); - row2_init("Country", "", ""); + row2(tra("Decreasing sign-up time"), ""); + row2(tra("Decreasing average credit"), ""); + row2(tra("Decreasing total credit"), ""); + row1(tra("Filters"), 2, "heading"); + row2_init(tra("Country"), ""; - row2("With profile?", + row2(tra("With profile?"), " Either No Yes "); - row2("On a team?", + row2(tra("On a team?"), " Either No Yes "); - row2("", ""); + row2("", ""); end_table(); echo " @@ -142,7 +143,7 @@ function name_search($filter) { $search_string = get_str('search_string'); if (strlen($search_string)<3) { - error_page("search string must be at least 3 characters"); + error_page(tra("search string must be at least 3 characters")); } $s = boinc_real_escape_string($search_string); $s = escape_pattern($s); @@ -152,9 +153,9 @@ function name_search($filter) { foreach ($users as $user) { if (!filter_user($user, $filter)) continue; if ($n==0) { - echo "

User names starting with '".htmlspecialchars($search_string)."'

\n"; + echo "

".tra("User names starting with")." '".htmlspecialchars($search_string)."'

\n"; start_table(); - table_header("Name", "Team", "Average credit", "Total credit", "Country", "Joined"); + table_header(tra("Name"), tra("Team"), tra("Average credit"), tra("Total credit"), tra("Country"), tra("Joined")); } show_user($user); @@ -162,7 +163,7 @@ function name_search($filter) { } end_table(); if (!$n) { - echo "No users matching your search criteria."; + echo tra("No users match your search criteria."); } } @@ -197,11 +198,11 @@ function main() { switch (get_str('profile')) { case 'yes': $filter->do_profile = true; - $filter->profile = true; + $filter->has_profile = true; break; case 'no': $filter->do_profile = true; - $filter->profile = false; + $filter->has_profile = false; break; case 'either': $filter->do_profile = false; @@ -220,7 +221,7 @@ function main() { $filter->do_team = false; break; } - page_head("User search results"); + page_head(tra("User search results")); if ($search_type == 'name_prefix') { name_search($filter); } else {