X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=locale%2Fde%2Flocales.pl;h=119dfe92bcbc1c9158649235fdd83874d5c76426;hb=92daa1a66a9ff737c92df86da3c28d663c421032;hp=4e67bd32e69e0a0b0c075376de1ab18bd997c392;hpb=2ea678058cc4890be367512f809b75872ecd9726;p=kivitendo-erp.git diff --git a/locale/de/locales.pl b/locale/de/locales.pl index 4e67bd32e..119dfe92b 100755 --- a/locale/de/locales.pl +++ b/locale/de/locales.pl @@ -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||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||i) { $text .= $`; substr($line, 0, $+[0]) = ""; + $text =~ s/\s+/ /g; $copying = 0; $alllocales{$text} = 1; $htmllocale{$text} = 1;