Index: openacs-4/contrib/packages/survey/www/admin/import-responses.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/survey/www/admin/Attic/import-responses.tcl,v diff -u -r1.1 -r1.2 --- openacs-4/contrib/packages/survey/www/admin/import-responses.tcl 19 Sep 2003 16:48:04 -0000 1.1 +++ openacs-4/contrib/packages/survey/www/admin/import-responses.tcl 14 Feb 2004 19:57:59 -0000 1.2 @@ -16,7 +16,7 @@ } -validate { file_given { if {![info exists csvfile(tmpfile)] && $filename==""} { - ad_complain "No file given for import!" + ad_complain "[_ survey.lt_No_file_given_for_imp]" } } } @@ -28,11 +28,11 @@ # Get the survey information. get_survey_info -survey_id $survey_id if {![info exists survey_info(survey_id)]} { - ad_return_complaint 1 "Requested survey does not exist" + ad_return_complaint 1 "[_ survey.lt_Requested_survey_does]" ad_script_abort } set survey_name $survey_info(name) -set context_bar [ad_context_bar [list "one?[export_url_vars survey_id]" $survey_info(name)] "Import responses"] +set context_bar [ad_context_bar [list "one?[export_url_vars survey_id]" $survey_info(name)] "[_ survey.Import_responses]"] if {[info exists csvfile(tmpfile)]} { # preserve the file for future use @@ -44,7 +44,7 @@ set file [open $filename r] set numfields [ns_getcsv $file fields] -set fieldlist [list [list "-- Please Choose --" ""]] +set fieldlist [list [list "[_ survey.--_Please_Choose_--]" ""]] set i 0 foreach field $fields { lappend fieldlist [list $field $i] @@ -54,8 +54,8 @@ ad_form -name pick-fields -form { {survey_id:text(hidden) {value $survey_id}} {filename:text(hidden) {value $filename}} - {identifier:text(select) {label "Identify user by"} {options {{UserID user_id} {Email email}}}} - {idfield:text(select) {label "Identifying field"} {options $fieldlist} {required_p "t"}} + {identifier:text(select) {label "[_ survey.Identify_user_by]"} {options {{UserID user_id} {Email email}}}} + {idfield:text(select) {label "[_ survey.Identifying_field]"} {options $fieldlist} {required_p "t"}} } set question_ids [list] @@ -83,14 +83,14 @@ } ad_form -extend -name pick-fields -form { - {test:text(submit) {label "Test"}} - {import:text(submit) {label "Import"}} + {test:text(submit) {label "[_ survey.Test]"} {value "test"}} + {import:text(submit) {label "[_ survey.Import]" {value "import"}} } -on_submit { # Now, get the data ready to insert into the db - if {[info exists import] && $import=="Import"} { + if {[info exists import] && $import=="import"} { set mode "import" } - if {[info exists test] && $test=="Test"} { + if {[info exists test] && $test=="test"} { set mode "test" } @@ -117,7 +117,7 @@ } if {$error} { # user does not exist - lappend errors "Line $line: User with $identifier \"[lindex $data $idfield]\" does not exist" + lappend errors "[_ survey.lt_Line_line_User_with_i]" db_abort_transaction } append debug "$user_id:" @@ -149,7 +149,7 @@ # else, note an error if {$question($question_id.required_p)=="t"} { set error 1 - lappend errors "Line $line: Answer to question $question($question_id.question_text) cannot be empty" + lappend errors "[_ survey.lt_Line_line_Answer_to_q]" } continue } @@ -161,7 +161,7 @@ db_dml create_choice_response "" } else { set error 1 - lappend errors "Line $line: Choice \"$choice\" does not exist in question $question($question_id.question_text)" + lappend errors "[_ survey.lt_Line_line_Choice_choi]" } } } @@ -183,7 +183,7 @@ } default { set error 1 - lappend errors "Line $line: Invalid boolean value \"$response_value\" for question $question($question_id.question_text)" + lappend errors "[_ survey.lt_Line_line_Invalid_boo]" } } } @@ -194,7 +194,7 @@ db_dml create_number_response "" } else { set error 1 - lappend errors "Line $line: Invalid Number \"$response_value\" for question $question($question_id.question_text)" + lappend errors "[_ survey.lt_Line_line_Invalid_Num]" } } text { @@ -206,7 +206,7 @@ db_dml create_date_response "" } else { set error 1 - lappend errors "Line $line: Invalid Date \"$response_value\" for question $question($question_id.question_text)" + lappend errors "[_ survey.lt_Line_line_Invalid_Dat]" } } blob { @@ -221,21 +221,21 @@ } on_error { # There needs to be an on_error block if [exists_and_not_null errmsg] { - ns_returnnotice 200 "$errmsg :: $line" + ns_returnnotice 200 "[_ survey.errmsg__line]" } } } if {[llength $errors]==0} { # No errors if {$mode=="test"} { - ns_returnnotice 200 "Test successful" "There were no problems with the import. $line records can be created. Go back and hit Import to proceed" + ns_returnnotice 200 "[_ survey.lt_Test_successful___The]" } else { - ns_returnnotice 200 "Import successful" "There were no problems with the import. $line records have been created. Return to the survey" + ns_returnnotice 200 "[_ survey.lt_Import_successful___T]" } } else { # There were errors - ns_returnnotice 200 "Errors encountered" "There were some errors: " + ns_returnnotice 200 "[_ survey.Errors_encountered]" ""[_ survey.lt_There_were_some_error]": " } } close $file