diff --git a/checkin_notes b/checkin_notes index f1f8e2db67..411dd8d637 100755 --- a/checkin_notes +++ b/checkin_notes @@ -26522,3 +26522,9 @@ Janus 2 April 2005 img/ (new) da.png (new) +David 2 April 2005 + html/ + inc/ + translation.inc + ops/ + repair_validator_problem.php diff --git a/html/inc/translation.inc b/html/inc/translation.inc index 3a1e4f7515..94ff0fb32e 100644 --- a/html/inc/translation.inc +++ b/html/inc/translation.inc @@ -14,14 +14,16 @@ function getSupportedLanguages(){ global $lang_language_dir, $lang_compiled_dir; //echo $lang_language_dir.$lang_compiled_dir; if (is_dir($lang_language_dir.$lang_compiled_dir)) { - if ($dh = opendir($lang_language_dir.$lang_compiled_dir)) { //If dir exists - while (($file = readdir($dh)) !== false) { //read contents + if ($dh = opendir($lang_language_dir.$lang_compiled_dir)) { //If dir exists + while (($file = readdir($dh)) !== false) { + //read contents if ($file==".." or $file=="."){ - } else if (substr($file,-7)==".po.inc"){ //only files ending in .po.inc - $list[] = substr($file,0,-7); - } - } - } + } else if (substr($file,-7)==".po.inc"){ + //only files ending in .po.inc + $list[] = substr($file,0,-7); + } + } + } } else {echo "uh";} //print_r($list); return $list; @@ -30,12 +32,13 @@ function getSupportedLanguages(){ function trSpecific($tokennumber, $language=""){ global $lang_language_dir, $lang_compiled_dir; $language= substr($language,0,5); - if ($language!="" && file_exists($lang_language_dir.$lang_compiled_dir.$language.".po.inc")){ //If we have the language - //echo "[$language]"; - require($lang_language_dir.$lang_compiled_dir.$language.".po.inc"); //Include it - return stripslashes($language_lookup_array[$tokennumber]); + if ($language!="" && file_exists($lang_language_dir.$lang_compiled_dir.$language.".po.inc")){ + //If we have the language, include it + //echo "[$language]"; + require($lang_language_dir.$lang_compiled_dir.$language.".po.inc"); + return stripslashes($language_lookup_array[$tokennumber]); } else { - return false; + return false; } } @@ -45,13 +48,14 @@ function trSpecific($tokennumber, $language=""){ function parseLanguageInterface($file){ $translation_file = file($file); for ($i = 0;$i'); fclose($fh); $real_interface_size = sizeof($interface); - //Now run trough each language and recompile their - //lookup arrays. + //Now run trough each language and recompile their lookup arrays. + // if (is_dir($langdir.$transdir)) { - if ($dh = opendir($langdir.$transdir)) { //If dir exists - while (($file = readdir($dh)) !== false) { //read contents + if ($dh = opendir($langdir.$transdir)) { + //If dir exists + while (($file = readdir($dh)) !== false) { + //read contents if ($file==".." or $file=="."){ - } else if (substr($file,-3)==".po"){ //only files ending in .po -/////////////////////////////////////////////////////////////////////////////////////////////////// - language_log("----------------Compiling $file---------------",0); - $language = parseLanguage($langdir.$transdir.$file, $interface); - if (!$fh = fopen($langdir.$compdir.$file.".inc","w")) { language_log("ERROR: could not access $langdir $compdir - please check permissions",2); exit;}; - fwrite($fh, "'); - fclose($fh); -////////////////////////////////////////////////////////////////////////////////////////////////// + } else if (substr($file,-3)==".po"){ + //only files ending in .po + language_log("----------------Compiling $file---------------",0); + $language = parseLanguage($langdir.$transdir.$file, $interface); + if (!$fh = fopen($langdir.$compdir.$file.".inc","w")) { + language_log("ERROR: could not access $langdir $compdir - please check permissions",2); + exit; + }; + fwrite($fh, "'); + fclose($fh); } else { - //debug("File $file with unknown extension found in $info_dir"); - } + //debug("File $file with unknown extension found in $info_dir"); + } } closedir($dh); } else { - //debug("$info_dir could not be opened - check permissions?"); - } + //debug("$info_dir could not be opened - check permissions?"); + } } else { - //debug("$info_dir not found or is not a directory"); + //debug("$info_dir not found or is not a directory"); } - //Do the same again, this time for the project specific language files and instead of - //creating new compiled files just add to whatever existing ones + //Do the same again, this time for the project specific language files + // and instead of creating new compiled files + // just add to whatever existing ones + // if (is_dir($langdir.$prjtransdir)) { - $interface = parseLanguageInterface($langdir.$prjtransdir.$lang_project_default.".po"); //Get the interface - if (!$fh = fopen($langdir.$compdir."language_interface.inc","a")) { language_log("ERROR: could not access $langdir $compdir - please check permissions",2); exit;}; - fwrite($fh, "'); - fclose($fh); - if ($dh = opendir($langdir.$prjtransdir)) { //If dir exists - while (($file = readdir($dh)) !== false) { //read contents + $interface = parseLanguageInterface($langdir.$prjtransdir.$lang_project_default.".po"); + if (!$fh = fopen($langdir.$compdir."language_interface.inc","a")) { + language_log("ERROR: could not access $langdir $compdir - please check permissions",2); + exit; + }; + fwrite($fh, "'); + fclose($fh); + if ($dh = opendir($langdir.$prjtransdir)) { + //If dir exists + while (($file = readdir($dh)) !== false) { + //read contents if ($file==".." or $file=="."){ - } else if (substr($file,-3)==".po"){ //only files ending in .po -/////////////////////////////////////////////////////////////////////////////////////////////////// - language_log("----------------Compiling project specific $file---------------",0); - $language = parseLanguage($langdir.$prjtransdir.$file, $interface); - if (!$fh = fopen($langdir.$compdir.$file.".inc","a")) { language_log("ERROR: could not access $langdir $compdir - please check permissions",2); exit;}; - fwrite($fh, "'); - fclose($fh); -////////////////////////////////////////////////////////////////////////////////////////////////// + } else if (substr($file,-3)==".po"){ + //only files ending in .po + language_log("----------------Compiling project specific $file---------------",0); + $language = parseLanguage($langdir.$prjtransdir.$file, $interface); + if (!$fh = fopen($langdir.$compdir.$file.".inc","a")) { + language_log("ERROR: could not access $langdir $compdir - please check permissions",2); + exit; + }; + fwrite($fh, "'); + fclose($fh); } else { - //debug("File $file with unknown extension found in $info_dir"); - } + //debug("File $file with unknown extension found in $info_dir"); + } } closedir($dh); } else { - //debug("$info_dir could not be opened - check permissions?"); - } + //debug("$info_dir could not be opened - check permissions?"); + } } else { - //debug("$info_dir not found or is not a directory"); + //debug("$info_dir not found or is not a directory"); } @@ -162,38 +189,48 @@ function buildLanguages($langdir,$transdir,$prjtransdir,$compdir){ **************************/ function languagesNeedsRebuild($langdir,$transdir,$prjtransdir, $compdir){ - if (!file_exists($langdir.$compdir)){ //This directory does not exist - try to create one - mkdir($langdir.$compdir,0733); - return true; //and force an update since we need it + if (!file_exists($langdir.$compdir)){ + //This directory does not exist - try to create one + mkdir($langdir.$compdir,0733); + return true; + //and force an update since we need it } -// return false; //Uncomment this to speed up things when you know that you will manually recompile the languages when updated... +// return false; //Uncomment this to speed up things when you know that you will manually recompile the languages when updated... - $last_compile = filemtime($langdir."last_compile_timer"); //This file gets touched each time a compile finishes + $last_compile = filemtime($langdir."last_compile_timer"); + //This file gets touched each time a compile finishes if (is_dir($langdir.$transdir)) { - if ($dh = opendir($langdir.$transdir)) { //If dir exists - while (($file = readdir($dh)) !== false) { //read contents + if ($dh = opendir($langdir.$transdir)) { + //If dir exists + while (($file = readdir($dh)) !== false) { + //read contents if ($file==".." or $file=="."){ - } else if (substr($file,-3)==".po"){ //only files ending in .po - if (filemtime($langdir.$transdir.$file)>$last_compile) return true; - } + } else if (substr($file,-3)==".po"){ + //only files ending in .po + if (filemtime($langdir.$transdir.$file)>$last_compile) return true; + } } closedir($dh); } } if (is_dir($langdir.$prjtransdir)) { - if ($dh = opendir($langdir.$prjtransdir)) { //If dir exists - while (($file = readdir($dh)) !== false) { //read contents + if ($dh = opendir($langdir.$prjtransdir)) { + //If dir exists + while (($file = readdir($dh)) !== false) { + //read contents if ($file==".." or $file=="."){ - } else if (substr($file,-3)==".po"){ //only files ending in .po - if (filemtime($langdir.$prjtransdir.$file)>$last_compile) return true; - } + } else if (substr($file,-3)==".po"){ + //only files ending in .po + if (filemtime($langdir.$prjtransdir.$file)>$last_compile) return true; + } } closedir($dh); } } - return false; //All checks say that nothing has changed. + return false; + //All checks say that nothing has changed. } /************************** @@ -202,28 +239,34 @@ function languagesNeedsRebuild($langdir,$transdir,$prjtransdir, $compdir){ * The $file is parsed and validated against $interface *************************/ function parseLanguage($file, $interface){ - if (sizeof($interface)<1){ language_log("No interface defined for 'compileLanguages()'",2); exit;} + if (sizeof($interface)<1){ + language_log("No interface defined for 'compileLanguages()'",2); + exit; + } $translation_file = file($file); $first_entry = true; for ($i = 0;$i=$lang_log_level){ - $fh = fopen($lang_log_file,"a"); - fwrite($fh, date("Y-m-d H:i:s",time())." ".$msg." ".$message."\n"); - fclose($fh); + $fh = fopen($lang_log_file,"a"); + fwrite($fh, date("Y-m-d H:i:s",time())." ".$msg." ".$message."\n"); + fclose($fh); } } @@ -315,13 +359,13 @@ if (file_exists($lang_language_dir.$lang_compiled_dir."language_interface.inc")) //cookies have highest priority. if ($_COOKIE['lang']){ - $language_string = $_COOKIE['lang'].","; + $language_string = $_COOKIE['lang'].","; } $language_string .= strtolower($HTTP_SERVER_VARS["HTTP_ACCEPT_LANGUAGE"]); //Find out which language to use by iterating trough list //The list is commaseperated, so split it into an array of the following type: - // Array ( + // Array ( // [0] => da // [1] => en-us;q=0.7 // [2] => en;q=0.3 @@ -335,22 +379,32 @@ if (file_exists($lang_language_dir.$lang_compiled_dir."language_interface.inc")) //we just ignore this attribute. (TODO: don't ignore this attribute) //A missing quality attribute means q=1 - require_once($lang_language_dir.$lang_compiled_dir.$lang_project_default.".po.inc"); //Always include the project default as fallback - for ($i=sizeof($client_languages);$i>=0;$i--){ //Now for each language that the client requests - if (substr($client_languages[$i],2,1)=="_" || substr($client_languages[$i],2,1)=="-"){ //If this is defined as primary-secondary - $language = substr($client_languages[$i],0,2)."_".strtoupper(substr($client_languages[$i],3,2)); //represent it as xx_YY - } else { - $language = substr($client_languages[$i],0,2); //else just use xx - } - if (file_exists($lang_language_dir.$lang_compiled_dir.$language.".po.inc")){ //If we have the language - //echo "[$language]"; - require($lang_language_dir.$lang_compiled_dir.$language.".po.inc"); //Include it - } + require_once($lang_language_dir.$lang_compiled_dir.$lang_project_default.".po.inc"); + //Always include the project default as fallback + for ($i=sizeof($client_languages);$i>=0;$i--){ + //Now for each language that the client requests + if (substr($client_languages[$i],2,1)=="_" || substr($client_languages[$i],2,1)=="-"){ + //If this is defined as primary-secondary + $language = substr( + $client_languages[$i],0,2)."_".strtoupper(substr($client_languages[$i],3,2) + ); + //represent it as xx_YY + } else { + $language = substr($client_languages[$i],0,2); + //else just use xx + } + if (file_exists($lang_language_dir.$lang_compiled_dir.$language.".po.inc")) { + //If we have the language, include it + //echo "[$language]"; + require($lang_language_dir.$lang_compiled_dir.$language.".po.inc"); + } } } else { language_log("Could not load language interface.",2); - echo "ERROR: Could not load language interface. This is a fatal error, exitting."; flush; exit; + echo "ERROR: Could not load language interface. This is a fatal error, exitting."; + flush; + exit; }; ?> diff --git a/html/ops/repair_validator_problem.php b/html/ops/repair_validator_problem.php index 4be4dbf40c..6ec6124146 100644 --- a/html/ops/repair_validator_problem.php +++ b/html/ops/repair_validator_problem.php @@ -29,7 +29,7 @@ while ($wu = mysql_fetch_object($result)) { mysql_free_result($r2); $nunsent = $x[0]; - if ($nsuccess==3 and $nunsent==0) { + if ($nsuccess>=3 and $nunsent==0) { echo "WU $wu->id has $nsuccess success, $nunsent unsent \n"; mysql_query("update workunit set need_validate=1 where id=$wu->id"); } diff --git a/html/user/create_account_form.php b/html/user/create_account_form.php index 8c63120a46..4244fb37d8 100644 --- a/html/user/create_account_form.php +++ b/html/user/create_account_form.php @@ -17,13 +17,12 @@ if (parse_bool($config, "disable_account_creation")) { page_tail(); exit(); } +echo "

"; +printf(tr(CREATE_AC_READ_RULES), "".tr(RULES_TITLE).""); +echo "

"; +printf(tr(CREATE_AC_ALREADY_GOT), "".tr(AC_CREATED_TITLE).""); echo " - -

"; printf(tr(CREATE_AC_READ_RULES), "".tr(RULES_TITLE)."");echo "

- -

"; printf(tr(CREATE_AC_ALREADY_GOT), "".tr(AC_CREATED_TITLE).""); echo "

-
"; $teamid = get_int("teamid", true); @@ -34,10 +33,8 @@ if ($teamid) { echo "No such user"; } else { echo ""; - printf(tr(CREATE_AC_TEAM), "id\">$team->name"); - echo " -

