line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Locale::CLDR::CalendarPreferences; |
2
|
|
|
|
|
|
|
# This file auto generated from Data.xml |
3
|
|
|
|
|
|
|
# on Fri 10 Jul 3:10:27 pm GMT |
4
|
|
|
|
|
|
|
# XML file generated 2015-02-25 23:47:56 -0600 (Wed, 25 Feb 2015) |
5
|
|
|
|
|
|
|
|
6
|
20
|
|
|
20
|
|
11939
|
use version; |
|
20
|
|
|
|
|
44
|
|
|
20
|
|
|
|
|
158
|
|
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
our $VERSION = version->declare('v0.27.2'); |
9
|
|
|
|
|
|
|
|
10
|
20
|
|
|
20
|
|
2355
|
use v5.10; |
|
20
|
|
|
|
|
67
|
|
|
20
|
|
|
|
|
911
|
|
11
|
20
|
|
|
20
|
|
107
|
use mro 'c3'; |
|
20
|
|
|
|
|
38
|
|
|
20
|
|
|
|
|
173
|
|
12
|
20
|
|
|
20
|
|
749
|
use utf8; |
|
20
|
|
|
|
|
39
|
|
|
20
|
|
|
|
|
151
|
|
13
|
20
|
|
|
20
|
|
690
|
use if $^V ge v5.12.0, feature => 'unicode_strings'; |
|
20
|
|
|
|
|
38
|
|
|
20
|
|
|
|
|
343
|
|
14
|
|
|
|
|
|
|
|
15
|
20
|
|
|
20
|
|
2440
|
use Moose::Role; |
|
20
|
|
|
|
|
50
|
|
|
20
|
|
|
|
|
187
|
|
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
has 'calendar_preferences' => ( |
18
|
|
|
|
|
|
|
is => 'ro', |
19
|
|
|
|
|
|
|
isa => 'HashRef', |
20
|
|
|
|
|
|
|
init_arg => undef, |
21
|
|
|
|
|
|
|
default => sub { { |
22
|
|
|
|
|
|
|
'001' => ['gregorian'], |
23
|
|
|
|
|
|
|
'DJ' => ['gregorian','islamic','islamic-civil','islamic-tbla'], |
24
|
|
|
|
|
|
|
'DZ' => ['gregorian','islamic','islamic-civil','islamic-tbla'], |
25
|
|
|
|
|
|
|
'EH' => ['gregorian','islamic','islamic-civil','islamic-tbla'], |
26
|
|
|
|
|
|
|
'ER' => ['gregorian','islamic','islamic-civil','islamic-tbla'], |
27
|
|
|
|
|
|
|
'IQ' => ['gregorian','islamic','islamic-civil','islamic-tbla'], |
28
|
|
|
|
|
|
|
'JO' => ['gregorian','islamic','islamic-civil','islamic-tbla'], |
29
|
|
|
|
|
|
|
'KM' => ['gregorian','islamic','islamic-civil','islamic-tbla'], |
30
|
|
|
|
|
|
|
'LB' => ['gregorian','islamic','islamic-civil','islamic-tbla'], |
31
|
|
|
|
|
|
|
'LY' => ['gregorian','islamic','islamic-civil','islamic-tbla'], |
32
|
|
|
|
|
|
|
'MA' => ['gregorian','islamic','islamic-civil','islamic-tbla'], |
33
|
|
|
|
|
|
|
'MR' => ['gregorian','islamic','islamic-civil','islamic-tbla'], |
34
|
|
|
|
|
|
|
'OM' => ['gregorian','islamic','islamic-civil','islamic-tbla'], |
35
|
|
|
|
|
|
|
'PS' => ['gregorian','islamic','islamic-civil','islamic-tbla'], |
36
|
|
|
|
|
|
|
'SD' => ['gregorian','islamic','islamic-civil','islamic-tbla'], |
37
|
|
|
|
|
|
|
'SY' => ['gregorian','islamic','islamic-civil','islamic-tbla'], |
38
|
|
|
|
|
|
|
'TD' => ['gregorian','islamic','islamic-civil','islamic-tbla'], |
39
|
|
|
|
|
|
|
'TN' => ['gregorian','islamic','islamic-civil','islamic-tbla'], |
40
|
|
|
|
|
|
|
'YE' => ['gregorian','islamic','islamic-civil','islamic-tbla'], |
41
|
|
|
|
|
|
|
'AE' => ['gregorian','islamic-umalqura','islamic','islamic-civil','islamic-tbla'], |
42
|
|
|
|
|
|
|
'BH' => ['gregorian','islamic-umalqura','islamic','islamic-civil','islamic-tbla'], |
43
|
|
|
|
|
|
|
'KW' => ['gregorian','islamic-umalqura','islamic','islamic-civil','islamic-tbla'], |
44
|
|
|
|
|
|
|
'QA' => ['gregorian','islamic-umalqura','islamic','islamic-civil','islamic-tbla'], |
45
|
|
|
|
|
|
|
'AF' => ['persian','gregorian','islamic','islamic-civil','islamic-tbla'], |
46
|
|
|
|
|
|
|
'IR' => ['persian','gregorian','islamic','islamic-civil','islamic-tbla'], |
47
|
|
|
|
|
|
|
'CN' => ['gregorian','chinese'], |
48
|
|
|
|
|
|
|
'CX' => ['gregorian','chinese'], |
49
|
|
|
|
|
|
|
'HK' => ['gregorian','chinese'], |
50
|
|
|
|
|
|
|
'MO' => ['gregorian','chinese'], |
51
|
|
|
|
|
|
|
'SG' => ['gregorian','chinese'], |
52
|
|
|
|
|
|
|
'EG' => ['gregorian','coptic','islamic','islamic-civil','islamic-tbla'], |
53
|
|
|
|
|
|
|
'ET' => ['gregorian','ethiopic'], |
54
|
|
|
|
|
|
|
'IL' => ['gregorian','hebrew','islamic','islamic-civil','islamic-tbla'], |
55
|
|
|
|
|
|
|
'IN' => ['gregorian','indian'], |
56
|
|
|
|
|
|
|
'JP' => ['gregorian','japanese'], |
57
|
|
|
|
|
|
|
'KR' => ['gregorian','dangi'], |
58
|
|
|
|
|
|
|
'SA' => ['gregorian','islamic-umalqura','islamic','islamic-rgsa'], |
59
|
|
|
|
|
|
|
'TH' => ['buddhist','gregorian'], |
60
|
|
|
|
|
|
|
'TW' => ['gregorian','roc','chinese'], |
61
|
|
|
|
|
|
|
}}, |
62
|
|
|
|
|
|
|
); |
63
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
has '_default_calendar' => ( |
65
|
|
|
|
|
|
|
is => 'ro', |
66
|
|
|
|
|
|
|
isa => 'HashRef', |
67
|
|
|
|
|
|
|
init_arg => undef, |
68
|
|
|
|
|
|
|
default => sub { { } }, |
69
|
|
|
|
|
|
|
traits => ['Hash'], |
70
|
|
|
|
|
|
|
handles => { |
71
|
|
|
|
|
|
|
_set_default_ca => 'set', |
72
|
|
|
|
|
|
|
_get_default_ca => 'get', |
73
|
|
|
|
|
|
|
_test_default_ca => 'exists', |
74
|
|
|
|
|
|
|
}, |
75
|
|
|
|
|
|
|
); |
76
|
|
|
|
|
|
|
|
77
|
|
|
|
|
|
|
sub default_calendar { |
78
|
68
|
|
|
68
|
0
|
89
|
my ($self, $territory) = @_; |
79
|
|
|
|
|
|
|
|
80
|
68
|
|
66
|
|
|
390
|
$territory //= ( $self->territory_id() || $self->likely_subtag->territory_id ); |
|
|
|
33
|
|
|
|
|
81
|
68
|
100
|
|
|
|
2437
|
if ($self->_test_default_ca($territory)) { |
82
|
66
|
|
|
|
|
2405
|
return $self->_get_default_ca($territory); |
83
|
|
|
|
|
|
|
} |
84
|
|
|
|
|
|
|
|
85
|
2
|
|
|
|
|
61
|
my $calendar_preferences = $self->calendar_preferences(); |
86
|
|
|
|
|
|
|
|
87
|
2
|
|
|
|
|
2
|
my $default; |
88
|
|
|
|
|
|
|
|
89
|
2
|
|
|
|
|
5
|
my $current_territory = $territory; |
90
|
|
|
|
|
|
|
|
91
|
2
|
|
|
|
|
6
|
while (! $default) { |
92
|
10
|
|
|
|
|
13
|
$default = $calendar_preferences->{$current_territory}; |
93
|
10
|
100
|
|
|
|
16
|
if ($default) { |
94
|
2
|
|
|
|
|
10
|
$default = $default->[0]; |
95
|
|
|
|
|
|
|
} |
96
|
|
|
|
|
|
|
else { |
97
|
8
|
|
|
|
|
244
|
$current_territory = $self->territory_contained_by()->{$current_territory} |
98
|
|
|
|
|
|
|
} |
99
|
|
|
|
|
|
|
} |
100
|
|
|
|
|
|
|
|
101
|
2
|
|
|
|
|
76
|
$self->_set_default_ca($territory => $default); |
102
|
|
|
|
|
|
|
|
103
|
2
|
|
|
|
|
7
|
return $default; |
104
|
|
|
|
|
|
|
} |
105
|
20
|
|
|
20
|
|
113644
|
no Moose::Role; |
|
20
|
|
|
|
|
49
|
|
|
20
|
|
|
|
|
121
|
|
106
|
|
|
|
|
|
|
|
107
|
|
|
|
|
|
|
1; |
108
|
|
|
|
|
|
|
|
109
|
|
|
|
|
|
|
# vim: tabstop=4 |