Index: main/trunk/greenstone2/bin/script/gti.pl
===================================================================
--- main/trunk/greenstone2/bin/script/gti.pl	(revision 30545)
+++ main/trunk/greenstone2/bin/script/gti.pl	(revision 30548)
@@ -519,5 +519,5 @@
 		my (%source_file_key_to_gti_command_mapping, %target_file_key_to_gti_command_mapping) = ();
 		&build_gs3_configuration($target_language_code, \%source_file_key_to_text_mapping, \%target_file_key_to_text_mapping,
-		\%source_file_key_to_gti_command_mapping, \%target_file_key_to_gti_command_mapping);
+		\%source_file_key_to_gti_command_mapping, \%target_file_key_to_gti_command_mapping, 1);
     }
 	
@@ -598,5 +598,5 @@
     else {
 		&build_gs3_configuration($target_language_code, \%source_file_key_to_text_mapping, \%target_file_key_to_text_mapping, 
-		\%source_file_key_to_gti_comment_mapping, \%target_file_key_to_gti_comment_mapping);
+		\%source_file_key_to_gti_comment_mapping, \%target_file_key_to_gti_comment_mapping, 1);
     }
     &log_message("Number of source chunks: " . scalar(keys(%source_file_key_to_text_mapping)));
@@ -1064,8 +1064,9 @@
 		my $target_chunk_last_update_date = $target_file_key_to_last_update_date_mapping->{$chunk_key};
         
-        # print "key: $chunk_key\nsource date : $source_chunk_last_update_date\ntarget date : $target_chunk_last_update_date\nafter? ". &is_date_after($source_chunk_last_update_date, $target_chunk_last_update_date) . "\n\n";        
-		
+        # print "key: $chunk_key\nsource date : $source_chunk_last_update_date\ntarget date : $target_chunk_last_update_date\nafter? ". &is_date_after($source_chunk_last_update_date, $target_chunk_last_update_date) . "\n\n";
+
         if (defined($target_chunk_last_update_date) && &is_date_after($source_chunk_last_update_date, $target_chunk_last_update_date)) {
 			# &log_message("Chunk with key $chunk_key needs updating.");
+	    		# &log_message("key: $chunk_key\nsource date : $source_chunk_last_update_date\ntarget date : $target_chunk_last_update_date\nafter? ". &is_date_after($source_chunk_last_update_date, $target_chunk_last_update_date) . "\n\n");
 			push(@target_file_keys_requiring_updating, $chunk_key);
 		}
@@ -2022,5 +2023,5 @@
 {
     my ($target_language_code, $source_files_key_to_text_mapping, $target_files_key_to_text_mapping,
-	$source_files_key_to_gti_comment_mapping, $target_files_key_to_gti_comment_mapping) = @_;
+	$source_files_key_to_gti_comment_or_last_updated_mapping, $target_files_key_to_gti_comment_or_last_updated_mapping, $get_gti_comments_not_last_updated) = @_;
     
     my $source_file_directory = "greenstone3";  # my $source_file_directory = &util::filename_cat("WEB-INF","classes"); 
@@ -2036,11 +2037,25 @@
 		my %source_file_key_to_line_mapping = &build_key_to_line_mapping(\@source_file_lines, $translation_file_type);
 		my %source_file_key_to_text_mapping = &build_key_to_text_mapping(\@source_file_lines, \%source_file_key_to_line_mapping, $translation_file_type);
-		my %source_file_key_to_gti_comment_mapping = &build_key_to_gti_comment_mapping(\@source_file_lines, \%source_file_key_to_line_mapping, $translation_file_type);	
-		
+		#my %source_file_key_to_gti_comment_mapping = &build_key_to_gti_comment_mapping(\@source_file_lines, \%source_file_key_to_line_mapping, $translation_file_type);	
+		
+		my %source_file_key_to_gti_comment_or_last_updated_mapping;
+		if($get_gti_comments_not_last_updated) {
+		    %source_file_key_to_gti_comment_or_last_updated_mapping = &build_key_to_gti_comment_mapping(\@source_file_lines, \%source_file_key_to_line_mapping, $translation_file_type);	
+		} else {
+		    %source_file_key_to_gti_comment_or_last_updated_mapping = &build_key_to_last_update_date_mapping($source_file, \@source_file_lines, \%source_file_key_to_line_mapping, $translation_file_type);
+		}
+
 		my $target_file = &util::filename_cat($source_file_directory, $interface_file_key."_".$target_language_code.".properties");
 		my @target_file_lines = &read_file_lines(&util::filename_cat($gsdl_root_directory, $target_file));
 		my %target_file_key_to_line_mapping = &build_key_to_line_mapping(\@target_file_lines, $translation_file_type);
 		my %target_file_key_to_text_mapping = &build_key_to_text_mapping(\@target_file_lines, \%target_file_key_to_line_mapping, $translation_file_type);
-		my %target_file_key_to_gti_comment_mapping = &build_key_to_gti_comment_mapping(\@target_file_lines, \%target_file_key_to_line_mapping, $translation_file_type);
+		#my %target_file_key_to_gti_comment_mapping = &build_key_to_gti_comment_mapping(\@target_file_lines, \%target_file_key_to_line_mapping, $translation_file_type);
+		
+		my %target_file_key_to_gti_comment_or_last_updated_mapping;
+		if($get_gti_comments_not_last_updated) {
+		    %target_file_key_to_gti_comment_or_last_updated_mapping = &build_key_to_gti_comment_mapping(\@target_file_lines, \%target_file_key_to_line_mapping, $translation_file_type);
+		} else {
+		    %target_file_key_to_gti_comment_or_last_updated_mapping = &build_key_to_last_update_date_mapping($target_file, \@target_file_lines, \%target_file_key_to_line_mapping, $translation_file_type);
+		}
 		
 		
@@ -2059,9 +2074,9 @@
 			my $global_chunk_key = "$interface_file_key.$chunk_key";
 			$source_files_key_to_text_mapping->{$global_chunk_key} = $source_file_key_to_text_mapping{$chunk_key};
-			$source_files_key_to_gti_comment_mapping->{$global_chunk_key} = $source_file_key_to_gti_comment_mapping{$chunk_key};
+			$source_files_key_to_gti_comment_or_last_updated_mapping->{$global_chunk_key} = $source_file_key_to_gti_comment_or_last_updated_mapping{$chunk_key};
 			
 			if (defined $target_file_key_to_text_mapping{$chunk_key}) {
 				$target_files_key_to_text_mapping->{$global_chunk_key} = $target_file_key_to_text_mapping{$chunk_key};
-				$target_files_key_to_gti_comment_mapping->{$global_chunk_key} = $target_file_key_to_gti_comment_mapping{$chunk_key};
+				$target_files_key_to_gti_comment_or_last_updated_mapping->{$global_chunk_key} = $target_file_key_to_gti_comment_or_last_updated_mapping{$chunk_key};
 			}
 		}
