line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package DDG::Language; |
2
|
|
|
|
|
|
|
our $AUTHORITY = 'cpan:DDG'; |
3
|
|
|
|
|
|
|
# ABSTRACT: A language, can be empty [TODO] |
4
|
|
|
|
|
|
|
$DDG::Language::VERSION = '1017'; |
5
|
12
|
|
|
12
|
|
68
|
use Moo; |
|
12
|
|
|
|
|
23
|
|
|
12
|
|
|
|
|
60
|
|
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
my @language_attributes = qw( |
8
|
|
|
|
|
|
|
flagicon |
9
|
|
|
|
|
|
|
flag_url |
10
|
|
|
|
|
|
|
name_in_local |
11
|
|
|
|
|
|
|
rtl |
12
|
|
|
|
|
|
|
locale |
13
|
|
|
|
|
|
|
nplurals |
14
|
|
|
|
|
|
|
name_in_english |
15
|
|
|
|
|
|
|
); |
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
# 'en_US' => { |
18
|
|
|
|
|
|
|
# 'flagicon' => 'us', |
19
|
|
|
|
|
|
|
# 'flag_url' => 'https://duckduckgo.com/f2/us.png', |
20
|
|
|
|
|
|
|
# 'name_in_local' => 'English of United States', |
21
|
|
|
|
|
|
|
# -'translation_count' => 24, |
22
|
|
|
|
|
|
|
# -'percent' => '24', |
23
|
|
|
|
|
|
|
# 'rtl' => 0, |
24
|
|
|
|
|
|
|
# 'locale' => 'en_US', |
25
|
|
|
|
|
|
|
# 'nplurals' => 2, |
26
|
|
|
|
|
|
|
# 'name_in_english' => 'English of United States' |
27
|
|
|
|
|
|
|
# }, |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
has $_ => ( |
30
|
|
|
|
|
|
|
is => 'ro', |
31
|
|
|
|
|
|
|
default => sub { '' } |
32
|
|
|
|
|
|
|
) for (@language_attributes); |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
use overload '""' => sub { |
35
|
0
|
|
|
0
|
|
|
my $self = shift; |
36
|
0
|
|
|
|
|
|
return $self->locale; |
37
|
12
|
|
|
12
|
|
4044
|
}, fallback => 1; |
|
12
|
|
|
|
|
29
|
|
|
12
|
|
|
|
|
90
|
|
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
1; |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
__END__ |