- web: make some things in sample front page translatable.

TODO: make them all translatable.
- manager: compile fix for Linux

svn path=/trunk/boinc/; revision=16207
This commit is contained in:
David Anderson 2008-10-14 21:40:14 +00:00
parent e24e551bd8
commit a4380ee9a6
6 changed files with 56 additions and 40 deletions

View File

@ -8367,6 +8367,22 @@ David 14 Oct 2008
In addition: the client maintains a min_rpc_time which is set based In addition: the client maintains a min_rpc_time which is set based
on request_delay and also by various exponential backoff schemes. on request_delay and also by various exponential backoff schemes.
new_rpc_delay now overrides this as well, in the same sense. new_rpc_delay now overrides this as well, in the same sense.
client/ client/
cs_scheduler.cpp cs_scheduler.cpp
work_fetch.cpp work_fetch.cpp
David 14 Oct 2008
- web: make some things in sample front page translatable.
TODO: make them all translatable.
- manager: compile fix for Linux
client/
client_types.h
clientgui/
AsyncRPC.cpp
html/
inc/
translation.inc
user/
sample_index.php

View File

@ -270,6 +270,10 @@ public:
/// earliest time to contact any server of this project (or zero) /// earliest time to contact any server of this project (or zero)
double min_rpc_time; double min_rpc_time;
void set_min_rpc_time(double future_time, const char* reason); void set_min_rpc_time(double future_time, const char* reason);
/// if nonzero, specifies a time when another scheduler RPC
/// should be done (as requested by server).
/// An RPC could be done sooner than this.
double next_rpc_time;
/// returns true if min_rpc_time > now /// returns true if min_rpc_time > now
bool waiting_until_min_rpc_time(); bool waiting_until_min_rpc_time();
/// need to fetch and parse the master URL /// need to fetch and parse the master URL
@ -278,9 +282,6 @@ public:
/// user request, propagate host CPID, time-based, etc. /// user request, propagate host CPID, time-based, etc.
/// Reasons are enumerated in scheduler_op.h /// Reasons are enumerated in scheduler_op.h
int sched_rpc_pending; int sched_rpc_pending;
/// if nonzero, specifies a time when another scheduler RPC
/// should be done (as requested by server)
double next_rpc_time;
/// we need to call request_work_fetch() when a project /// we need to call request_work_fetch() when a project
/// transitions from being backed off to not. /// transitions from being backed off to not.
/// This (slightly misnamed) keeps track of whether this /// This (slightly misnamed) keeps track of whether this

View File

