From a720fc5d5219d65d2212d29d362c7b8297e4cd9e Mon Sep 17 00:00:00 2001 From: David Anderson Date: Tue, 24 Mar 2009 23:27:12 +0000 Subject: [PATCH] - web: translation system didn't compile BOINC and project-specific translations correctly. svn path=/trunk/boinc/; revision=17658 --- checkin_notes | 10 ++++++++++ html/inc/translation.inc | 12 ++++++++---- html/ops/update_translations.php | 2 +- 3 files changed, 19 insertions(+), 5 deletions(-) diff --git a/checkin_notes b/checkin_notes index 6e17dbdd9b..5b89345c70 100644 --- a/checkin_notes +++ b/checkin_notes @@ -3325,3 +3325,13 @@ David 24 Mar 2009 update_translations.php py/Boinc/ setup_project.py + +David 24 Mar 2009 + - web: translation system didn't compile BOINC and + project-specific translations correctly. + + html/ + ops/ + update_translations.php + inc/ + translation.inc diff --git a/html/inc/translation.inc b/html/inc/translation.inc index e657d37178..d33c28c1f4 100644 --- a/html/inc/translation.inc +++ b/html/inc/translation.inc @@ -20,7 +20,7 @@ $lang_language_dir = "../languages/"; $lang_translations_dir = "translations/"; $lang_prj_translations_dir = "project_specific_translations/"; $lang_compiled_dir = "compiled/"; -$lang_log_level = 1; +$lang_log_level = 0; /** * Fetches a list of compiled languages from the directory @@ -72,20 +72,24 @@ function buildLanguages($langdir,$transdir,$compdir,$append=false){ ); continue; } - if (!$fh = fopen($langdir.$compdir.$file.".inc",$append?"a":"w")) { + $fh = fopen($langdir.$compdir.$file.".inc",$append?"a":"w"); + if (!$fh) { language_log( "ERROR: could not access $langdir $compdir - please check permissions",2 ); exit; } - fwrite($fh, " $value){ if ($value !== "") { //Skip if the msgstr is empty fwrite($fh, "\$language_lookup_array[\"".str_replace("\"", "\\\"", substr($file,0,-3))."\"][\"".$key."\"] = \"".$value."\";\n"); } } - fwrite($fh, '?>'); + // don't write \?\> - may append + fclose($fh); } else { //debug("File $file with unknown extension found in $info_dir"); diff --git a/html/ops/update_translations.php b/html/ops/update_translations.php index d51aa8f7c3..409a556cf5 100644 --- a/html/ops/update_translations.php +++ b/html/ops/update_translations.php @@ -21,7 +21,7 @@ ini_set('display_errors', true); ini_set('display_startup_errors', true); require_once("../inc/translation.inc"); -system("rm -f $lang_compiled_dir/*"); +system("rm -f $lang_language_dir/$lang_compiled_dir/*"); buildLanguages($lang_language_dir,$lang_translations_dir, $lang_compiled_dir); buildLanguages($lang_language_dir,$lang_prj_translations_dir, $lang_compiled_dir, true);