Changeset 10027
- Timestamp:
- 2005-06-08T14:03:53+12:00 (19 years ago)
- Location:
- trunk/gsdl
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gsdl/bin/script/gti.pl
r10020 r10027 386 386 # The key of the file to translate (ensure it is lowercase) 387 387 my $translation_file_key = lc(shift(@_)); 388 # Whether to submit a target chunk even if it hasn't changed 389 my $force_submission_flag = shift(@_); 388 390 389 391 # Check that the necessary arguments were supplied … … 489 491 next; 490 492 } 491 492 # Apply the submitted translations 493 if (defined($target_file_key_to_submission_mapping{$chunk_key})) { 494 $target_file_key_to_text_mapping{$chunk_key} = $target_file_key_to_submission_mapping{$chunk_key}; 493 } 494 495 # Apply the submitted translations 496 foreach my $chunk_key (keys(%target_file_key_to_submission_mapping)) { 497 if ($force_submission_flag || $target_file_key_to_submission_mapping{$chunk_key} ne $target_file_key_to_text_mapping{$chunk_key}) { 498 $target_file_key_to_text_mapping{$chunk_key} = $target_file_key_to_submission_mapping{$chunk_key}; 495 499 $target_file_key_to_comment_date_mapping{$chunk_key} = $submission_date; 496 500 } 497 501 } 498 502 … … 845 849 $i++; 846 850 $line = $file_lines[$i]; 847 $line =~ s/ (\s*)$//; # Remove any nasty whitespace, carriage returns etc.851 $line =~ s/\s*([^\\]\#.+)?$//; # Remove any comments and nasty whitespace 848 852 } 849 853 -
trunk/gsdl/src/recpt/gtiaction.cpp
r10026 r10027 181 181 } 182 182 183 // Process a user submission183 // Process user translations 184 184 if (args["p"] == "submit") { 185 process_gti_submission (disp, args, logout);185 process_gti_submissions(disp, args, logout, true); 186 186 } 187 187 … … 270 270 text_t translation_file_key = args["tfk"]; 271 271 text_t query_string = to_utf8(args["q"]); 272 273 // Process user corrections 274 if (args["sp"] != "") { 275 process_gti_submissions(disp, args, logout, false); 276 } 272 277 273 278 disp.setmacro("gtiformcontent", "gti", "_gti:gtifind_"); … … 318 323 chunk_key_iterator++; 319 324 } 325 gti_find_form_content += "_gtifindformfooter_\n"; 320 326 321 327 disp.setmacro("gtifindformcontent", "gti", gti_find_form_content); … … 402 408 403 409 404 void gtiaction::process_gti_submission (displayclass& disp, cgiargsclass &args, ostream& logout)410 void gtiaction::process_gti_submissions(displayclass& disp, cgiargsclass &args, ostream& logout, bool force_submission) 405 411 { 406 412 // Get the target language code and file to translate from the CGI arguments … … 442 448 // Send the submission to gti.pl 443 449 text_t gti_arguments = "submit-translation " + target_language_code + " " + translation_file_key; 450 if (force_submission) { 451 gti_arguments += " -force_submission"; 452 } 444 453 do_gti_submission(gti_arguments, submission_text, logout); 445 454 logout << "Done." << endl; -
trunk/gsdl/src/recpt/gtiaction.h
r10018 r10027 107 107 text_t escape_all(text_t source_string, char character_to_escape); 108 108 109 void process_gti_submission (displayclass& disp, cgiargsclass& args, ostream& logout);109 void process_gti_submissions(displayclass& disp, cgiargsclass& args, ostream& logout, bool force_submission); 110 110 111 111 GTI_Response do_gti_request(text_t, ostream&);
Note:
See TracChangeset
for help on using the changeset viewer.