Diff for /loncom/localize/localize/synch.pl between versions 1.13 and 1.14

version 1.13, 2009/06/03 16:33:15 version 1.14, 2009/12/09 10:30:45
Line 26  my $debug=0; Line 26  my $debug=0;
 # If you want to exclude translation files from being included  # If you want to exclude translation files from being included
 # in the synching process, remove their file names from this list.  # in the synching process, remove their file names from this list.
 my @listoffiles=(  my @listoffiles=(
        'ar.pm'  #      'test.pm'
         ,'ar.pm'
       ,'de.pm'        ,'de.pm'
       ,'es.pm'        ,'es.pm'
       ,'fa.pm'        ,'fa.pm'
Line 77  sub readnew { Line 78  sub readnew {
     open(IN,'newphrases.txt') or die;      open(IN,'newphrases.txt') or die;
     my %lexicon=();      my %lexicon=();
     while (my $line=<IN>) {      while (my $line=<IN>) {
  chomp($line);          chomp($line);
  $lexicon{$line}=$line;          next if ($line eq '');
           $lexicon{$line}=$line;
         print "    New entry: '$line'\n" if $debug;          print "    New entry: '$line'\n" if $debug;
     }      }
     close(IN);      close(IN);
Line 97  sub takethisfile { Line 99  sub takethisfile {
   
 # ----------------------------------------------------------------  # ----------------------------------------------------------------
 # ----- Main Program -----  # ----- Main Program -----
 my $i;  my $i; # Count new phrases
 my $num;  my $num;
 my $dlm;  my $dlm; # Delimiter character
 my $comment;  my $comment;
   
 print "*** Synching Translation Files ***\n";  print "*** Synching Translation Files ***\n";
Line 131  open(IN,'removephrases.txt') or die; Line 133  open(IN,'removephrases.txt') or die;
 my $rm=0;  my $rm=0;
 while (my $line=<IN>) {  while (my $line=<IN>) {
     chomp($line);      chomp($line);
       next if ($line eq '');
     delete $master{$line};      delete $master{$line};
     $rm++;      $rm++;
 }  }
Line 165  foreach my $fn (<*.pm>) { Line 168  foreach my $fn (<*.pm>) {
         # Sync master with current translation file:          # Sync master with current translation file:
  foreach my $key (sort keys %master) {   foreach my $key (sort keys %master) {
     print "\n    Checking key: '$key'" if $debug;      print "\n    Checking key: '$key'" if $debug;
     unless ($key) { next; }      next unless ($key);
     unless ($lang{$key}) {      unless ($lang{$key}) {
                 # Translation helper?                  # Translation helper?
                 if ($helper) {                  if ($helper) {
Line 187  foreach my $fn (<*.pm>) { Line 190  foreach my $fn (<*.pm>) {
     $num='';      $num='';
  }   }
                 # Find delimiter for key and value                  # Find delimiter for key and value
  if (($key=~/\'/) & ($key=~/\"/)) {                  if (($key=~/\'/) & ($key=~/\"/)) {
     $quotwarn++;                      $quotwarn++;
     print " Warning: Both, ' and \",occur!" if $debug;                      print " (Warning: Both, ' and \", occur!)" if $debug;
  }                  }
  # if (($key=~/[^\\]\'/) | ($key=~/\\\"/)) {   # if (($key=~/[^\\]\'/) | ($key=~/\\\"/)) {
  if ($key=~/\'/) {   if ($key=~/\'/) {
     $dlm='"';      $dlm='"';

Removed from v.1.13  
changed lines
  Added in v.1.14


FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>