Diff for /loncom/localize/localize/synch.pl between versions 1.7 and 1.8

version 1.7, 2003/11/28 02:12:05 version 1.8, 2008/07/10 19:10:26
Line 52  foreach my $fn (<*.pm>) { Line 52  foreach my $fn (<*.pm>) {
     open(IN,$fn.'.original');      open(IN,$fn.'.original');
     open(OUT,'>'.$fn);      open(OUT,'>'.$fn);
     my $found=0;      my $found=0;
       # Rebuild current translation file until SYNCMARKER:
     while (<IN>) {      while (<IN>) {
  if ($_=~/\#\s*SYNCMARKER/) { $found=1; last; }    if ($_=~/\#\s*SYNCMARKER/) { $found=1; last; } 
  print OUT $_;   print OUT $_;
Line 59  foreach my $fn (<*.pm>) { Line 60  foreach my $fn (<*.pm>) {
     if ($found) {      if ($found) {
  $i=0;   $i=0;
  print OUT "\n\#SYNC ".localtime()."\n";   print OUT "\n\#SYNC ".localtime()."\n";
           # Sync master with current translation file:
  foreach my $key (sort keys %master) {   foreach my $key (sort keys %master) {
     unless ($key) { next; }      unless ($key) { next; }
     unless ($lang{$key}) {      unless ($lang{$key}) {
  my $comment='';   my $comment='';
  my $copytrans=$key;   my $copytrans=$key;
                   # Create comment based on already existing translations:
  foreach (reverse sort keys %lang) {   foreach (reverse sort keys %lang) {
     $copytrans=~s/$_/$lang{$_}/gsi;      $copytrans=~s/\Q$_\E/$lang{$_}/gsi; # \Q \E: escape meta characters
  }   }
  if (lc($copytrans) ne lc($key)) {   if (lc($copytrans) ne lc($key)) {
     $comment='# '.$copytrans;      $comment='# '.$copytrans;

Removed from v.1.7  
changed lines
  Added in v.1.8


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