projects
/
kivitendo-erp.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
be5086c
)
Locale: zusätzliche Locales parsen
author
Sven Schöling
<s.schoeling@linet-services.de>
Fri, 17 Jul 2015 12:46:39 +0000
(14:46 +0200)
committer
Sven Schöling
<s.schoeling@linet-services.de>
Mon, 20 Jul 2015 14:37:27 +0000
(16:37 +0200)
SL/Locale.pm
patch
|
blob
|
history
diff --git
a/SL/Locale.pm
b/SL/Locale.pm
index
8495553
..
4198a33
100644
(file)
--- a/
SL/Locale.pm
+++ b/
SL/Locale.pm
@@
-80,11
+80,27
@@
sub _init {
$self->{countrycode} = $country;
if ($country && -d "locale/$country") {
$self->{countrycode} = $country;
if ($country && -d "locale/$country") {
- local *IN;
- if (open(IN, "<", "locale/$country/all")) {
- my $code =
join("", <IN>)
;
+ if (open my $in, "<", "locale/$country/all") {
+ local $/ = undef;
+ my $code =
<$in>
;
eval($code);
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} };
+ }
+ }
}
}
}
}