Debian Codegraph @

lib/Date/Language/Turkish.pm

raw
1 #----------------------------------------------------#
2 #
3 # Turkish tables
4 # Burak Gürsoy <[email protected]>
5 # Last modified: Sat Nov 15 20:28:32 2003
6 #
7 # use Date::Language;
8 # my $turkish = Date::Language->new('Turkish');
9 # print $turkish->time2str("%e %b %Y, %a %T\n", time);
10 # print $turkish->str2time("25 Haz 1996 21:09:55 +0100");
11 #----------------------------------------------------#
12
13 package Date::Language::Turkish;
14
15 use strict;
16 use warnings;
17 use utf8;
18 use base 'Date::Language';
19
20 our $VERSION = '2.35'; # VERSION: generated
21 # ABSTRACT: Turkish localization for Date::Format
22
23 our @DoW = qw(Pazar Pazartesi Salı Çarşamba Perşembe Cuma Cumartesi);
24 our @MoY = qw(Ocak Şubat Mart Nisan Mayıs Haziran Temmuz Ağustos Eylül Ekim Kasım Aralık);
25 our @DoWs = map { substr($_,0,3) } @DoW;
26 $DoWs[1] = 'Pzt'; # Since we'll get two 'Paz' s
27 $DoWs[-1] = 'Cmt'; # Since we'll get two 'Cum' s
28 our @MoYs = map { substr($_,0,3) } @MoY;
29 our @AMPM = ('',''); # no am-pm thingy
30
31 # not easy as in english... maybe we can just use a dot "." ? :)
32 our %DsufMAP = (
33 (map {$_ => 'inci', $_+10 => 'inci', $_+20 => 'inci' } 1,2,5,8 ),
34 (map {$_ => 'nci', $_+10 => 'nci', $_+20 => 'nci' } 7 ),
35 (map {$_ => 'nci', $_+10 => 'nci', $_+20 => 'nci' } 2 ),
36 (map {$_ => 'üncü', $_+10 => 'üncü', $_+20 => 'üncü' } 3,4 ),
37 (map {$_ => 'uncu', $_+10 => 'uncu', $_+20 => 'uncu' } 9 ),
38 (map {$_ => 'ncı', $_+10 => 'ncı', $_+20 => 'ncı' } 6 ),
39 (map {$_ => 'uncu', } 10,30 ),
40 20 => 'nci',
41 31 => 'inci',
42 );
43
44 our @Dsuf = map{ $DsufMAP{$_} } sort {$a <=> $b} keys %DsufMAP;
45
46 our ( %MoY, %DoW );
47 Date::Language::_build_lookups();
48
49 # Formatting routines
50
51 sub format_a { $DoWs[$_[0]->[6]] }
52 sub format_A { $DoW[ $_[0]->[6]] }
53 sub format_b { $MoYs[$_[0]->[4]] }
54 sub format_B { $MoY[ $_[0]->[4]] }
55 sub format_h { $MoYs[$_[0]->[4]] }
56 sub format_p { '' } # disable
57 sub format_P { '' } # disable
58 sub format_o { sprintf("%2d%s",$_[0]->[3],$Dsuf[$_[0]->[3]-1]) }
59
60 1;
61
62 __END__
63
64 =pod
65
66 =encoding UTF-8
67
68 =head1 NAME
69
70 Date::Language::Turkish - Turkish localization for Date::Format
71
72 =head1 VERSION
73
74 version 2.35
75
76 =head1 AUTHOR
77
78 Graham <[email protected]>
79
80 =head1 COPYRIGHT AND LICENSE
81
82 This software is copyright (c) 2020 by Graham Barr.
83
84 This is free software; you can redistribute it and/or modify it under
85 the same terms as the Perl 5 programming language system itself.
86
87 =cut