Index: /main/trunk/greenstone2/bin/script/gti.pl
===================================================================
--- /main/trunk/greenstone2/bin/script/gti.pl	(revision 30686)
+++ /main/trunk/greenstone2/bin/script/gti.pl	(revision 30687)
@@ -678,6 +678,12 @@
     # Check that the translations are valid
     foreach my $chunk_key (keys(%source_file_key_to_submission_mapping)) {
+
+	# Kathy introduced escaped colons ("\:") into chunk keys in properties files (greenstone3/metadata_names),
+	# but they're not escaped in the submitted XML versions. So have to carefully compare for submissions:
+	my $escaped_chunk_key = $chunk_key;
+	$escaped_chunk_key =~ s/:/\\:/g;
+
 		# Make sure the submitted chunk still exists in the source file
-		if (!defined($source_file_key_to_text_mapping{$chunk_key})) {
+		if (!defined($source_file_key_to_text_mapping{$escaped_chunk_key})) {
 			&log_message("Warning: Source chunk $chunk_key no longer exists (ignoring submission).");
 			delete $source_file_key_to_submission_mapping{$chunk_key};
@@ -687,12 +693,12 @@
 		
 		# Make sure the submitted source chunk matches the source file chunk
-		if ($source_file_key_to_submission_mapping{$chunk_key} ne &unmake_text_xml_safe($source_file_key_to_text_mapping{$chunk_key})) {
+		if ($source_file_key_to_submission_mapping{$chunk_key} ne &unmake_text_xml_safe($source_file_key_to_text_mapping{$escaped_chunk_key})) {
 		#if (&unmake_text_xml_safe($source_file_key_to_submission_mapping{$chunk_key}) ne &unmake_text_xml_safe($source_file_key_to_text_mapping{$chunk_key})) {
 		    		#print STDERR "**** $source_file_key_to_submission_mapping{$chunk_key}\n";
 				#print STDERR "**** " . &unmake_text_xml_safe($source_file_key_to_text_mapping{$chunk_key}) ."\n";
 
-			&log_message("Warning: Source chunk $chunk_key has changed (ignoring submission).");
-			&log_message("Submission source: $source_file_key_to_submission_mapping{$chunk_key}");
-			&log_message("      Source text: $source_file_key_to_text_mapping{$chunk_key}");
+			&log_message("Warning: Source chunk $escaped_chunk_key has changed (ignoring submission).");
+			&log_message("Submission source: |$source_file_key_to_submission_mapping{$chunk_key}|");
+			&log_message("      Source text: |$source_file_key_to_text_mapping{$escaped_chunk_key}|");
 			delete $source_file_key_to_submission_mapping{$chunk_key};
 			delete $target_file_key_to_submission_mapping{$chunk_key};
@@ -704,7 +710,9 @@
     foreach my $chunk_key (keys(%target_file_key_to_submission_mapping)) {
 		# Only apply the submission if it is a change, unless -force_submission has been specified
-		if ($force_submission_flag || !defined($target_file_key_to_text_mapping{$chunk_key}) || $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_gti_comment_mapping{$chunk_key} = "Updated $submission_date by $submitter_username";
+	my $escaped_chunk_key = $chunk_key;
+	$escaped_chunk_key =~ s/:/\\:/g;
+		if ($force_submission_flag || !defined($target_file_key_to_text_mapping{$escaped_chunk_key}) || $target_file_key_to_submission_mapping{$chunk_key} ne $target_file_key_to_text_mapping{$escaped_chunk_key}) {
+			$target_file_key_to_text_mapping{$escaped_chunk_key} = $target_file_key_to_submission_mapping{$chunk_key};
+			$target_file_key_to_gti_comment_mapping{$escaped_chunk_key} = "Updated $submission_date by $submitter_username";
 		}
     }
@@ -917,7 +925,4 @@
 {
     my ($file_lines, $key_to_line_mapping, $translation_file_type) = @_;
-
-		&log_message("@@@ HELLO WORLD");
-
 	
     my %key_to_text_mapping = ();
@@ -1616,7 +1621,15 @@
 		$line =~ s/(\s*)$//;  # Remove any nasty whitespace, carriage returns etc.
 		
+		$line =~ s/\\:/ESCAPEDCOLONTEMP/g; # an escaped colon "\:" should only occur in the chunk_key portion of the line
+
 		# Line contains a dictionary string
-		if ($line =~ /^(\S+)[:|=](.*)$/) {
+		if ($line =~ /^(\S+?)[:|=](.*)$/) {
 		    $chunk_key = $1;
+
+		    # an escaped colon "\:" should only occur in the chunk_key portion of the line, put it back in, escaped as before
+		    if($chunk_key =~ m/ESCAPEDCOLONTEMP/) {
+			$chunk_key =~ s/ESCAPEDCOLONTEMP/\\:/g;
+		    }
+		    
 		    $startindex = $i;
 		}		
@@ -1630,5 +1643,5 @@
 			$chunk_key = "";
 		    }
-		}				
+		}		
     }
 	
@@ -1641,6 +1654,8 @@
     my ($chunk_text) = @_;
 	
-    # Simple: just remove string key
-    $chunk_text =~ s/^(\S+)[:|=](\s*)//s;
+    $chunk_text =~ s/\\:/ESCAPEDCOLONTEMP/g; # an escaped colon "\:" should only occur in the chunk_key portion of the line
+
+    # Simple: just remove string key    
+    $chunk_text =~ s/^(\S+?)[:|=](\s*)//s;
     $chunk_text =~ s/(\s*)$//s;  # Remove any nasty whitespace, carriage returns etc.
     $chunk_text =~ s/(\s*)\#\s+Updated\s+(\d?\d-\D\D\D-\d\d\d\d.*)\s*$//is;
