line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package HTML::Chunks::Local; |
2
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
our $VERSION = "1.02"; |
4
|
|
|
|
|
|
|
|
5
|
1
|
|
|
1
|
|
1176
|
use strict; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
40
|
|
6
|
1
|
|
|
1
|
|
6
|
use base qw(HTML::Chunks); |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
629
|
|
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
sub new |
9
|
|
|
|
|
|
|
{ |
10
|
0
|
|
|
0
|
1
|
|
my $class = shift; |
11
|
0
|
|
|
|
|
|
my $self = $class->SUPER::new(@_); |
12
|
|
|
|
|
|
|
|
13
|
0
|
|
|
|
|
|
$self->{langdefaults} = []; |
14
|
|
|
|
|
|
|
|
15
|
0
|
|
|
|
|
|
return $self; |
16
|
|
|
|
|
|
|
} |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
sub output { |
19
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
20
|
0
|
|
|
|
|
|
my $name = shift; |
21
|
0
|
|
|
|
|
|
my $uselang = shift; |
22
|
|
|
|
|
|
|
|
23
|
0
|
|
|
|
|
|
foreach my $lang (@{$uselang}, @{$self->{langdefaults}}) { |
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
24
|
0
|
0
|
|
|
|
|
if (defined($self->{chunk}{"$name\_$lang"})) { |
25
|
0
|
|
|
|
|
|
return $self->SUPER::output("$name\_$lang", @_); |
26
|
|
|
|
|
|
|
} |
27
|
|
|
|
|
|
|
} |
28
|
|
|
|
|
|
|
# our last default is the chunk name with no language suffix |
29
|
0
|
|
|
|
|
|
return $self->SUPER::output($name, @_); |
30
|
|
|
|
|
|
|
} |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
sub setLangDefaults { |
33
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
34
|
0
|
|
|
|
|
|
($self->{langdefaults}) = @_; |
35
|
|
|
|
|
|
|
} |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
sub getLangDefaults { |
38
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
39
|
0
|
|
|
|
|
|
return $self->{langdefaults}; |
40
|
|
|
|
|
|
|
} |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
sub guessLanguage { |
43
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
44
|
0
|
|
|
|
|
|
my @return; |
45
|
|
|
|
|
|
|
|
46
|
0
|
|
|
|
|
|
foreach my $lang (@_) { |
47
|
0
|
|
|
|
|
|
$lang =~ s/\-/\_/; |
48
|
0
|
|
|
|
|
|
push(@return, $lang); |
49
|
0
|
0
|
|
|
|
|
if ($lang =~ /(.+)\_/) { |
50
|
0
|
|
|
|
|
|
push(@return, $1); |
51
|
|
|
|
|
|
|
} |
52
|
|
|
|
|
|
|
} |
53
|
0
|
|
|
|
|
|
return \@return; |
54
|
|
|
|
|
|
|
} |
55
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
1; |
57
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
__END__ |