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