From af85b761c4c8b34c250b760233e433d59a8fa050 Mon Sep 17 00:00:00 2001 From: Moritz Bunkus Date: Mon, 20 Feb 2006 09:32:07 +0000 Subject: [PATCH] Wenn $main::myconfig noch nicht verfuegbar ist (z.B. beim Datenbankupgrade direkt nach der Anmeldung), dann muss die Sprache fuer die HTML-Vorlagen aus der globalen Variablen $language geholt werden, die in lx-erp.conf definiert wird. --- SL/Form.pm | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/SL/Form.pm b/SL/Form.pm index b6f62fb91..e7fea51f4 100644 --- a/SL/Form.pm +++ b/SL/Form.pm @@ -415,27 +415,31 @@ sub parse_html_template { $main::lxdebug->enter_sub(); my ($self, $file, $additional_params) = @_; + my $language; - if (-f "templates/webpages/${file}_" . $main::myconfig{"countrycode"} . - ".html") { + if (!defined($main::myconfig) || !defined($main::myconfig{"countrycode"})) { + $language = $main::language; + } else { + $language = $main::myconfig{"countrycode"}; + } + + if (-f "templates/webpages/${file}_${language}.html") { if ((-f ".developer") && (-f "templates/webpages/${file}_master.html") && ((stat("templates/webpages/${file}_master.html"))[9] > - (stat("templates/webpages/${file}_" . $main::myconfig{"countrycode"} . - ".html"))[9])) { + (stat("templates/webpages/${file}_${language}.html"))[9])) { my $info = "Developper information: templates/webpages/${file}_master.html is newer than the localized version.\n" . - "Please re-run 'locales.pl' in 'locale/" . $main::myconfig{"countrycode"} . "'."; + "Please re-run 'locales.pl' in 'locale/${language}'."; print(qq|
$info
|); die($info); } - $file = "templates/webpages/${file}_" . $main::myconfig{"countrycode"} . - ".html"; + $file = "templates/webpages/${file}_${language}.html"; } elsif (-f "templates/webpages/${file}.html") { $file = "templates/webpages/${file}.html"; } else { my $info = "Web page template '${file}' not found.\n" . - "Please re-run 'locales.pl' in 'locale/" . $main::myconfig{"countrycode"} . "'."; + "Please re-run 'locales.pl' in 'locale/${language}'."; print(qq|
$info
|); die($info); } -- 2.20.1