Hi,

I found it a mess to prepare a list of the various rule description,
the first time I did the French translation.

Now that I make myself ready for a second translation, I found I had
to merge the English description, get the French existing one, and see
what is only new. Yuck!

So, I come up with the following Perl script that will add all the new
English rules at the end of a foreing file.

Pretty easy and makes my life much simpler. I thought other
translators could benefit.

Olivier

#!/usr/local/bin/perl

if ($#ARGV!=0) {
    print stderr "Usage: $0 <lang>
where <lang> is the two letter suffix for the language
";
    exit;
}

$lang=$ARGV[0];

link "30_text_$lang.cf", "orig_30_text_$lang.cf";

open IN, "30_text_$lang.cf";
while (<IN>) {
    next unless /^lang $lang describe\s([^\s]+)\s/;
    $rule{$1}=1;
}
close IN;

open IN, "cat *|grep '^describe'|";
open OUT, ">>30_text_$lang.cf";
while (<IN>) {
    next unless /^describe\s([^\s]+)\s/;
    next if $rule{$1};
    print OUT "lang $lang $_";
}


_______________________________________________________________

Have big pipes? SourceForge.net is looking for download mirrors. We supply
the hardware. You get the recognition. Email Us: [EMAIL PROTECTED]
_______________________________________________
Spamassassin-talk mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/spamassassin-talk

Reply via email to