[LON-CAPA-cvs] cvs: loncom /localize/localize synch.pl

www lon-capa-cvs@mail.lon-capa.org
Fri, 28 Nov 2003 02:12:05 -0000


www		Thu Nov 27 21:12:05 2003 EDT

  Modified files:              
    /loncom/localize/localize	synch.pl 
  Log:
  New optional "numbered" mode, take care of "'" in phrases.
  
  
Index: loncom/localize/localize/synch.pl
diff -u loncom/localize/localize/synch.pl:1.6 loncom/localize/localize/synch.pl:1.7
--- loncom/localize/localize/synch.pl:1.6	Tue Oct 14 13:34:04 2003
+++ loncom/localize/localize/synch.pl	Thu Nov 27 21:12:05 2003
@@ -1,4 +1,4 @@
-
+#$numbered=1;
 
 sub readlexicon {
     my $fn=shift;
@@ -57,6 +57,7 @@
 	print OUT $_;
     }
     if ($found) {
+	$i=0;
 	print OUT "\n\#SYNC ".localtime()."\n";
 	foreach my $key (sort keys %master) {
 	    unless ($key) { next; }
@@ -69,9 +70,20 @@
 		if (lc($copytrans) ne lc($key)) {
 		    $comment='# '.$copytrans;
                 }
+		if ($numbered) {
+		    $i++;
+		    $num=' ('.$i.')';
+		} else {
+		    $num='';
+		}
+		if ($key=~/\'/) {
+		    $del='"';
+		} else {
+		    $del="'";
+		}
 		print OUT (<<ENDNEW);
-   '$key'
-=> '$key',
+   $del$key$del
+=> $del$key$num$del,
 $comment
 ENDNEW
 	    }