From b2304c576c59dce227e7bb97cd123b48476aa0c6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rytis=20Slatkevi=C4=8Dius?= Date: Mon, 4 Aug 2008 10:07:09 +0000 Subject: [PATCH] user web: make team.inc translatable, and update en.po using the new script (fix #661) svn path=/trunk/boinc/; revision=15747 --- checkin_notes | 10 + html/inc/team.inc | 170 +++-- html/languages/translations/en.po | 1143 ++++++++++++++++------------- 3 files changed, 731 insertions(+), 592 deletions(-) diff --git a/checkin_notes b/checkin_notes index e1cc900570..c365f235d4 100644 --- a/checkin_notes +++ b/checkin_notes @@ -6101,3 +6101,13 @@ Rytis 4 Aug 2008 tools/ build_po.pl + +Rytis 4 Aug 2008 + - user web: make team.inc translatable, and update en.po using the + new script (fix #661) + + html/ + inc/ + team.inc + languages/translations/ + en.po diff --git a/html/inc/team.inc b/html/inc/team.inc index 4e88c8e5ba..468c01aefd 100644 --- a/html/inc/team.inc +++ b/html/inc/team.inc @@ -11,50 +11,46 @@ require_once("../inc/team_types.inc"); require_once("../inc/time.inc"); function team_search_form($params) { - echo " -
- "; + echo ''; start_table(); - row2("Search criteria (use one or more)", ""); - row2('Key words
Find teams with these words in their names or descriptions', + row2(''.tra('Search criteria (use one or more)').'', ''); + row2(tra('Key words').'
'.tra('Find teams with these words in their names or descriptions').'', ''); - row2_init("Country", ""); + row2_init(tra('Country'), ''); echo '\n"; - row2("Type of team", team_type_select($params->type, true)); + row2(tra('Type of team'), team_type_select($params->type, true)); $checked = $params->active?"checked":""; - row2("Show only active teams", ""); - row2("", ''); + row2(tra('Show only active teams'), ''); + row2('', ''); end_table(); - echo " -
- "; + echo ''; } function foundership_transfer_link($user, $team) { $now = time(); if ($team->ping_user == $user->id) { if (transfer_ok($team, $now)) { - return "Requested by you, and founder response deadline has passed. + return tra('Requested by you, and founder response deadline has passed.').'
- Complete foundership transfer. - "; + '.tra('Complete foundership transfer').'. + '; } else { $deadline = date_str(transfer_ok_time($team)); - return 'Requested by you; founder response deadline is '.$deadline; + return ''.tra('Requested by you').'; '.tra('founder response deadline is %1', $deadline); } } if (new_transfer_request_ok($team, $now)) { if ($team->userid == $user->id) { - return "None"; + return tra('None'); } else { - return 'Initiate request'; + return ''.tra('Initiate request').''; } } - return "Deferred"; + return ''.tra('Deferred').''; } function display_team_page($team, $user) { @@ -63,9 +59,9 @@ function display_team_page($team, $user) { echo sanitize_html($team->name_html); echo "

"; start_table(); - row1("Team info"); + row1(tra('Team info')); if (strlen($team->description)) { - row2("Description", sanitize_html($team->description)); + row2(tra('Description'), sanitize_html($team->description)); } if (strlen($team->url)) {; if (strstr($team->url, "http://")) { @@ -73,45 +69,45 @@ function display_team_page($team, $user) { } else { $x = "http://$team->url"; } - row2("Web site", "$x"); + row2(tra('Web site'), "$x"); } if (!no_computing()) { - row2("Total credit", format_credit_large($team->total_credit)); - row2("Recent average credit", format_credit_large($team->expavg_credit)); + row2(tra('Total credit'), format_credit_large($team->total_credit)); + row2(tra('Recent average credit'), format_credit_large($team->expavg_credit)); } - row2("Country", $team->country); - row2("Type", team_type_name($team->type)); + row2(tra('Country'), $team->country); + row2(tra('Type'), team_type_name($team->type)); if ($team->forum && is_forum_visible_to_user($team->forum, $user)) { $f = $team->forum; - row2("id>Message board", - "Threads: $f->threads
Posts: $f->posts
Last post: ".time_diff_str($f->timestamp, time()) + row2(''.tra('Message board').'', + tra('Threads').': '.$f->threads.'
'.tra('Posts').': '.$f->posts.'
'.tra('Last post').': '.time_diff_str($f->timestamp, time()) ); } if ($user) { if ($user->teamid != $team->id) { $tokens = url_tokens($user->authenticator); row2("", - "Join this team -
Note: if 'OK to email' is set in your project preferences, joining a team gives its founder access to your email address." + ''.tra('Join this team').' +
'.tra('Note: if \'OK to email\' is set in your project preferences, joining a team gives its founder access to your email address.').'' ); } if (($user->teamid == $team->id)) { if (($user->id == $team->userid)) { if ($team->ping_user) { $deadline = date_str(transfer_ok_time($team)); - row2("Foundership change requested", - "id>Respond by $deadline" + row2(tra('Foundership change requested'), + ''.tra('Respond by %1', $deadline).'' ); } } else { - row2("Team foundership change", foundership_transfer_link($user, $team)); + row2(tra('Team foundership change'), foundership_transfer_link($user, $team)); } } } - row1("Members"); - row2("Founder", user_links($team->founder)); + row1(tra('Members')); + row2(tra('Founder'), user_links($team->founder)); if (count($team->admins)) { $first = true; $x = ""; @@ -123,7 +119,7 @@ function display_team_page($team, $user) { } $x .= user_links($a); } - row2("Admins", $x); + row2(tra('Admins'), $x); } $x = "0"; if (count($team->new_members)) { @@ -138,10 +134,10 @@ function display_team_page($team, $user) { $x .= user_links($a); } } - row2("New members in last day", $x); - row2("Total members", "$team->nusers (id&offset=0&sort_by=expavg_credit>view)"); - row2("Active members", "$team->nusers_active (id&offset=0&sort_by=expavg_credit>view)"); - row2("Members with credit", "$team->nusers_worked (id&offset=0&sort_by=total_credit>view)"); + row2(tra('New members in last day'), $x); + row2(tra('Total members'), "$team->nusers (id&offset=0&sort_by=expavg_credit>".tra('view').")"); + row2(tra('Active members'), "$team->nusers_active (id&offset=0&sort_by=expavg_credit>".tra('view').")"); + row2(tra('Members with credit'), "$team->nusers_worked (id&offset=0&sort_by=total_credit>".tra('view').")"); end_table(); } @@ -163,33 +159,33 @@ function display_team_members($team, $offset, $sort_by) { } start_table(); - echo " - Name - "; + echo ' + '.tra('Name').' + '; if (!no_computing()) { if ($nosort) { - echo " - Total credit - Recent average credit - "; + echo ' + '.tra('Total credit').' + '.tra('Recent average credit').' + '; } else { if ($sort_by == "total_credit") { - echo "Total credit"; + echo ''.tra('Total credit').''; } else { - echo "id&sort_by=total_credit&offset=$offset>Total credit"; + echo "id&sort_by=total_credit&offset=$offset>".tra('Total credit').""; } if ($sort_by == "expavg_credit") { - echo "Recent average credit"; + echo ''.tra('Recent average credit').''; } else { - echo "id&sort_by=expavg_credit&offset=$offset>Recent average credit"; + echo "id&sort_by=expavg_credit&offset=$offset>".tra('Recent average credit').''; } } } - echo " - Country + echo ' + '.tra('Country').' - "; + '; if ($nosort) { $users = BoincUser::enum("teamid=$team->id limit $offset,$n"); @@ -203,9 +199,9 @@ function display_team_members($team, $offset, $sort_by) { $user_expavg_credit = format_credit($user->expavg_credit); $x = user_links($user); if ($user->id == $team->userid) { - $x .= " [Founder]"; + $x .= ' ['.tra('Founder').']'; } else if (is_team_admin_aux($user, $admins)) { - $x .= " [Admin]"; + $x .= ' ['.tra('Admin').']'; } echo " $j) $x @@ -226,11 +222,11 @@ function display_team_members($team, $offset, $sort_by) { if ($offset > 0) { $new_offset = $offset - $n; - echo "id&sort_by=$sort_by&offset=$new_offset>Last $n | "; + echo "id&sort_by=$sort_by&offset=$new_offset>".tra('Last %1', $n)." | "; } if ($j == $offset + $n + 1) { $new_offset = $offset + $n; - echo "id&sort_by=$sort_by&offset=$new_offset>Next $n"; + echo "id&sort_by=$sort_by&offset=$new_offset>".tra('Next %1', $n).""; } } @@ -238,7 +234,7 @@ function display_team_members($team, $offset, $sort_by) { // function require_team($team) { if (!$team) { - error_page("No such team."); + error_page(tra('No such team.')); } } @@ -251,7 +247,7 @@ function is_team_founder($user, $team) { function require_founder_login($user, $team) { require_team($team); if ($user->id != $team->userid) { - error_page("This operation requires foundership."); + error_page(tra('This operation requires foundership.')); } } @@ -275,7 +271,7 @@ function is_team_admin_aux($user, $admins) { function require_admin($user, $team) { if (!is_team_admin($user, $team)) { - error_page("This operation requires team admin privileges"); + error_page(tra('This operation requires team admin privileges')); } } @@ -306,23 +302,23 @@ function admin_list($teamid) { function team_table_start($sort_by, $type_url) { echo " - ".tra("Rank")." - ".tra("Name")." - ".tra("Members")." + ".tra('Rank')." + ".tra('Name')." + ".tra('Members')." "; if ($sort_by == "total_credit") { echo " - ".tra("Recent average credit")." - ".tra("Total credit")." + ".tra('Recent average credit')." + ".tra('Total credit')." "; } else { echo " - ".tra("Recent average credit")." - ".tra("Total credit")." + ".tra('Recent average credit')." + ".tra('Total credit')." "; } echo " - ".tra("Country")." + ".tra('Country')." Type "; @@ -371,38 +367,36 @@ function team_edit_form($team, $label, $url) { if ($team) { echo "id>\n"; } - echo " + echo '

