Index: trunk/gsdl/bin/script/gti.pl
===================================================================
--- trunk/gsdl/bin/script/gti.pl	(revision 12481)
+++ trunk/gsdl/bin/script/gti.pl	(revision 12483)
@@ -426,5 +426,5 @@
     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_comment_date_mapping = &build_key_to_comment_date_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);
     &log_message("Number of source chunks: " . scalar(keys(%source_file_key_to_text_mapping)));
 
@@ -432,5 +432,5 @@
     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_comment_date_mapping = &build_key_to_comment_date_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);
     &log_message("Number of target chunks: " . scalar(keys(%target_file_key_to_text_mapping)));
 
@@ -524,9 +524,9 @@
 	if ($force_submission_flag || $target_file_key_to_submission_mapping{$chunk_key} ne $target_file_key_to_text_mapping{$chunk_key}) {
 	    $target_file_key_to_text_mapping{$chunk_key} = $target_file_key_to_submission_mapping{$chunk_key};
-	    $target_file_key_to_comment_date_mapping{$chunk_key} = $submission_date;
-	}
-    }
-
-    eval "&write_translated_${translation_file_type}(\$source_file, \\\@source_file_lines, \\\%source_file_key_to_text_mapping, \$target_file, \\\@target_file_lines, \\\%target_file_key_to_text_mapping, \\\%target_file_key_to_comment_date_mapping, \$target_language_code)";
+	    $target_file_key_to_gti_comment_mapping{$chunk_key} = "Updated $submission_date";
+	}
+    }
+
+    eval "&write_translated_${translation_file_type}(\$source_file, \\\@source_file_lines, \\\%source_file_key_to_text_mapping, \$target_file, \\\@target_file_lines, \\\%target_file_key_to_text_mapping, \\\%target_file_key_to_gti_comment_mapping, \$target_language_code)";
 }
 
@@ -666,5 +666,5 @@
 
     # Build a mapping from key to comment date
-    my %key_to_comment_date_mapping = &build_key_to_comment_date_mapping($file_lines, $key_to_line_mapping, $translation_file_type);
+    my %key_to_gti_comment_mapping = &build_key_to_gti_comment_mapping($file_lines, $key_to_line_mapping, $translation_file_type);
 
     # Build a mapping from key to last update date (the latter of the CVS date and comment date)
@@ -676,7 +676,10 @@
 
 	# If a comment date exists and it is after the CVS date, use that instead
-	my $chunk_comment_date = $key_to_comment_date_mapping{$chunk_key};
-	if (defined($chunk_comment_date) && (!defined($chunk_cvs_date) || &is_date_after($chunk_comment_date, $chunk_cvs_date))) {
-	    $key_to_last_update_date_mapping{$chunk_key} = $chunk_comment_date;
+	my $chunk_gti_comment = $key_to_gti_comment_mapping{$chunk_key};
+	if (defined($chunk_gti_comment) && $chunk_gti_comment =~ /(\d?\d-\D\D\D-\d\d\d\d)/) {
+	    my $chunk_comment_date = $1;
+	    if ((!defined($chunk_cvs_date) || &is_date_after($chunk_comment_date, $chunk_cvs_date))) {
+		$key_to_last_update_date_mapping{$chunk_key} = $chunk_comment_date;
+	    }
 	}
     }
@@ -727,9 +730,9 @@
 
 
-sub build_key_to_comment_date_mapping
+sub build_key_to_gti_comment_mapping
 {
     my ($file_lines, $key_to_line_mapping, $translation_file_type) = @_;
 
-    my %key_to_comment_date_mapping = ();
+    my %key_to_gti_comment_mapping = ();
     foreach my $chunk_key (keys(%$key_to_line_mapping)) {
 	my $chunk_starting_line = (split(/-/, $key_to_line_mapping->{$chunk_key}))[0];
@@ -741,11 +744,11 @@
 	}
 
-	# Map from chunk key to comment date
-	my $chunk_comment_date;
-	eval "\$chunk_comment_date = &get_${translation_file_type}_chunk_comment_date(\$chunk_text)";
-	$key_to_comment_date_mapping{$chunk_key} = $chunk_comment_date if (defined($chunk_comment_date));
-    }
-
-    return %key_to_comment_date_mapping;
+	# Map from chunk key to GTI comment
+	my $chunk_gti_comment;
+	eval "\$chunk_gti_comment = &get_${translation_file_type}_chunk_gti_comment(\$chunk_text)";
+	$key_to_gti_comment_mapping{$chunk_key} = $chunk_gti_comment if (defined($chunk_gti_comment));
+    }
+
+    return %key_to_gti_comment_mapping;
 }
 