@ -764,7 +764,8 @@ void CMainDocument::HandleCompletedRPC() {
pFrame->ProcessEvent(event); pFrame->ProcessEvent(event);
} }
} }
#if defined(__WXMSW__) || defined(__WXMAC__)
if (m_bNeedTaskBarRefresh && !m_bWaitingForRPC) { if (m_bNeedTaskBarRefresh && !m_bWaitingForRPC) {
m_bNeedTaskBarRefresh = false; m_bNeedTaskBarRefresh = false;
CTaskBarIcon* pTaskbar = wxGetApp().GetTaskBarIcon(); CTaskBarIcon* pTaskbar = wxGetApp().GetTaskBarIcon();
@ -774,6 +775,7 @@ void CMainDocument::HandleCompletedRPC() {
pTaskbar->ProcessEvent(event); pTaskbar->ProcessEvent(event);
} }
} }
#endif
// CachedMessageUpdate() does not do any RPCs, so it is safe here // CachedMessageUpdate() does not do any RPCs, so it is safe here
if (current_rpc_request.rpcType == RPC_TYPE_ASYNC_WITH_UPDATE_MESSAGE_LIST_AFTER) { if (current_rpc_request.rpcType == RPC_TYPE_ASYNC_WITH_UPDATE_MESSAGE_LIST_AFTER) {

View File

@ -146,6 +146,7 @@ function show_other() {
<li> <a href=\"trac/wiki/AlphaInstructions\">Testing</a> <li> <a href=\"trac/wiki/AlphaInstructions\">Testing</a>
<li> <a href=\"trac/wiki/WikiMeta\">Documentation</a> <li> <a href=\"trac/wiki/WikiMeta\">Documentation</a>
</ul> </ul>
<li> <a href=\"trac/wiki/SoftwareDevelopment\">Software development</a>
<li> <a href=\"trac/wiki/SoftwareAddon\">APIs for add-on software</a> <li> <a href=\"trac/wiki/SoftwareAddon\">APIs for add-on software</a>
<li> <a href=\"trac/wiki/ProjectPeople\">Personnel and contributors</a> <li> <a href=\"trac/wiki/ProjectPeople\">Personnel and contributors</a>
<li> <a href=\"dev/\">Message boards</a> <li> <a href=\"dev/\">Message boards</a>

View File

@ -62,26 +62,26 @@ function buildLanguages($langdir,$transdir,$compdir,$append=false){
if ($dh = opendir($langdir.$transdir)) { if ($dh = opendir($langdir.$transdir)) {
while (($file = readdir($dh)) !== false) { while (($file = readdir($dh)) !== false) {
if ($file==".." or $file=="."){ if ($file==".." or $file=="."){
// Skip parent and current dir // Skip parent and current dir
} else if (substr($file,-3)==".po"){ } else if (substr($file,-3)==".po"){
// and only do files ending in .po // and only do files ending in .po
language_log("-------------Compiling $transdir$file------------",0); language_log("-------------Compiling $transdir$file------------",0);
$language = parseLanguage( $language = parseLanguage(
$langdir.$transdir.$file, $interface $langdir.$transdir.$file, $interface
); );
if (!$language){ if (!$language){
language_log( language_log(
"WARNING: Could not parse language ".$file "WARNING: Could not parse language ".$file
); );
continue; continue;
} }
if (!$fh = fopen($langdir.$compdir.$file.".inc",$append?"a":"w")) { if (!$fh = fopen($langdir.$compdir.$file.".inc",$append?"a":"w")) {
language_log( language_log(
"ERROR: could not access $langdir $compdir - please check permissions",2 "ERROR: could not access $langdir $compdir - please check permissions",2
); );
exit; exit;
} }
fwrite($fh, "<?php\n"); fwrite($fh, "<?php\n");
foreach ($language as $key => $value){ foreach ($language as $key => $value){
if ($value !== "") { if ($value !== "") {
//Skip if the msgstr is empty //Skip if the msgstr is empty
@ -133,7 +133,7 @@ function parseLanguage($file){
// Get the last token // Get the last token
if ($current_token && $current_token_text){ if ($current_token && $current_token_text){
$output[$current_token]=$current_token_text; $output[$current_token]=$current_token_text;
} }
return $output; return $output;
} }
@ -156,16 +156,16 @@ function tra($text /* ...arglist... */){
// Find the string in the user's language // Find the string in the user's language
foreach ($languages_in_use as $language){ foreach ($languages_in_use as $language){
if ($language_lookup_array[$language][$text]){ if ($language_lookup_array[$language][$text]){
$text = $language_lookup_array[$language][$text]; $text = $language_lookup_array[$language][$text];
break; break;
} }
} }
// Replace relevant substrings with given arguments // Replace relevant substrings with given arguments
for ($i = 1; $i<func_num_args(); $i++){ for ($i = 1; $i<func_num_args(); $i++){
$arg = func_get_arg($i); $arg = func_get_arg($i);
$text = str_replace("%".$i, $arg, $text); $text = str_replace("%".$i, $arg, $text);
} }
return $text; return $text;
} }
@ -174,8 +174,8 @@ function tr_specific($text, $language){
global $lang_language_dir, $lang_compiled_dir, $language_lookup_array; global $lang_language_dir, $lang_compiled_dir, $language_lookup_array;
$file_name = $lang_language_dir.$lang_compiled_dir.$language.".po.inc"; $file_name = $lang_language_dir.$lang_compiled_dir.$language.".po.inc";
if (file_exists($file_name)) { if (file_exists($file_name)) {
require_once($file_name); require_once($file_name);
$text = $language_lookup_array[$language][$text]; $text = $language_lookup_array[$language][$text];
} }
return $text; return $text;
} }
@ -257,26 +257,21 @@ for ($i=0; $i<sizeof($client_languages); $i++) {
// If we have a translation for the language, include it // If we have a translation for the language, include it
$file_name = $lang_language_dir.$lang_compiled_dir.$language.".po.inc"; $file_name = $lang_language_dir.$lang_compiled_dir.$language.".po.inc";
if (file_exists($file_name)) { if (file_exists($file_name)) {
if (!in_array($language, $languages_in_use)){ if (!in_array($language, $languages_in_use)){
require_once($file_name); require_once($file_name);
$languages_in_use[] = $language; $languages_in_use[] = $language;
} }
} }
if ($language2) { if ($language2) {
$file_name = $lang_language_dir.$lang_compiled_dir.$language2.".po.inc"; $file_name = $lang_language_dir.$lang_compiled_dir.$language2.".po.inc";
if (file_exists($file_name)) { if (file_exists($file_name)) {
if (!in_array($language2, $languages_in_use)){ if (!in_array($language2, $languages_in_use)){
require_once($file_name); require_once($file_name);
$languages_in_use[] = $language2; $languages_in_use[] = $language2;
} }
} }
} }
} }
// If you include this file, $language_in_use is now set
// to the language actually being used
$language_in_use = $languages_in_use[sizeof($languages_in_use)];
$cvs_version_tracker[]="\$Id$"; //Generated automatically - do not edit $cvs_version_tracker[]="\$Id$"; //Generated automatically - do not edit
?> ?>

View File

@ -63,13 +63,14 @@ function show_nav() {
<li><a href=\"team.php\">Teams</a> - create or join a team <li><a href=\"team.php\">Teams</a> - create or join a team
<li><a href=\"cert1.php\">Certificate</a> <li><a href=\"cert1.php\">Certificate</a>
<li> <a href=\"apps.php\">".tra("Applications")."</a> <li> <a href=\"apps.php\">".tra("Applications")."</a>
</ul> </ul>
<h2>Community</h2> <h2>".tra("Community")."</h2>
<ul> <ul>
<li><a href=\"profile_menu.php\">Profiles</a> <li><a href=\"profile_menu.php\">".tra("Profiles")."</a>
<li><a href=\"user_search.php\">User search</a> <li><a href=\"user_search.php\">User search</a>
<li><a href=\"forum_index.php\">Message boards</a> <li><a href=\"forum_index.php\">".tra("Message boards")."</a>
<li><a href=\"forum_help_desk.php\">Questions and answers</a> <li><a href=\"forum_help_desk.php\">".tra("Questions and Answers")."</a>
<li><a href=\"stats.php\">Statistics</a> <li><a href=\"stats.php\">Statistics</a>
<li><a href=language_select.php>Languages</a> <li><a href=language_select.php>Languages</a>
</ul> </ul>
@ -131,7 +132,7 @@ if (!$stopped) {
if ($profile) { if ($profile) {
echo " echo "
<td id=\"uotd\"> <td id=\"uotd\">
<h2>User of the day</h2> <h2>".tra("User of the day")."</h2>
"; ";
show_uotd($profile); show_uotd($profile);
echo "</td></tr>\n"; echo "</td></tr>\n";