line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
# Copyright (C) 2017 Koha-Suomi |
2
|
|
|
|
|
|
|
# |
3
|
|
|
|
|
|
|
# This file is part of Pootle-Client. |
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
package Pootle::Resource::Language; |
6
|
|
|
|
|
|
|
|
7
|
1
|
|
|
1
|
|
67323
|
use Modern::Perl '2015'; |
|
1
|
|
|
|
|
10
|
|
|
1
|
|
|
|
|
7
|
|
8
|
1
|
|
|
1
|
|
130
|
use utf8; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
6
|
|
9
|
|
|
|
|
|
|
binmode STDOUT, ':encoding(UTF-8)'; |
10
|
|
|
|
|
|
|
binmode STDERR, ':encoding(UTF-8)'; |
11
|
1
|
|
|
1
|
|
33
|
use feature 'signatures'; no warnings "experimental::signatures"; |
|
1
|
|
|
1
|
|
2
|
|
|
1
|
|
|
|
|
22
|
|
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
35
|
|
12
|
1
|
|
|
1
|
|
4
|
use Carp::Always; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
18
|
|
13
|
1
|
|
|
1
|
|
4
|
use Try::Tiny; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
47
|
|
14
|
1
|
|
|
1
|
|
4
|
use Scalar::Util qw(blessed); |
|
1
|
|
|
|
|
5
|
|
|
1
|
|
|
|
|
40
|
|
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
=head2 Pootle::Resource::Language |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
Pootle Language-object |
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
=cut |
21
|
|
|
|
|
|
|
|
22
|
1
|
|
|
1
|
|
4
|
use base('Pootle::Resource'); |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
303
|
|
23
|
|
|
|
|
|
|
|
24
|
1
|
|
|
1
|
|
283
|
use Params::Validate qw(:all); |
|
1
|
|
|
|
|
4449
|
|
|
1
|
|
|
|
|
167
|
|
25
|
|
|
|
|
|
|
|
26
|
1
|
|
|
1
|
|
296
|
use Pootle::Logger; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
7
|
|
27
|
|
|
|
|
|
|
my $l = bless({}, 'Pootle::Logger'); #Lazy load package logger this way to avoid circular dependency issues with logger includes from many packages |
28
|
|
|
|
|
|
|
|
29
|
0
|
|
|
0
|
0
|
|
sub new($class, @params) { |
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
30
|
0
|
0
|
|
|
|
|
$l->debug("Initializing ".__PACKAGE__." with parameters: ".$l->flatten(@params)) if $l->is_debug(); |
31
|
0
|
|
|
|
|
|
my %self = validate(@params, { |
32
|
|
|
|
|
|
|
code => 1, |
33
|
|
|
|
|
|
|
description => 1, |
34
|
|
|
|
|
|
|
fullname => 1, |
35
|
|
|
|
|
|
|
nplurals => 1, |
36
|
|
|
|
|
|
|
pluralequation => 1, |
37
|
|
|
|
|
|
|
resource_uri => 1, |
38
|
|
|
|
|
|
|
specialchars => 1, |
39
|
|
|
|
|
|
|
translation_projects => { type => ARRAYREF }, |
40
|
|
|
|
|
|
|
}); |
41
|
0
|
|
|
|
|
|
my $s = bless(\%self, $class); |
42
|
|
|
|
|
|
|
|
43
|
0
|
|
|
|
|
|
return $s; |
44
|
|
|
|
|
|
|
} |
45
|
|
|
|
|
|
|
|
46
|
0
|
|
|
0
|
1
|
|
sub code($s) { return $s->{code} } |
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
47
|
0
|
|
|
0
|
1
|
|
sub description($s) { return $s->{description} } |
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
48
|
0
|
|
|
0
|
1
|
|
sub fullname($s) { return $s->{fullname} } |
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
49
|
0
|
|
|
0
|
1
|
|
sub nplurals($s) { return $s->{nplurals} } |
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
50
|
0
|
|
|
0
|
1
|
|
sub pluralequation($s) { return $s->{pluralequation} } |
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
51
|
0
|
|
|
0
|
1
|
|
sub resource_uri($s) { return $s->{resource_uri} } |
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
52
|
0
|
|
|
0
|
1
|
|
sub specialchars($s) { return $s->{specialchars} } |
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
53
|
0
|
|
|
0
|
1
|
|
sub translation_projects($s) { return $s->{translation_projects} } |
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
=head2 Accessors |
56
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
=over 4 |
58
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
=item B |
60
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
=item B |
62
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
=item B |
64
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
=item B |
66
|
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
=item B |
68
|
|
|
|
|
|
|
|
69
|
|
|
|
|
|
|
=item B |
70
|
|
|
|
|
|
|
|
71
|
|
|
|
|
|
|
=item B |
72
|
|
|
|
|
|
|
|
73
|
|
|
|
|
|
|
=item B |
74
|
|
|
|
|
|
|
|
75
|
|
|
|
|
|
|
=cut |
76
|
|
|
|
|
|
|
|
77
|
|
|
|
|
|
|
1; |