projects
/
kivitendo-erp.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
XML basiertes Menue, siehe Bug #771
[kivitendo-erp.git]
/
locale
/
de
/
locales.pl
diff --git
a/locale/de/locales.pl
b/locale/de/locales.pl
index
4e67bd3
..
70ca6d2
100755
(executable)
--- a/
locale/de/locales.pl
+++ b/
locale/de/locales.pl
@@
-14,6
+14,8
@@
$| = 1;
$basedir = "../..";
$bindir = "$basedir/bin/mozilla";
$basedir = "../..";
$bindir = "$basedir/bin/mozilla";
+$dbupdir = "$basedir/sql/Pg-upgrade";
+$dbupdir2 = "$basedir/sql/Pg-upgrade2";
$menufile = "menu.ini";
$submitsearch = qr/type\s*=\s*[\"\']?submit/i;
$menufile = "menu.ini";
$submitsearch = qr/type\s*=\s*[\"\']?submit/i;
@@
-23,7
+25,7
@@
foreach $item (@ARGV) {
}
opendir DIR, "$bindir" or die "$!";
}
opendir DIR, "$bindir" or die "$!";
-@progfiles = grep { /\.pl
/;
!/(_|^\.)/ } readdir DIR;
+@progfiles = grep { /\.pl
$/ &&
!/(_|^\.)/ } readdir DIR;
seekdir DIR, 0;
@customfiles = grep /_/, readdir DIR;
closedir DIR;
seekdir DIR, 0;
@customfiles = grep /_/, readdir DIR;
closedir DIR;
@@
-40,6
+42,14
@@
if ($arg{n}) {
unshift @menufiles, $menufile;
}
unshift @menufiles, $menufile;
}
+opendir DIR, $dbupdir or die "$!";
+@dbplfiles = grep { /\.pl$/ } readdir DIR;
+closedir DIR;
+
+opendir DIR, $dbupdir2 or die "$!";
+@dbplfiles2 = grep { /\.pl$/ } readdir DIR;
+closedir DIR;
+
# slurp the translations in
if (-f 'all') {
require "all";
# slurp the translations in
if (-f 'all') {
require "all";
@@
-52,20
+62,24
@@
if (-f 'all') {
# scanhtmlfile($file);
#}
# scanhtmlfile($file);
#}
-foreach $file (@progfiles) {
+map({ handle_file($_, $bindir); } @progfiles);
+map({ handle_file($_, $dbupdir); } @dbplfiles);
+map({ handle_file($_, $dbupdir2); } @dbplfiles2);
+sub handle_file {
+ my ($file, $dir) = @_;
print "\n$file" if $arg{v};
%locale = ();
%submit = ();
%subrt = ();
print "\n$file" if $arg{v};
%locale = ();
%submit = ();
%subrt = ();
- &scanfile("$
bin
dir/$file");
+ &scanfile("$dir/$file");
# scan custom_{module}.pl or {login}_{module}.pl files
foreach $customfile (@customfiles) {
if ($customfile =~ /_$file/) {
# scan custom_{module}.pl or {login}_{module}.pl files
foreach $customfile (@customfiles) {
if ($customfile =~ /_$file/) {
- if (-f "$
bin
dir/$customfile") {
- &scanfile("$
bin
dir/$customfile");
+ if (-f "$dir/$customfile") {
+ &scanfile("$dir/$customfile");
}
}
}
}
}
}
@@
-91,20
+105,20
@@
foreach $file (@progfiles) {
foreach $text (keys %$missing) {
if ($locale{$text} || $htmllocale{$text}) {
foreach $text (keys %$missing) {
if ($locale{$text} || $htmllocale{$text}) {
- unless ($self{texts}{$text}) {
- $self{texts}{$text} = $missing->{$text};
+ unless ($self
->
{texts}{$text}) {
+ $self
->
{texts}{$text} = $missing->{$text};
}
}
}
open FH, ">$file" or die "$! : $file";
}
}
}
open FH, ">$file" or die "$! : $file";
- print FH q|$self{texts} = {
+ print FH q|$self
->
{texts} = {
|;
foreach $key (sort keys %locale) {
|;
foreach $key (sort keys %locale) {
- if ($self{texts}{$key}) {
- $text = $self{texts}{$key};
+ if ($self
->
{texts}{$key}) {
+ $text = $self
->
{texts}{$key};
} else {
$text = $key;
}
} else {
$text = $key;
}
@@
-122,7
+136,7
@@
foreach $file (@progfiles) {
print FH q|};
print FH q|};
-$self{subs} = {
+$self
->
{subs} = {
|;
foreach $key (sort keys %subrt) {
|;
foreach $key (sort keys %subrt) {
@@
-133,7
+147,7
@@
$self{subs} = {
}
foreach $key (sort keys %submit) {
}
foreach $key (sort keys %submit) {
- $text = ($self
{texts}{$key}) ? $self
{texts}{$key} : $key;
+ $text = ($self
->{texts}{$key}) ? $self->
{texts}{$key} : $key;
$text =~ s/'/\\'/g;
$text =~ s/\\$/\\\\/;
$text =~ s/'/\\'/g;
$text =~ s/\\$/\\\\/;
@@
-172,11
+186,11
@@
print FH q|# These are all the texts to build the translations files.
# you can add the translation in this file or in the 'missing' file
# run locales.pl from this directory to rebuild the translation files
# you can add the translation in this file or in the 'missing' file
# run locales.pl from this directory to rebuild the translation files
-$self{texts} = {
+$self
->
{texts} = {
|;
foreach $key (sort keys %alllocales) {
|;
foreach $key (sort keys %alllocales) {
- $text = $self{texts}{$key};
+ $text = $self
->
{texts}{$key};
$count++;
$count++;
@@
-263,7
+277,7
@@
sub extract_text_between_parenthesis {
} elsif (($cur_char eq '"') || ($cur_char eq '\'')) {
$inside_string = $cur_char;
} elsif (($cur_char eq '"') || ($cur_char eq '\'')) {
$inside_string = $cur_char;
- } elsif (
$cur_char eq ")"
) {
+ } elsif (
($cur_char eq ")") || ($cur_char eq ',')
) {
return ($text, substr($line, $pos + 1));
}
return ($text, substr($line, $pos + 1));
}
@@
-313,7
+327,7
@@
sub scanfile {
if (/require\s+\W.*\.pl/) {
my $newfile = $&;
$newfile =~ s/require\s+\W//;
if (/require\s+\W.*\.pl/) {
my $newfile = $&;
$newfile =~ s/require\s+\W//;
- $newfile =~ s
/\$form->{path}\///
;
+ $newfile =~ s
|bin/mozilla||
;
# &scanfile("$bindir/$newfile", 0, $scanned_files);
$cached{$file}{scan}{"$bindir/$newfile"} = 1;
} elsif (/use\s+SL::(.*?);/) {
# &scanfile("$bindir/$newfile", 0, $scanned_files);
$cached{$file}{scan}{"$bindir/$newfile"} = 1;
} elsif (/use\s+SL::(.*?);/) {
@@
-322,7
+336,7
@@
sub scanfile {
}
# is this a template call?
}
# is this a template call?
- if (/parse_html_template\s*\(\s*[\"\']([\w\/]+)/) {
+ if (/parse_html_template
2?
\s*\(\s*[\"\']([\w\/]+)/) {
my $newfile = "$basedir/templates/webpages/$1_master.html";
if (-f $newfile) {
# &scanhtmlfile($newfile);
my $newfile = "$basedir/templates/webpages/$1_master.html";
if (-f $newfile) {
# &scanhtmlfile($newfile);
@@
-468,7
+482,8
@@
sub scanhtmlfile {
if ($line =~ m|</translate>|i) {
$text .= $`;
substr($line, 0, $+[0]) = "";
if ($line =~ m|</translate>|i) {
$text .= $`;
substr($line, 0, $+[0]) = "";
-
+ $text =~ s/\s+/ /g;
+
$copying = 0;
if ($issubmit) {
# $submit{$text} = 1;
$copying = 0;
if ($issubmit) {
# $submit{$text} = 1;
@@
-538,10
+553,11
@@
sub converthtmlfile {
if ($line =~ m|</translate>|i) {
$text .= $`;
substr($line, 0, $+[0]) = "";
if ($line =~ m|</translate>|i) {
$text .= $`;
substr($line, 0, $+[0]) = "";
+ $text =~ s/\s+/ /g;
$copying = 0;
$alllocales{$text} = 1;
$htmllocale{$text} = 1;
$copying = 0;
$alllocales{$text} = 1;
$htmllocale{$text} = 1;
- print(OUT $self{"texts"}{$text} || $text);
+ print(OUT $self
->
{"texts"}{$text} || $text);
print(OUT "\n") if ("" eq $line);
$text = "";
print(OUT "\n") if ("" eq $line);
$text = "";