- Privacy note: if you create a team, your project preferences - (resource share, graphics preferences) - will be visible to the public. + '.tra('%1Privacy note%2: if you create a team, your project preferences (resource share, graphics preferences) will be visible to the public.', '', '').'

- "; + '; start_table(); - row2( "Team name, text version -
Don't use HTML tags. ", + row2(tra('Team name, text version').' +
'.tra('Don\'t use HTML tags.').'', "" ); - row2("Team name, HTML version -
- You may use limited HTML tags. - If you don't know HTML, leave this box blank.", + row2(tra('Team name, HTML version').' +
+ '.tra('You may use %1limited HTML tags%2.', '', '').' + '.tra('If you don\'t know HTML, leave this box blank.').'', "name_html)."\">" ); - row2("URL of team web page, if any:
(without \"http://\") - This URL will be linked to from the team's page on this site.", + row2(tra('URL of team web page, if any').':
('.tra('without "http://"').') + '.tra('This URL will be linked to from the team\'s page on this site.'), "" ); - row2("Description of team: -
- You may use limited HTML tags. - ", + row2(tra('Description of team').': +
+ '.tra('You may use %1limited HTML tags%2.', '', '').' + ', "" ); - row2("Type of team:", team_type_select($team->type)); + row2(tra('Type of team').':', team_type_select($team->type)); - row2_init("Country", + row2_init(tra('Country'), "