4 |
use warnings; |
use warnings; |
5 |
use Carp; |
use Carp; |
6 |
|
|
7 |
sub test { |
sub populate { |
8 |
my $self = shift; |
my $self = shift; |
9 |
print STDERR ">>>$self<<<\n"; |
$self->{LANGTEXT}{da}{mastersthesis} ||= 'speciale'; |
10 |
return $self->{LNG}{test}; |
$self->{LANGTEXT}{da}{and} ||= 'og'; |
11 |
} |
$self->{LANGTEXT}{da}{comma} ||= ', '; |
12 |
|
$self->{LANGTEXT}{da}{fullstop} ||= '. '; |
13 |
sub and { |
$self->{LANGTEXT}{da}{in} ||= 'i'; |
14 |
return "og"; |
$self->{LANGTEXT}{da}{edition} ||= 'udgave'; |
15 |
} |
$self->{LANGTEXT}{da}{technicalreport} ||= 'teknisk rapport'; |
16 |
|
$self->{LANGTEXT}{da}{numberabbr} ||= 'nr.'; |
17 |
sub comma { |
$self->{LANGTEXT}{da}{chapter} ||= 'kapitel'; |
18 |
return ', '; |
$self->{LANGTEXT}{da}{phdthesis} ||= 'ph.d.-afhandling'; |
19 |
} |
$self->{LANGTEXT}{da}{volume} ||= 'bind'; |
20 |
|
$self->{LANGTEXT}{da}{of} ||= 'af'; |
21 |
sub fullstop { |
$self->{LANGTEXT}{da}{number} ||= 'nummer'; |
22 |
return '. '; |
|
23 |
} |
# The following are unique to da.pm: |
24 |
|
$self->{LANGTEXT}{da}{ordinal}{1} ||= 'første'; |
25 |
sub in { |
$self->{LANGTEXT}{da}{ordinal}{2} ||= 'anden'; |
26 |
my $self = shift; |
$self->{LANGTEXT}{da}{ordinal}{3} ||= 'tredie'; |
27 |
my $t = shift; |
$self->{LANGTEXT}{da}{ordinal}{4} ||= 'fjerde'; |
28 |
return 'i' . $self->nobreakspace . $t; |
$self->{LANGTEXT}{da}{ordinal}{5} ||= 'femte'; |
29 |
} |
$self->{LANGTEXT}{da}{ordinal}{6} ||= 'sjette'; |
30 |
|
$self->{LANGTEXT}{da}{ordinal}{7} ||= 'syvende'; |
31 |
sub edition { |
$self->{LANGTEXT}{da}{ordinal}{8} ||= 'ottende'; |
32 |
my $self = shift; |
$self->{LANGTEXT}{da}{ordinal}{9} ||= 'niende'; |
33 |
my $num = shift; |
$self->{LANGTEXT}{da}{ordinal}{10} ||= 'tiende'; |
34 |
return $self->ordinal($num) . ' udgave'; |
$self->{LANGTEXT}{da}{ordinal}{11} ||= 'ellevte'; |
35 |
} |
$self->{LANGTEXT}{da}{ordinal}{12} ||= 'tolvte'; |
36 |
|
$self->{LANGTEXT}{da}{ordinal}{13} ||= 'trettende'; |
37 |
sub technicalreport { |
$self->{LANGTEXT}{da}{ordinal}{14} ||= 'fjortende'; |
38 |
my $self = shift; |
$self->{LANGTEXT}{da}{ordinal}{15} ||= 'femtende'; |
39 |
my $num = shift; |
$self->{LANGTEXT}{da}{ordinal}{16} ||= 'sekstende'; |
40 |
my $t = 'teknisk rapport'; |
$self->{LANGTEXT}{da}{ordinal}{17} ||= 'syttende'; |
41 |
if ($num) { |
$self->{LANGTEXT}{da}{ordinal}{18} ||= 'attende'; |
42 |
$t .= ' nr.' . $self->nobreakspace . $num; |
$self->{LANGTEXT}{da}{ordinal}{19} ||= 'nittende'; |
43 |
} |
$self->{LANGTEXT}{da}{cardinaland}{0} ||= ''; |
44 |
return $t; |
$self->{LANGTEXT}{da}{cardinaland}{1} ||= 'enog'; |
45 |
} |
$self->{LANGTEXT}{da}{cardinaland}{2} ||= 'toog'; |
46 |
|
$self->{LANGTEXT}{da}{cardinaland}{3} ||= 'treog'; |
47 |
sub chapter { |
$self->{LANGTEXT}{da}{cardinaland}{4} ||= 'fireog'; |
48 |
my $self = shift; |
$self->{LANGTEXT}{da}{cardinaland}{5} ||= 'femog'; |
49 |
my ($ch) = @_; |
$self->{LANGTEXT}{da}{cardinaland}{6} ||= 'seksog'; |
50 |
|
$self->{LANGTEXT}{da}{cardinaland}{7} ||= 'syvog'; |
51 |
return 'kapitel' . $self->nobreakspace . $ch; |
$self->{LANGTEXT}{da}{cardinaland}{8} ||= 'otteog'; |
52 |
} |
$self->{LANGTEXT}{da}{cardinaland}{9} ||= 'niog'; |
53 |
|
$self->{LANGTEXT}{da}{ordinal}{20} ||= 'tyvende'; |
54 |
|
$self->{LANGTEXT}{da}{ordinal}{30} ||= 'tredivte'; |
55 |
|
$self->{LANGTEXT}{da}{ordinal}{40} ||= 'fyrretyvende'; |
56 |
|
$self->{LANGTEXT}{da}{ordinal}{50} ||= 'halvtredsindstyvende'; |
57 |
|
$self->{LANGTEXT}{da}{ordinal}{60} ||= 'tresindstyvende'; |
58 |
|
$self->{LANGTEXT}{da}{ordinal}{70} ||= 'halvfjerdsindstyvende'; |
59 |
|
$self->{LANGTEXT}{da}{ordinal}{80} ||= 'firsindstyvende'; |
60 |
|
$self->{LANGTEXT}{da}{ordinal}{90} ||= 'halvfemsindstyvende'; |
61 |
|
|
62 |
sub phdthesis { |
$self->{LANGINIT}{da} = 1; |
|
return 'ph.d.-afhandling'; |
|
|
} |
|
|
|
|
|
sub mastersthesis { |
|
|
return 'speciale'; |
|
|
} |
|
|
|
|
|
sub volume { |
|
|
my $self = shift; |
|
|
my $vol = shift; |
|
|
my $series = shift; |
|
|
if (!$series) { |
|
|
return 'bind' . $self->nobreakspace . $vol; |
|
|
} else { |
|
|
return 'bind' . $self->nobreakspace . $vol . ' af' |
|
|
. $self->nobreakspace . $series; |
|
|
} |
|
|
} |
|
|
|
|
|
sub numberseries { |
|
|
my $self = shift; |
|
|
my ($number, $series) = @_; |
|
|
|
|
|
my $t = 'nummer' . $self->nobreakspace . $number; |
|
|
if ($series) { |
|
|
$t .= ' i' . $self->nobreakspace .$series; |
|
|
} |
|
|
return $t; |
|
63 |
} |
} |
64 |
|
|
65 |
sub ordinal { |
sub ordinal { |
76 |
} |
} |
77 |
|
|
78 |
if ($number < 20) { |
if ($number < 20) { |
79 |
return qw(første anden tredie fjerde femte |
return $self->{LANGTEXT}{da}{ordinal}{$number}; |
|
sjette syvende ottende niende tiende |
|
|
ellevte tolvte trettende fjortende femtende |
|
|
sekstende syttende attende nittende)[$number - 1]; |
|
80 |
} elsif ($number < 100) { |
} elsif ($number < 100) { |
81 |
my ($ten, $one) = (int($number / 10), $number % 10); |
my ($ten, $one) = (10*int($number / 10), $number % 10); |
82 |
my $res; |
my $res; |
83 |
$res = ('', 'enog', 'toog', 'treog', 'fireog', 'femog', |
$res = $self->{LANGTEXT}{da}{cardinaland}{$one}; |
84 |
'seksog', 'syvog', 'otteog', 'niog')[$one]; |
return $res . $self->{LANGTEXT}{da}{ordinal}{$ten}; |
|
$ten -= 2; |
|
|
return $res . qw(tyvende tredivte fyrretyvende halvtredsindstyvende |
|
|
tresindstyvende halvfjerdsindstyvende firsindstyvende |
|
|
halvfemsindstyvende)[$ten]; |
|
85 |
} else { |
} else { |
86 |
warn "I don't know how to say $number"."th in Danish"; |
warn "I don't know how to say $number"."th in Danish"; |
87 |
return $number . '.'; |
return $number . '.'; |
88 |
} |
} |
89 |
} |
} |
90 |
|
|
|
|
|
|
|
|
|
############# |
|
|
|
|
|
# sub yearonly { |
|
|
# my ($year) = @_; |
|
|
# return $year; |
|
|
# } |
|
|
|
|
|
# sub ibid { |
|
|
# return 'ibid.'; |
|
|
# } |
|
|
|
|
|
# sub etal { |
|
|
# return 'et al.'; |
|
|
# } |
|
|
|
|
|
# sub editors { |
|
|
# return 'redaktører' ;#!abbr_ed; |
|
|
# } |
|
|
|
|
|
# sub edby { |
|
|
# return 'redigeret af'; |
|
|
# } |
|
|
|
|
|
# sub edition { |
|
|
# return 'udgave'; #!abbr_wd; |
|
|
# } |
|
|
|
|
|
|
|
|
# sub volume { |
|
|
# return 'bd.;abbr_wd'; |
|
|
# } |
|
|
|
|
|
# sub of { # as in 'volume three OF five' |
|
|
# return 'af'; |
|
|
# } |
|
|
|
|
|
# sub number { |
|
|
# return 'nummer'; #!abbr_wd'; |
|
|
# } |
|
|
|
|
|
# sub in { |
|
|
# return 'i'; |
|
|
# } |
|
|
|
|
|
# #sub pages |
|
|
# sub page { |
|
|
# return 'side' #;!abbr_pp'; |
|
|
# } |
|
|
|
|
|
# sub eidpp { |
|
|
# return 'sider'; |
|
|
# } |
|
|
|
|
|
# sub chapter { |
|
|
# return 'kapitel'; #;!abbr_wd'; |
|
|
# } |
|
|
|
|
|
# sub techrep { |
|
|
# return 'Teknisk rapport'; #!abbr_wd'; |
|
|
# } |
|
|
|
|
|
# sub techrep2 { |
|
|
# return 'Tekn. rap.'; #abbr_wd'; |
|
|
# } |
|
|
|
|
|
# sub mthesis { |
|
|
# return 'Speciale'; |
|
|
# } |
|
|
|
|
|
# sub phdthesis { |
|
|
# return 'ph.d.-afhandling'; |
|
|
# } |
|
|
|
|
|
# sub month { |
|
|
# my ($month) = @_; |
|
|
# return qw(januar februar marts april maj juni |
|
|
# juli august september oktober november december)[$month - 1]; |
|
|
# } |
|
|
|
|
|
|
|
91 |
1; |
1; |
92 |
__END__ |
__END__ |
93 |
|
|
95 |
|
|
96 |
Bibulus::Lang::da - Bibulus support for Danish |
Bibulus::Lang::da - Bibulus support for Danish |
97 |
|
|
|
=head1 SYNOPSIS |
|
|
|
|
|
Bibulus::Lang::da - Bibulus support for Danish |
|
|
|
|
|
=head1 DESCRIPTION |
|
|
|
|
|
use Bibulus::Lang; |
|
|
my $lang = new Bibulus::Lang; |
|
|
$lang->lang('da'); # sets language to Danish |
|
|
print $lang->mastersthesis; # returns 'speciale' |
|
|
|
|
98 |
=head2 EXPORT |
=head2 EXPORT |
99 |
|
|
100 |
None. |
None. |
101 |
|
|
102 |
=head1 SEE ALSO |
=head1 SEE ALSO |
103 |
|
|
104 |
F<Bibulus::Lang>. |
F<Bibulus>, F<Bibulus::lang>. |
105 |
|
|
106 |
The homepage is |
The homepage is |
107 |
L<http://www.nongnu.org/bibulus/>. |
L<http://www.nongnu.org/bibulus/>. |