- "; + printf(tr(CREATE_AC_TEAM), "id\">$team->name"); + echo "

"; echo " "; diff --git a/html/user/language_select.php b/html/user/language_select.php index 24e00bff61..1e7b7322fe 100644 --- a/html/user/language_select.php +++ b/html/user/language_select.php @@ -8,23 +8,30 @@ $languages = getSupportedLanguages(); if (get_str("set_lang")){ if (!in_array(get_str("set_lang"), $languages) && get_str("set_lang")!="auto"){ - echo "You must select a supported language"; - exit; + echo "You must select a supported language"; + exit; } else { - setcookie('lang', get_str("set_lang"), time()+3600*24*365); - header("Location: language_select.php"); - flush(); - exit; + setcookie('lang', get_str("set_lang"), time()+3600*24*365); + header("Location: language_select.php"); + flush(); + exit; } } page_head("Language selection"); echo " -

This website may be displayed to you in one of the following languages. Usually the server will automatically determine - which language you use but you can override this by clicking on one of the links. Clicking a link will send you a cookie which - stores your language selection on your computer (if you experience any problems please check that your browser accepts - cookies from our domain).

"; +

+ This website is available in the following languages. + Normally the choice of language + is determined by your web browser's language settings. + You can override this by clicking on one of the links. + This will send your browser a cookie which + stores your language selection on your computer. + If you experience any problems please check that your browser accepts + cookies from our domain. +

+"; echo "

The currently selected language is: ".tr(LANG_NAME_INTERNATIONAL)." (".tr(LANG_NAME_NATIVE).")

"; @@ -39,15 +46,18 @@ array_multisort($lang_international, $languages, $lang_native); for ($i=0; $i"; + $im = ""; } else { - $im=""; + $im=""; } row3($im, - "".$languages[$i]."", - "".$lang_international[$i]." (".$lang_native[$i].")"); + "".$languages[$i]."", + "".$lang_international[$i]." (".$lang_native[$i].")" + ); } end_table(); -echo "

You can always go back to automatic language selection by pressing this link

"; +echo "

You can always go back to automatic language selection by pressing + this link

+"; page_tail(); ?>