From: Sven Schöling Date: Fri, 17 Jul 2015 12:46:39 +0000 (+0200) Subject: Locale: zusätzliche Locales parsen X-Git-Tag: release-3.3.0beta~31^2~12 X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=79dea6ab7b56149b02d2910ea56f26f13afea291;p=kivitendo-erp.git Locale: zusätzliche Locales parsen --- diff --git a/SL/Locale.pm b/SL/Locale.pm index 8495553e8..4198a339b 100644 --- a/SL/Locale.pm +++ b/SL/Locale.pm @@ -80,11 +80,27 @@ sub _init { $self->{countrycode} = $country; if ($country && -d "locale/$country") { - local *IN; - if (open(IN, "<", "locale/$country/all")) { - my $code = join("", ); + if (open my $in, "<", "locale/$country/all") { + local $/ = undef; + my $code = <$in>; eval($code); - close(IN); + close($in); + } + + if (-d "locale/$country/more") { + opendir my $dh, "locale/$country/more" or die "can't open locale/$country/more: $!"; + my @files = sort grep -f "locale/$country/more/$_", readdir $dh; + close $dh; + + for my $file (@files) { + if (open my $in, "<", "locale/$country/more/$file") { + local $/ = undef; + my $code = <$file>; + eval($code); + close($in); + $self->{texts}{$_} = $self->{more_texts}{$_} for keys %{ $self->{more_texts} }; + } + } } }