line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Locale::TextDomain::OO::Plugin::Expand::BabelFish::Loc; ## no critic (TidyCode)
|
2
|
|
|
|
|
|
|
|
3
|
2
|
|
|
2
|
|
5418
|
use strict;
|
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
63
|
|
4
|
2
|
|
|
2
|
|
11
|
use warnings;
|
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
53
|
|
5
|
2
|
|
|
2
|
|
916
|
use Locale::Utils::PlaceholderBabelFish;
|
|
2
|
|
|
|
|
30237
|
|
|
2
|
|
|
|
|
63
|
|
6
|
2
|
|
|
2
|
|
14
|
use Moo::Role;
|
|
2
|
|
|
|
|
5
|
|
|
2
|
|
|
|
|
10
|
|
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
our $VERSION = '1.027';
|
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
requires qw(
|
11
|
|
|
|
|
|
|
translate
|
12
|
|
|
|
|
|
|
filter
|
13
|
|
|
|
|
|
|
run_filter
|
14
|
|
|
|
|
|
|
);
|
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
has expand_babel_fish_loc => (
|
17
|
|
|
|
|
|
|
is => 'rw',
|
18
|
|
|
|
|
|
|
default => sub {
|
19
|
|
|
|
|
|
|
return Locale::Utils::PlaceholderBabelFish->new;
|
20
|
|
|
|
|
|
|
},
|
21
|
|
|
|
|
|
|
);
|
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
sub loc_b {
|
24
|
4
|
|
|
4
|
1
|
2243
|
my ($self, $msgid, @args) = @_;
|
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
my $translation = $self->translate(
|
27
|
|
|
|
|
|
|
undef,
|
28
|
|
|
|
|
|
|
$msgid,
|
29
|
|
|
|
|
|
|
undef,
|
30
|
|
|
|
|
|
|
undef,
|
31
|
|
|
|
|
|
|
undef,
|
32
|
4
|
|
|
4
|
|
86
|
sub { $self->expand_babel_fish_loc->plural_code(shift) },
|
33
|
4
|
|
|
|
|
25
|
);
|
34
|
|
|
|
|
|
|
@args and $translation = $self->expand_babel_fish_loc->expand_babel_fish(
|
35
|
|
|
|
|
|
|
$translation,
|
36
|
|
|
|
|
|
|
@args == 1
|
37
|
4
|
100
|
|
|
|
32
|
? ( ref $args[0] eq 'HASH' ? %{ $args[0] } : $args[0] )
|
|
2
|
100
|
|
|
|
11
|
|
|
|
50
|
|
|
|
|
|
38
|
|
|
|
|
|
|
: @args,
|
39
|
|
|
|
|
|
|
);
|
40
|
4
|
50
|
|
|
|
449
|
$self->filter
|
41
|
|
|
|
|
|
|
and $self->run_filter(\$translation);
|
42
|
|
|
|
|
|
|
|
43
|
4
|
|
|
|
|
77
|
return $translation;
|
44
|
|
|
|
|
|
|
}
|
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
sub loc_bp {
|
47
|
0
|
|
|
0
|
1
|
|
my ($self, $msgctxt, $msgid, @args) = @_;
|
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
my $translation = $self->translate(
|
50
|
|
|
|
|
|
|
$msgctxt,
|
51
|
|
|
|
|
|
|
$msgid,
|
52
|
|
|
|
|
|
|
undef,
|
53
|
|
|
|
|
|
|
undef,
|
54
|
|
|
|
|
|
|
undef,
|
55
|
0
|
|
|
0
|
|
|
sub { $self->expand_babel_fish_loc->plural_code(shift) },
|
56
|
0
|
|
|
|
|
|
);
|
57
|
|
|
|
|
|
|
@args and $translation = $self->expand_babel_fish_loc->expand_babel_fish(
|
58
|
|
|
|
|
|
|
$translation,
|
59
|
|
|
|
|
|
|
@args == 1
|
60
|
0
|
0
|
|
|
|
|
? ( ref $args[0] eq 'HASH' ? %{ $args[0] } : $args[0] )
|
|
0
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
61
|
|
|
|
|
|
|
: @args,
|
62
|
|
|
|
|
|
|
);
|
63
|
0
|
0
|
|
|
|
|
$self->filter
|
64
|
|
|
|
|
|
|
and $self->run_filter(\$translation);
|
65
|
|
|
|
|
|
|
|
66
|
0
|
|
|
|
|
|
return $translation;
|
67
|
|
|
|
|
|
|
}
|
68
|
|
|
|
|
|
|
|
69
|
|
|
|
|
|
|
BEGIN {
|
70
|
|
|
|
|
|
|
# Dummy methods for string marking.
|
71
|
|
|
|
|
|
|
my $dummy = sub {
|
72
|
0
|
|
|
0
|
|
0
|
my (undef, @more) = @_;
|
73
|
0
|
0
|
|
|
|
0
|
return wantarray ? @more : $more[0];
|
74
|
2
|
|
|
2
|
|
11
|
};
|
75
|
2
|
|
|
2
|
|
1535
|
no warnings qw(redefine); ## no critic (NoWarnings)
|
|
2
|
|
|
|
|
6
|
|
|
2
|
|
|
|
|
102
|
|
76
|
2
|
|
|
|
|
6
|
*Nloc_b = $dummy;
|
77
|
2
|
|
|
|
|
59
|
*Nloc_bp = $dummy;
|
78
|
|
|
|
|
|
|
}
|
79
|
|
|
|
|
|
|
|
80
|
|
|
|
|
|
|
1;
|
81
|
|
|
|
|
|
|
|
82
|
|
|
|
|
|
|
__END__
|