line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package HTML::Tag::Lang; |
2
|
3
|
|
|
3
|
|
622
|
use strict; |
|
3
|
|
|
|
|
5
|
|
|
3
|
|
|
|
|
106
|
|
3
|
3
|
|
|
3
|
|
16
|
use warnings; |
|
3
|
|
|
|
|
3
|
|
|
3
|
|
|
|
|
137
|
|
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
our $VERSION = '1.00'; |
7
|
|
|
|
|
|
|
|
8
|
3
|
|
|
3
|
|
15
|
use base qw(Exporter); |
|
3
|
|
|
|
|
7
|
|
|
3
|
|
|
|
|
1472
|
|
9
|
|
|
|
|
|
|
our (@EXPORT_OK, %bool_descr,@month); |
10
|
|
|
|
|
|
|
@EXPORT_OK = qw(%bool_descr @month); |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
our $language = ''; |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
BEGIN { |
15
|
3
|
|
|
3
|
|
11
|
my @installed_langs = qw(it en); |
16
|
|
|
|
|
|
|
sub language { |
17
|
3
|
|
|
3
|
0
|
4
|
my $LC_MESSAGES = $language; |
18
|
3
|
50
|
|
|
|
23
|
if (! $LC_MESSAGES) { |
19
|
3
|
|
|
|
|
7
|
foreach (@installed_langs) { |
20
|
6
|
100
|
|
|
|
49
|
$LC_MESSAGES = $_ if(exists $INC{"HTML/Tag/Lang/$_.pm"}); |
21
|
|
|
|
|
|
|
} |
22
|
|
|
|
|
|
|
} |
23
|
3
|
50
|
|
|
|
14
|
if (! $LC_MESSAGES) { |
24
|
0
|
0
|
|
|
|
0
|
if (exists $ENV{'LC_MESSAGES'}) { |
|
|
0
|
|
|
|
|
|
25
|
0
|
|
|
|
|
0
|
$LC_MESSAGES=substr($ENV{'LC_MESSAGES'},0,2); |
26
|
|
|
|
|
|
|
} elsif (exists $ENV{'LANG'}) { |
27
|
0
|
|
|
|
|
0
|
$LC_MESSAGES=substr($ENV{'LANG'},0,2); |
28
|
|
|
|
|
|
|
} else { |
29
|
0
|
|
|
|
|
0
|
$LC_MESSAGES='en'; |
30
|
|
|
|
|
|
|
} |
31
|
|
|
|
|
|
|
} |
32
|
3
|
50
|
|
|
|
9
|
$LC_MESSAGES='en' unless ($LC_MESSAGES); |
33
|
3
|
|
|
|
|
13
|
return lc($LC_MESSAGES); |
34
|
|
|
|
|
|
|
} |
35
|
|
|
|
|
|
|
|
36
|
3
|
|
|
|
|
10
|
my $pkg = __PACKAGE__ . '::' . &language; |
37
|
3
|
|
|
|
|
339
|
eval "require $pkg"; |
38
|
3
|
50
|
|
|
|
18
|
if ($@) { |
39
|
|
|
|
|
|
|
# try to switch to english language |
40
|
0
|
|
|
|
|
0
|
$pkg = __PACKAGE__ . '::en'; |
41
|
0
|
|
|
|
|
0
|
eval "require $pkg"; |
42
|
0
|
0
|
|
|
|
0
|
if ($@) { |
43
|
0
|
|
|
|
|
0
|
die "Error from requiring $pkg: $@"; |
44
|
|
|
|
|
|
|
} |
45
|
|
|
|
|
|
|
} |
46
|
3
|
|
|
|
|
485
|
eval "import $pkg qw(\%bool_descr \@month)"; |
47
|
3
|
50
|
|
|
|
264
|
if ($@) { |
48
|
0
|
|
|
|
|
0
|
die "Error importing from $pkg: $@"; |
49
|
|
|
|
|
|
|
} |
50
|
|
|
|
|
|
|
} |
51
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
1; |
53
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
# vim: set ts=2: |