@@ -946,10 +949,10 @@
 
 
-sub get_macrofile_chunk_comment_date
+sub get_macrofile_chunk_gti_comment
 {
     my ($chunk_text) = @_;
 
     # Check for an "Updated DD-MMM-YYYY" comment at the end of the chunk
-    if ($chunk_text =~ /\#\s+Updated\s+(\d?\d-\D\D\D-\d\d\d\d)\s*$/i) {
+    if ($chunk_text =~ /\#\s+(Updated\s+\d?\d-\D\D\D-\d\d\d\d)\s*$/i) {
 	return $1;
     }
@@ -981,5 +984,5 @@
     my @target_file_lines = @{shift(@_)};
     my $target_file_key_to_text_mapping = shift(@_);
-    my $target_file_key_to_comment_date_mapping = shift(@_);
+    my $target_file_key_to_gti_comment_mapping = shift(@_);
     my $target_language_code = shift(@_);
 
@@ -1069,7 +1072,7 @@
  	}
 
-	# Add the update date, if one exists
-	if ($target_file_key_to_comment_date_mapping->{$chunk_key}) {
-	    print TARGET_FILE "  # Updated " . $target_file_key_to_comment_date_mapping->{$chunk_key};
+	# Add the "updated" comment, if one exists
+	if ($target_file_key_to_gti_comment_mapping->{$chunk_key}) {
+	    print TARGET_FILE "  # " . $target_file_key_to_gti_comment_mapping->{$chunk_key};
 	}
 	print TARGET_FILE "\n";
@@ -1124,10 +1127,10 @@
 
 
-sub get_resource_bundle_chunk_comment_date
+sub get_resource_bundle_chunk_gti_comment
 {
     my ($chunk_text) = @_;
 
     # Check for an "Updated DD-MMM-YYYY" comment at the end of the chunk
-    if ($chunk_text =~ /\#\s+Updated\s+(\d?\d-\D\D\D-\d\d\d\d)\s*$/i) {
+    if ($chunk_text =~ /\#\s+(Updated\s+\d?\d-\D\D\D-\d\d\d\d)\s*$/i) {
 	return $1;
     }
@@ -1152,5 +1155,5 @@
     my @target_file_lines = @{shift(@_)};  # Not used
     my $target_file_key_to_text_mapping = shift(@_);
-    my $target_file_key_to_comment_date_mapping = shift(@_);
+    my $target_file_key_to_gti_comment_mapping = shift(@_);
     my $target_language_code = shift(@_);  # Not used
 
@@ -1191,6 +1194,6 @@
 
 	print TARGET_FILE "$chunk_key:$target_file_chunk_text";
-	if ($target_file_key_to_comment_date_mapping->{$chunk_key}) {
-	    print TARGET_FILE "  # Updated " . $target_file_key_to_comment_date_mapping->{$chunk_key};
+	if ($target_file_key_to_gti_comment_mapping->{$chunk_key}) {
+	    print TARGET_FILE "  # " . $target_file_key_to_gti_comment_mapping->{$chunk_key};
 	}
 	print TARGET_FILE "\n";
@@ -1258,5 +1261,5 @@
 
 
-sub get_greenstone_xml_chunk_comment_date
+sub get_greenstone_xml_chunk_gti_comment
 {
     my ($chunk_text) = @_;
@@ -1286,5 +1289,5 @@
     my @target_file_lines = @{shift(@_)};  # Not used
     my $target_file_key_to_text_mapping = shift(@_);
-    my $target_file_key_to_comment_date_mapping = shift(@_);
+    my $target_file_key_to_gti_comment_mapping = shift(@_);
     my $target_language_code = shift(@_);  # Not used
 
@@ -1326,6 +1329,6 @@
 
 	print TARGET_FILE "<Text id=\"$chunk_key\">$target_file_chunk_text</Text>";
-	if ($target_file_key_to_comment_date_mapping->{$chunk_key}) {
-	    print TARGET_FILE "<Updated date=\"" . $target_file_key_to_comment_date_mapping->{$chunk_key} . "\"\/>";
+	if ($target_file_key_to_gti_comment_mapping->{$chunk_key}) {
+	    print TARGET_FILE "<Updated date=\"" . $target_file_key_to_gti_comment_mapping->{$chunk_key} . "\"\/>";
 	}
 	print TARGET_FILE "\n";
