Alu-Funktion aus Kundenprojekt entfernt.
[kivitendo-erp.git] / locale / de / locales.pl
index 4e67bd3..119dfe9 100755 (executable)
@@ -14,6 +14,7 @@ $| = 1;
 
 $basedir  = "../..";
 $bindir   = "$basedir/bin/mozilla";
+$dbupdir  = "$basedir/sql/Pg-upgrade";
 $menufile = "menu.ini";
 $submitsearch = qr/type\s*=\s*[\"\']?submit/i;
 
@@ -40,6 +41,10 @@ if ($arg{n}) {
   unshift @menufiles, $menufile;
 }
 
+opendir DIR, $dbupdir or die "$!";
+@dbplfiles = grep { /\.pl$/ } readdir DIR;
+closedir DIR;
+
 # slurp the translations in
 if (-f 'all') {
   require "all";
@@ -52,20 +57,23 @@ if (-f 'all') {
 #  scanhtmlfile($file);
 #}
 
-foreach $file (@progfiles) {
+map({ handle_file($_, $bindir); } @progfiles);
+map({ handle_file($_, $dbupdir); } @dbplfiles);
 
+sub handle_file {
+  my ($file, $dir) = @_;
   print "\n$file" if $arg{v};
   %locale = ();
   %submit = ();
   %subrt  = ();
 
-  &scanfile("$bindir/$file");
+  &scanfile("$dir/$file");
 
   # scan custom_{module}.pl or {login}_{module}.pl files
   foreach $customfile (@customfiles) {
     if ($customfile =~ /_$file/) {
-      if (-f "$bindir/$customfile") {
-        &scanfile("$bindir/$customfile");
+      if (-f "$dir/$customfile") {
+        &scanfile("$dir/$customfile");
       }
     }
   }
@@ -97,7 +105,8 @@ foreach $file (@progfiles) {
     }
   }
 
-  open FH, ">$file" or die "$! : $file";
+  my $localefile = $dir eq $bindir ? $file : "dbupgrade";
+  open FH, ">$localefile" or die "$! : $localefile";
 
   print FH q|$self{texts} = {
 |;
@@ -468,7 +477,8 @@ sub scanhtmlfile {
           if ($line =~ m|</translate>|i) {
             $text .= $`;
             substr($line, 0, $+[0]) = "";
-            
+            $text =~ s/\s+/ /g;
+
             $copying = 0; 
             if ($issubmit) {
   #            $submit{$text} = 1;
@@ -538,6 +548,7 @@ sub converthtmlfile {
         if ($line =~ m|</translate>|i) {
           $text .= $`;
           substr($line, 0, $+[0]) = "";
+          $text =~ s/\s+/ /g;
           $copying = 0;
           $alllocales{$text} = 1;
           $htmllocale{$text} = 1;