line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
#! /bin/false |
2
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
# vim: set autoindent shiftwidth=4 tabstop=4: |
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
# Pure Perl implementation of Uniforum message translation. |
6
|
|
|
|
|
|
|
# Copyright (C) 2002-2017 Guido Flohr , |
7
|
|
|
|
|
|
|
# all rights reserved. |
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
# This program is free software: you can redistribute it and/or modify |
10
|
|
|
|
|
|
|
# it under the terms of the GNU General Public License as published by |
11
|
|
|
|
|
|
|
# the Free Software Foundation; either version 3 of the License, or |
12
|
|
|
|
|
|
|
# (at your option) any later version. |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
# This program is distributed in the hope that it will be useful, |
15
|
|
|
|
|
|
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of |
16
|
|
|
|
|
|
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
17
|
|
|
|
|
|
|
# GNU General Public License for more details. |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
# You should have received a copy of the GNU General Public License |
20
|
|
|
|
|
|
|
# along with this program. If not, see . |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
package Locale::gettext_dumb; |
23
|
|
|
|
|
|
|
|
24
|
1
|
|
|
1
|
|
7
|
use Locale::gettext_pp; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
49
|
|
25
|
|
|
|
|
|
|
|
26
|
1
|
|
|
1
|
|
5
|
use vars qw (%EXPORT_TAGS @EXPORT_OK @ISA $VERSION); |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
1012
|
|
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
%EXPORT_TAGS = (locale_h => [ qw (gettext |
29
|
|
|
|
|
|
|
dgettext |
30
|
|
|
|
|
|
|
dcgettext |
31
|
|
|
|
|
|
|
ngettext |
32
|
|
|
|
|
|
|
dngettext |
33
|
|
|
|
|
|
|
dcngettext |
34
|
|
|
|
|
|
|
pgettext |
35
|
|
|
|
|
|
|
dpgettext |
36
|
|
|
|
|
|
|
dcpgettext |
37
|
|
|
|
|
|
|
npgettext |
38
|
|
|
|
|
|
|
dnpgettext |
39
|
|
|
|
|
|
|
dcnpgettext |
40
|
|
|
|
|
|
|
textdomain |
41
|
|
|
|
|
|
|
bindtextdomain |
42
|
|
|
|
|
|
|
bind_textdomain_codeset |
43
|
|
|
|
|
|
|
)], |
44
|
|
|
|
|
|
|
libintl_h => [ qw (LC_CTYPE |
45
|
|
|
|
|
|
|
LC_NUMERIC |
46
|
|
|
|
|
|
|
LC_TIME |
47
|
|
|
|
|
|
|
LC_COLLATE |
48
|
|
|
|
|
|
|
LC_MONETARY |
49
|
|
|
|
|
|
|
LC_MESSAGES |
50
|
|
|
|
|
|
|
LC_ALL)], |
51
|
|
|
|
|
|
|
); |
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
@EXPORT_OK = qw (gettext |
54
|
|
|
|
|
|
|
dgettext |
55
|
|
|
|
|
|
|
dcgettext |
56
|
|
|
|
|
|
|
ngettext |
57
|
|
|
|
|
|
|
dngettext |
58
|
|
|
|
|
|
|
dcngettext |
59
|
|
|
|
|
|
|
pgettext |
60
|
|
|
|
|
|
|
dpgettext |
61
|
|
|
|
|
|
|
dcpgettext |
62
|
|
|
|
|
|
|
npgettext |
63
|
|
|
|
|
|
|
dnpgettext |
64
|
|
|
|
|
|
|
dcnpgettext |
65
|
|
|
|
|
|
|
textdomain |
66
|
|
|
|
|
|
|
bindtextdomain |
67
|
|
|
|
|
|
|
bind_textdomain_codeset |
68
|
|
|
|
|
|
|
nl_putenv |
69
|
|
|
|
|
|
|
setlocale |
70
|
|
|
|
|
|
|
LC_CTYPE |
71
|
|
|
|
|
|
|
LC_NUMERIC |
72
|
|
|
|
|
|
|
LC_TIME |
73
|
|
|
|
|
|
|
LC_COLLATE |
74
|
|
|
|
|
|
|
LC_MONETARY |
75
|
|
|
|
|
|
|
LC_MESSAGES |
76
|
|
|
|
|
|
|
LC_ALL); |
77
|
|
|
|
|
|
|
|
78
|
|
|
|
|
|
|
@ISA = qw (Exporter); |
79
|
|
|
|
|
|
|
|
80
|
|
|
|
|
|
|
*Locale::gettext_dumb::textdomain = \&Locale::gettext_pp::textdomain; |
81
|
|
|
|
|
|
|
*Locale::gettext_dumb::bindtextdomain = \&Locale::gettext_pp::bindtextdomain; |
82
|
|
|
|
|
|
|
*Locale::gettext_dumb::bind_textdomain_codeset = |
83
|
|
|
|
|
|
|
\&Locale::gettext_pp::bind_textdomain_codeset; |
84
|
|
|
|
|
|
|
|
85
|
|
|
|
|
|
|
*Locale::gettext_dumb::nl_putenv = \&Locale::gettext_pp::nl_putenv; |
86
|
|
|
|
|
|
|
|
87
|
|
|
|
|
|
|
*Locale::gettext_dumb::LC_CTYPE = \&Locale::gettext_pp::LC_CTYPE; |
88
|
|
|
|
|
|
|
*Locale::gettext_dumb::LC_NUMERIC = \&Locale::gettext_pp::LC_NUMERIC; |
89
|
|
|
|
|
|
|
*Locale::gettext_dumb::LC_TIME= \&Locale::gettext_pp::LC_TIME; |
90
|
|
|
|
|
|
|
*Locale::gettext_dumb::LC_COLLATE = \&Locale::gettext_pp::LC_COLLATE; |
91
|
|
|
|
|
|
|
*Locale::gettext_dumb::LC_MONETARY = \&Locale::gettext_pp::LC_MONETARY; |
92
|
|
|
|
|
|
|
*Locale::gettext_dumb::LC_MESSAGES = \&Locale::gettext_pp::LC_MESSAGES; |
93
|
|
|
|
|
|
|
*Locale::gettext_dumb::LC_ALL = \&Locale::gettext_pp::LC_ALL; |
94
|
|
|
|
|
|
|
|
95
|
|
|
|
|
|
|
|
96
|
|
|
|
|
|
|
sub gettext ($) { |
97
|
9
|
|
|
9
|
0
|
20
|
my ($msgid) = @_; |
98
|
|
|
|
|
|
|
|
99
|
9
|
|
|
|
|
22
|
return dcnpgettext ('', undef, $msgid, undef, undef, undef); |
100
|
|
|
|
|
|
|
} |
101
|
|
|
|
|
|
|
|
102
|
|
|
|
|
|
|
sub dgettext ($$) { |
103
|
0
|
|
|
0
|
0
|
0
|
my ($domainname, $msgid) = @_; |
104
|
|
|
|
|
|
|
|
105
|
0
|
|
|
|
|
0
|
return dcnpgettext ($domainname, undef, $msgid, undef, undef, undef); |
106
|
|
|
|
|
|
|
} |
107
|
|
|
|
|
|
|
|
108
|
|
|
|
|
|
|
sub dcgettext ($$$) { |
109
|
0
|
|
|
0
|
0
|
0
|
my ($domainname, $msgid, $category) = @_; |
110
|
|
|
|
|
|
|
|
111
|
0
|
|
|
|
|
0
|
return dcnpgettext ($domainname, undef, $msgid, undef, undef, undef); |
112
|
|
|
|
|
|
|
} |
113
|
|
|
|
|
|
|
|
114
|
|
|
|
|
|
|
sub ngettext ($$$) { |
115
|
0
|
|
|
0
|
0
|
0
|
my ($msgid, $msgid_plural, $n) = @_; |
116
|
|
|
|
|
|
|
|
117
|
0
|
|
|
|
|
0
|
return dcnpgettext ('', undef, $msgid, $msgid_plural, $n, undef); |
118
|
|
|
|
|
|
|
} |
119
|
|
|
|
|
|
|
|
120
|
|
|
|
|
|
|
sub dngettext ($$$$) { |
121
|
0
|
|
|
0
|
0
|
0
|
my ($domainname, $msgid, $msgid_plural, $n) = @_; |
122
|
|
|
|
|
|
|
|
123
|
0
|
|
|
|
|
0
|
return dcnpgettext ($domainname, undef, $msgid, $msgid_plural, $n, undef); |
124
|
|
|
|
|
|
|
} |
125
|
|
|
|
|
|
|
|
126
|
|
|
|
|
|
|
sub dcngettext ($$$$$) { |
127
|
0
|
|
|
0
|
0
|
0
|
my ($domainname, $msgid, $msgid_plural, $n, $category) = @_; |
128
|
|
|
|
|
|
|
|
129
|
0
|
|
|
|
|
0
|
return dcnpgettext ($domainname, undef, $msgid, $msgid_plural, $n, , |
130
|
|
|
|
|
|
|
$category); |
131
|
|
|
|
|
|
|
} |
132
|
|
|
|
|
|
|
|
133
|
|
|
|
|
|
|
sub pgettext ($$) { |
134
|
0
|
|
|
0
|
0
|
0
|
my ($msgctxt, $msgid) = @_; |
135
|
|
|
|
|
|
|
|
136
|
0
|
|
|
|
|
0
|
return dcnpgettext ('', $msgctxt, $msgid, undef, undef, undef); |
137
|
|
|
|
|
|
|
} |
138
|
|
|
|
|
|
|
|
139
|
|
|
|
|
|
|
sub dpgettext ($$$) { |
140
|
0
|
|
|
0
|
0
|
0
|
my ($domainname, $msgctxt, $msgid) = @_; |
141
|
|
|
|
|
|
|
|
142
|
0
|
|
|
|
|
0
|
return dcnpgettext ($domainname, $msgctxt, $msgid, undef, undef, undef); |
143
|
|
|
|
|
|
|
} |
144
|
|
|
|
|
|
|
|
145
|
|
|
|
|
|
|
sub dcpgettext($$$$) { |
146
|
0
|
|
|
0
|
0
|
0
|
my ($domainname, $msgctxt, $msgid, $category) = @_; |
147
|
|
|
|
|
|
|
|
148
|
0
|
|
|
|
|
0
|
return dcnpgettext ($domainname, $msgctxt, $msgid, undef, undef, undef); |
149
|
|
|
|
|
|
|
} |
150
|
|
|
|
|
|
|
|
151
|
|
|
|
|
|
|
sub npgettext ($$$$) { |
152
|
0
|
|
|
0
|
0
|
0
|
my ($msgctxt, $msgid, $msgid_plural, $n) = @_; |
153
|
|
|
|
|
|
|
|
154
|
0
|
|
|
|
|
0
|
return dcnpgettext ('', $msgctxt, $msgid, $msgid_plural, $n, undef); |
155
|
|
|
|
|
|
|
} |
156
|
|
|
|
|
|
|
|
157
|
|
|
|
|
|
|
sub dnpgettext ($$$$$) { |
158
|
0
|
|
|
0
|
0
|
0
|
my ($domainname, $msgctxt, $msgid, $msgid_plural, $n) = @_; |
159
|
|
|
|
|
|
|
|
160
|
0
|
|
|
|
|
0
|
return dcnpgettext ($domainname, $msgctxt, $msgid, $msgid_plural, $n, undef); |
161
|
|
|
|
|
|
|
} |
162
|
|
|
|
|
|
|
|
163
|
|
|
|
|
|
|
sub __get_locale() { |
164
|
9
|
|
|
9
|
|
14
|
my $locale; |
165
|
|
|
|
|
|
|
|
166
|
9
|
100
|
66
|
|
|
66
|
if (exists $ENV{LANGUAGE} && length $ENV{LANGUAGE}) { |
|
|
100
|
66
|
|
|
|
|
|
|
100
|
66
|
|
|
|
|
|
|
100
|
66
|
|
|
|
|
167
|
2
|
|
|
|
|
5
|
$locale = $ENV{LANGUAGE}; |
168
|
2
|
|
|
|
|
6
|
$locale =~ s/:.*//s; |
169
|
|
|
|
|
|
|
} elsif (exists $ENV{LC_ALL} && length $ENV{LC_ALL}) { |
170
|
2
|
|
|
|
|
6
|
$locale = $ENV{LC_ALL}; |
171
|
|
|
|
|
|
|
} elsif (exists $ENV{LANG} && length $ENV{LANG}) { |
172
|
2
|
|
|
|
|
5
|
$locale = $ENV{LANG}; |
173
|
|
|
|
|
|
|
} elsif (exists $ENV{LC_MESSAGES} && length $ENV{LC_MESSAGES}) { |
174
|
2
|
|
|
|
|
5
|
$locale = $ENV{LC_MESSAGES}; |
175
|
|
|
|
|
|
|
} else { |
176
|
1
|
|
|
|
|
3
|
$locale = 'C'; |
177
|
|
|
|
|
|
|
} |
178
|
|
|
|
|
|
|
|
179
|
9
|
|
|
|
|
19
|
return $locale; |
180
|
|
|
|
|
|
|
} |
181
|
|
|
|
|
|
|
|
182
|
|
|
|
|
|
|
sub dcnpgettext ($$$$$$) { |
183
|
9
|
|
|
9
|
0
|
20
|
my ($domainname, $msgctxt, $msgid, $msgid_plural, $n, $category) = @_; |
184
|
|
|
|
|
|
|
|
185
|
9
|
|
|
|
|
26
|
my $locale = __get_locale; |
186
|
|
|
|
|
|
|
|
187
|
9
|
|
|
|
|
26
|
return Locale::gettext_pp::_dcnpgettext_impl ($domainname, $msgctxt, |
188
|
|
|
|
|
|
|
$msgid, $msgid_plural, $n, |
189
|
|
|
|
|
|
|
$category, $locale); |
190
|
|
|
|
|
|
|
} |
191
|
|
|
|
|
|
|
|
192
|
|
|
|
|
|
|
sub setlocale($;$) { |
193
|
1
|
|
|
1
|
0
|
22
|
&POSIX::setlocale; |
194
|
|
|
|
|
|
|
} |
195
|
|
|
|
|
|
|
|
196
|
|
|
|
|
|
|
1; |
197
|
|
|
|
|
|
|
|
198
|
|
|
|
|
|
|
__END__ |