line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package File::Gettext::Schema; |
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
2028
|
use namespace::autoclean; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
10
|
|
4
|
|
|
|
|
|
|
|
5
|
1
|
|
|
1
|
|
82
|
use File::DataClass::Constants qw( FALSE LANG TRUE ); |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
58
|
|
6
|
1
|
|
|
1
|
|
4
|
use File::DataClass::Functions qw( is_hashref merge_attributes ); |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
45
|
|
7
|
1
|
|
|
1
|
|
5
|
use File::DataClass::Types qw( Directory Str ); |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
10
|
|
8
|
1
|
|
|
1
|
|
635
|
use File::Gettext::Constants qw( LOCALE_DIRS ); |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
46
|
|
9
|
1
|
|
|
1
|
|
457
|
use File::Gettext::ResultSource; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
34
|
|
10
|
1
|
|
|
1
|
|
631
|
use File::Gettext::Storage; |
|
1
|
|
|
|
|
4
|
|
|
1
|
|
|
|
|
37
|
|
11
|
1
|
|
|
1
|
|
6
|
use Scalar::Util qw( blessed ); |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
58
|
|
12
|
1
|
|
|
1
|
|
4
|
use Moo; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
4
|
|
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
extends q(File::DataClass::Schema); |
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
has 'gettext_catagory' => is => 'ro', isa => Str, default => 'LC_MESSAGES'; |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
has 'language' => is => 'rw', isa => Str, default => LANG; |
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
has 'localedir' => is => 'ro', isa => Directory, coerce => TRUE, |
21
|
|
|
|
|
|
|
default => sub { LOCALE_DIRS->[ 0 ] }; |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
has '+result_source_class' => default => 'File::Gettext::ResultSource'; |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
around 'BUILDARGS' => sub { |
26
|
|
|
|
|
|
|
my ($orig, $self, @args) = @_; my $attr = $orig->( $self, @args ); |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
# TODO: Deprecated |
29
|
|
|
|
|
|
|
my $lang = delete $attr->{lang}; $attr->{language} //= $lang; |
30
|
|
|
|
|
|
|
my $builder = $attr->{builder} or return $attr; |
31
|
|
|
|
|
|
|
my $config = $builder->can( 'config' ) ? $builder->config : {}; |
32
|
|
|
|
|
|
|
my $keys = [ qw( gettext_catagory language localedir ) ]; |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
merge_attributes $attr, $config, $keys; |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
return $attr; |
37
|
|
|
|
|
|
|
}; |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
sub BUILD { |
40
|
1
|
|
|
1
|
1
|
19214
|
my $self = shift; |
41
|
1
|
|
|
|
|
10
|
my $storage = $self->storage; |
42
|
1
|
|
|
|
|
19134
|
my $class = 'File::Gettext::Storage'; |
43
|
1
|
|
|
|
|
4
|
my $attr = { schema => $self, storage => $storage }; |
44
|
|
|
|
|
|
|
|
45
|
1
|
50
|
|
|
|
18
|
blessed $storage ne $class and $self->storage( $class->new( $attr ) ); |
46
|
|
|
|
|
|
|
|
47
|
1
|
|
|
|
|
1988
|
return; |
48
|
|
|
|
|
|
|
} |
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
1; |
51
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
__END__ |