--- loncom/localize/localize/synch.pl 2009/01/16 15:20:29 1.12 +++ loncom/localize/localize/synch.pl 2009/06/03 16:33:15 1.13 @@ -21,11 +21,22 @@ my $helper=0; # 1: display, 0: don't display my $debug=0; -# List of files to be ignored when synching -# These files don't contain actual translation phrases -my @ignorefiles=( - "x_chef.pm" - ,"en.pm" +# List of files to be accepted as translation files for synching +# These files contain actual translation phrases. +# If you want to exclude translation files from being included +# in the synching process, remove their file names from this list. +my @listoffiles=( + 'ar.pm' + ,'de.pm' + ,'es.pm' + ,'fa.pm' + ,'fr.pm' + ,'he.pm' + ,'ja.pm' + ,'pt.pm' + ,'ru.pm' + ,'tr.pm' + ,'zh.pm' ); # ---------------------------------------------------------------- @@ -74,10 +85,10 @@ sub readnew { return %lexicon; } -sub ignorefile { +sub takethisfile { my $file = shift; - foreach my $ignfile (@ignorefiles) { - if ($ignfile eq $file) { return 1 } + foreach my $listfile (@listoffiles) { + if ($listfile eq $file) { return 1 } } return 0; } @@ -104,10 +115,11 @@ print "ok.\n"; # Add all the different phrases of all translation files to master hash foreach (<*.pm>) { - if (&ignorefile($_)) { next } - print " Reading '".$_."'... "; - %master=(%master,&readlexicon($_)); - print "ok.\n"; + if (&takethisfile($_)) { + print " Reading '".$_."'... "; + %master=(%master,&readlexicon($_)); + print "ok.\n"; + } } # Ignore all phrases found in removephrases.txt for current synchronization. @@ -129,7 +141,7 @@ print "$rm removed... ok.\n"; print "Synchronization:\n"; my $quotwarn=0; foreach my $fn (<*.pm>) { - if (&ignorefile($fn)) { next } + if (!&takethisfile($fn)) { next } print " Synching '".$fn."'... "; # Build hash with all translations of current translation file my %lang=&readlexicon($fn);