Debian Codegraph @

lib/Date/Language/Bulgarian.pm

raw
1 ##
2 ## Bulgarian tables contributed by Krasimir Berov
3 ##
4
5 package Date::Language::Bulgarian;
6
7 use strict;
8 use warnings;
9 use utf8;
10
11 use base qw(Date::Language);
12
13 our (@DoW, @DoWs, @MoY, @MoYs, @AMPM, @Dsuf, %MoY, %DoW);
14
15 our $VERSION = '2.35'; # VERSION: generated
16 # ABSTRACT: Bulgarian localization for Date::Format
17
18 @DoW = qw(неделя понеделник вторник сряда четвъртък петък събота);
19 @MoY = qw(януари февруари март април май юни
20 юли август септември октомври ноември декември);
21 @DoWs = qw(нд пн вт ср чт пт сб);
22 @MoYs = map { substr($_,0,3) } @MoY;
23 @AMPM = qw(AM PM);
24
25 @Dsuf = (qw(ти ви ри ти ти ти ти ми ми ти)) x 3;
26 @Dsuf[11,12,13] = qw(ти ти ти);
27 @Dsuf[30,31] = qw(ти ви);
28
29 Date::Language::_build_lookups();
30
31 # Formatting routines
32
33 sub format_a { $DoWs[$_[0]->[6]] }
34 sub format_A { $DoW[$_[0]->[6]] }
35 sub format_b { $MoYs[$_[0]->[4]] }
36 sub format_B { $MoY[$_[0]->[4]] }
37 sub format_h { $MoYs[$_[0]->[4]] }
38 sub format_p { $_[0]->[2] >= 12 ? $AMPM[1] : $AMPM[0] }
39 sub format_o { ($_[0]->[3]<10?' ':'').$_[0]->[3].$Dsuf[$_[0]->[3]] }
40
41 1;
42
43 __END__
44
45 =pod
46
47 =encoding UTF-8
48
49 =head1 NAME
50
51 Date::Language::Bulgarian - Bulgarian localization for Date::Format
52
53 =head1 VERSION
54
55 version 2.35
56
57 =head1 SYNOPSIS
58
59 use strict;
60 use warnings;
61 use Date::Language;
62 local $\=$/;
63 my $template ='%a %b %e %T %Y (%Y-%m-%d %H:%M:%S)';
64 my $time=1290883821; #or just use time();
65 my @lt = localtime($time);
66 my %languages = qw(English GMT German EEST Bulgarian EET);
67 binmode(select,':utf8');
68
69 foreach my $l(keys %languages){
70 my $lang = Date::Language->new($l);
71 my $zone = $languages{$l};
72 print $/. "$l $zone";
73 print $lang->time2str($template, $time);
74 print $lang->time2str($template, $time, $zone);
75
76 print $lang->strftime($template, \@lt);
77 }
78
79 =head1 DESCRIPTION
80
81 This is Bulgarian localization for Date::Format.
82 It is important to note that this module source code is in utf8.
83 All strings which it outputs are in utf8, so it is safe to use it
84 currently only with English. You are left alone to try and convert
85 the output when using different Date::Language::* in the same application.
86 This should be addresed in the future.
87
88 =head1 NAME
89
90 Date::Language::Bulgarian - localization for Date::Format
91
92 =head1 AUTHOR
93
94 Krasimir Berov ([email protected])
95
96 =head1 COPYRIGHT
97
98 Copyright (c) 2010 Krasimir Berov. This program is free
99 software; you can redistribute it and/or modify it under the same terms
100 as Perl itself.
101
102 =head1 AUTHOR
103
104 Graham <[email protected]>
105
106 =head1 COPYRIGHT AND LICENSE
107
108 This software is copyright (c) 2020 by Graham Barr.
109
110 This is free software; you can redistribute it and/or modify it under
111 the same terms as the Perl 5 programming language system itself.
112
113 =cut