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

www lon-capa-cvs@mail.lon-capa.org
Fri, 26 Sep 2003 15:23:24 -0000


www		Fri Sep 26 11:23:24 2003 EDT

  Modified files:              
    /loncom/localize/localize	synch.pl 
  Log:
  Utility
  
  
Index: loncom/localize/localize/synch.pl
diff -u loncom/localize/localize/synch.pl:1.1 loncom/localize/localize/synch.pl:1.2
--- loncom/localize/localize/synch.pl:1.1	Fri Sep 26 10:13:35 2003
+++ loncom/localize/localize/synch.pl	Fri Sep 26 11:23:24 2003
@@ -13,4 +13,30 @@
     return %lexicon;
 }
 
-&readlexicon('de.pm');
+my %master=();
+foreach (<*.pm>) {
+    print "Reading: ".$_."\n";
+    %master=(%master,&readlexicon($_));
+}
+foreach (<*.pm>) {
+    print "Synching: ".$_."\n";
+    my %lang=&readlexicon($_);
+    copy ($fn,$fn.'.original');
+    open(IN,$fn.'.original');
+    open(OUT,'>'.$fn);
+    my $found=0;
+    foreach (<IN>) {
+	if ($_=~/\#\s*SYNCMARKER/) { $found=1; last; } 
+	print OUT $_;
+    }
+    if ($found) {
+	print OUT "\n\#SYNC ".localtime."\n";
+
+	print OUT "\n\#SYNCMARKER\n";
+	foreach (<IN>) {
+	    print OUT $_;
+	}
+    }
+    close (IN);
+    close (OUT);
+}