version 1.1, 2003/09/26 14:13:35
|
version 1.4, 2003/09/26 18:39:48
|
Line 1
|
Line 1
|
|
|
|
|
sub readlexicon { |
sub readlexicon { |
my $fn=shift; |
my $fn=shift; |
open(IN,$fn); |
open(IN,$fn); |
Line 13 sub readlexicon {
|
Line 15 sub readlexicon {
|
return %lexicon; |
return %lexicon; |
} |
} |
|
|
&readlexicon('de.pm'); |
my %master=(); |
|
foreach (<*.pm>) { |
|
print "Reading: ".$_."\n"; |
|
%master=(%master,&readlexicon($_)); |
|
} |
|
|
|
foreach my $fn (<*.pm>) { |
|
print "Synching: ".$fn."\n"; |
|
my %lang=&readlexicon($fn); |
|
system ("cp $fn $fn.original"); |
|
open(IN,$fn.'.original'); |
|
open(OUT,'>'.$fn); |
|
my $found=0; |
|
while (<IN>) { |
|
if ($_=~/\#\s*SYNCMARKER/) { $found=1; last; } |
|
print OUT $_; |
|
} |
|
if ($found) { |
|
print OUT "\n\#SYNC ".localtime()."\n"; |
|
foreach (sort keys %master) { |
|
unless ($lang{$_}) { |
|
print OUT (<<ENDNEW); |
|
'$_' |
|
=> '$_', |
|
|
|
ENDNEW |
|
} |
|
} |
|
|
|
print OUT "\n\#SYNCMARKER\n"; |
|
foreach (<IN>) { |
|
print OUT $_; |
|
} |
|
} |
|
close (IN); |
|
close (OUT); |
|
} |