line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Text::Amuse::Utils; |
2
|
|
|
|
|
|
|
|
3
|
47
|
|
|
47
|
|
286
|
use utf8; |
|
47
|
|
|
|
|
90
|
|
|
47
|
|
|
|
|
224
|
|
4
|
47
|
|
|
47
|
|
1263
|
use strict; |
|
47
|
|
|
|
|
79
|
|
|
47
|
|
|
|
|
823
|
|
5
|
47
|
|
|
47
|
|
182
|
use warnings; |
|
47
|
|
|
|
|
81
|
|
|
47
|
|
|
|
|
34106
|
|
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
=head1 NAME |
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
Text::Amuse::Output - Internal module for L output |
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
=head1 FUNCTIONS |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
=head2 language_mapping |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
Return an hashref with the ISO language codes to Babel ones. |
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
=head2 get_latex_lang($iso) |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
Return the babel name of the ISO language code. If missing or invalid return 'english'. |
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
=head2 has_babel_ldf($language_name) |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
Return true if the babel name passed has an .ldf file. |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
=head2 lang_code_is_rtl($iso) |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
Return true if the language is RTL. |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
=head2 language_code_locale_captions($iso) |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
If the language is aliased, return an hashref with a C<_base_> key |
32
|
|
|
|
|
|
|
pointing to the base language, and the other keys should be use to set |
33
|
|
|
|
|
|
|
the captions. |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
E.g. |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
\setlocalecaption{english}{contents}{Table of Contents} |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
Requires babel 3.51 (2020-10-27) |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
=cut |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
# this comes from /opt/amusewiki-texlive/2021/texmf-dist/tex/generic/babel/locale/*/*tex |
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
sub language_mapping { |
47
|
|
|
|
|
|
|
return { |
48
|
804
|
|
|
804
|
1
|
96153
|
af => 'afrikaans', |
49
|
|
|
|
|
|
|
agq => 'aghem', |
50
|
|
|
|
|
|
|
ak => 'akan', |
51
|
|
|
|
|
|
|
am => 'amharic', |
52
|
|
|
|
|
|
|
ar => 'arabic', |
53
|
|
|
|
|
|
|
# ar => 'arabic-algeria', |
54
|
|
|
|
|
|
|
# ar => 'arabic-dz', |
55
|
|
|
|
|
|
|
# ar => 'arabic-ma', |
56
|
|
|
|
|
|
|
# ar => 'arabic-morocco', |
57
|
|
|
|
|
|
|
# ar => 'arabic-sy', |
58
|
|
|
|
|
|
|
# ar => 'arabic-syria', |
59
|
|
|
|
|
|
|
asa => 'asu', |
60
|
|
|
|
|
|
|
ast => 'asturian', |
61
|
|
|
|
|
|
|
as => 'assamese', |
62
|
|
|
|
|
|
|
az => 'azerbaijani', |
63
|
|
|
|
|
|
|
# az => 'azerbaijani-cyrillic', |
64
|
|
|
|
|
|
|
# az => 'azerbaijani-cyrl', |
65
|
|
|
|
|
|
|
# az => 'azerbaijani-latin', |
66
|
|
|
|
|
|
|
# az => 'azerbaijani-latn', |
67
|
|
|
|
|
|
|
bas => 'basaa', |
68
|
|
|
|
|
|
|
bem => 'bemba', |
69
|
|
|
|
|
|
|
bez => 'bena', |
70
|
|
|
|
|
|
|
be => 'belarusian', |
71
|
|
|
|
|
|
|
bg => 'bulgarian', |
72
|
|
|
|
|
|
|
bm => 'bambara', |
73
|
|
|
|
|
|
|
bn => 'bengali', |
74
|
|
|
|
|
|
|
bo => 'tibetan', |
75
|
|
|
|
|
|
|
brx => 'bodo', |
76
|
|
|
|
|
|
|
br => 'breton', |
77
|
|
|
|
|
|
|
bs => 'bosnian', |
78
|
|
|
|
|
|
|
# bs => 'bosnian-cyrillic', |
79
|
|
|
|
|
|
|
# bs => 'bosnian-cyrl', |
80
|
|
|
|
|
|
|
bs => 'bosnian-latin', |
81
|
|
|
|
|
|
|
# bs => 'bosnian-latn', |
82
|
|
|
|
|
|
|
ca => 'catalan', |
83
|
|
|
|
|
|
|
ce => 'chechen', |
84
|
|
|
|
|
|
|
cgg => 'chiga', |
85
|
|
|
|
|
|
|
chr => 'cherokee', |
86
|
|
|
|
|
|
|
ckb => 'centralkurdish', |
87
|
|
|
|
|
|
|
# ckb => 'centralkurdish-latin', |
88
|
|
|
|
|
|
|
# ckb => 'centralkurdish-latn', |
89
|
|
|
|
|
|
|
ckb => 'sorani', |
90
|
|
|
|
|
|
|
cop => 'coptic', |
91
|
|
|
|
|
|
|
cs => 'czech', |
92
|
|
|
|
|
|
|
cu => 'churchslavic', |
93
|
|
|
|
|
|
|
# cu => 'churchslavic-cyrs', |
94
|
|
|
|
|
|
|
# cu => 'churchslavic-glag', |
95
|
|
|
|
|
|
|
# cu => 'churchslavic-glagolitic', |
96
|
|
|
|
|
|
|
# cu => 'churchslavic-oldcyrillic', |
97
|
|
|
|
|
|
|
# cu => 'churchslavonic', |
98
|
|
|
|
|
|
|
cy => 'welsh', |
99
|
|
|
|
|
|
|
dav => 'taita', |
100
|
|
|
|
|
|
|
da => 'danish', |
101
|
|
|
|
|
|
|
de => 'austrian', |
102
|
|
|
|
|
|
|
de => 'german', |
103
|
|
|
|
|
|
|
# de => 'german-at', |
104
|
|
|
|
|
|
|
# de => 'german-austria', |
105
|
|
|
|
|
|
|
# de => 'german-austria-traditional', |
106
|
|
|
|
|
|
|
# de => 'german-ch', |
107
|
|
|
|
|
|
|
# de => 'german-switzerland', |
108
|
|
|
|
|
|
|
# de => 'german-switzerland-traditional', |
109
|
|
|
|
|
|
|
# de => 'german-traditional', |
110
|
|
|
|
|
|
|
# de => 'naustrian', |
111
|
|
|
|
|
|
|
# de => 'ngerman', |
112
|
|
|
|
|
|
|
# de => 'nswissgerman', |
113
|
|
|
|
|
|
|
# de => 'swissgerman', |
114
|
|
|
|
|
|
|
dje => 'zarma', |
115
|
|
|
|
|
|
|
dsb => 'lowersorbian', |
116
|
|
|
|
|
|
|
dsb => 'lsorbian', |
117
|
|
|
|
|
|
|
dua => 'duala', |
118
|
|
|
|
|
|
|
dyo => 'jolafonyi', |
119
|
|
|
|
|
|
|
dz => 'dzongkha', |
120
|
|
|
|
|
|
|
ebu => 'embu', |
121
|
|
|
|
|
|
|
ee => 'ewe', |
122
|
|
|
|
|
|
|
el => 'greek', |
123
|
|
|
|
|
|
|
# el => 'monotonicgreek', |
124
|
|
|
|
|
|
|
# el => 'polytonicgreek', |
125
|
|
|
|
|
|
|
# en => 'american', |
126
|
|
|
|
|
|
|
# en => 'australian', |
127
|
|
|
|
|
|
|
# en => 'british', |
128
|
|
|
|
|
|
|
# en => 'canadian', |
129
|
|
|
|
|
|
|
en => 'english', |
130
|
|
|
|
|
|
|
# en => 'english-au', |
131
|
|
|
|
|
|
|
# en => 'english-australia', |
132
|
|
|
|
|
|
|
# en => 'english-ca', |
133
|
|
|
|
|
|
|
# en => 'english-canada', |
134
|
|
|
|
|
|
|
# en => 'english-gb', |
135
|
|
|
|
|
|
|
# en => 'english-newzealand', |
136
|
|
|
|
|
|
|
# en => 'english-nz', |
137
|
|
|
|
|
|
|
# en => 'english-unitedkingdom', |
138
|
|
|
|
|
|
|
# en => 'english-unitedstates', |
139
|
|
|
|
|
|
|
# en => 'english-us', |
140
|
|
|
|
|
|
|
# en => 'newzealand', |
141
|
|
|
|
|
|
|
# en => 'ukenglish', |
142
|
|
|
|
|
|
|
# en => 'usenglish', |
143
|
|
|
|
|
|
|
eo => 'esperanto', |
144
|
|
|
|
|
|
|
# es => 'mexican', |
145
|
|
|
|
|
|
|
es => 'spanish', |
146
|
|
|
|
|
|
|
# es => 'spanish-mexico', |
147
|
|
|
|
|
|
|
# es => 'spanish-mx', |
148
|
|
|
|
|
|
|
et => 'estonian', |
149
|
|
|
|
|
|
|
eu => 'basque', |
150
|
|
|
|
|
|
|
ewo => 'ewondo', |
151
|
|
|
|
|
|
|
fa => 'persian', |
152
|
|
|
|
|
|
|
ff => 'fulah', |
153
|
|
|
|
|
|
|
fil => 'filipino', |
154
|
|
|
|
|
|
|
fi => 'finnish', |
155
|
|
|
|
|
|
|
fo => 'faroese', |
156
|
|
|
|
|
|
|
fr => 'french', |
157
|
|
|
|
|
|
|
# fr => 'french-be', |
158
|
|
|
|
|
|
|
# fr => 'french-belgium', |
159
|
|
|
|
|
|
|
# fr => 'french-ca', |
160
|
|
|
|
|
|
|
# fr => 'french-canada', |
161
|
|
|
|
|
|
|
# fr => 'french-ch', |
162
|
|
|
|
|
|
|
# fr => 'french-lu', |
163
|
|
|
|
|
|
|
# fr => 'french-luxembourg', |
164
|
|
|
|
|
|
|
# fr => 'french-switzerland', |
165
|
|
|
|
|
|
|
fur => 'friulian', |
166
|
|
|
|
|
|
|
fy => 'westernfrisian', |
167
|
|
|
|
|
|
|
ga => 'irish', |
168
|
|
|
|
|
|
|
gd => 'scottishgaelic', |
169
|
|
|
|
|
|
|
gl => 'galician', |
170
|
|
|
|
|
|
|
grc => 'ancientgreek', |
171
|
|
|
|
|
|
|
guz => 'gusii', |
172
|
|
|
|
|
|
|
gu => 'gujarati', |
173
|
|
|
|
|
|
|
gv => 'manx', |
174
|
|
|
|
|
|
|
haw => 'hawaiian', |
175
|
|
|
|
|
|
|
ha => 'hausa', |
176
|
|
|
|
|
|
|
# ha => 'hausa-gh', |
177
|
|
|
|
|
|
|
# ha => 'hausa-ghana', |
178
|
|
|
|
|
|
|
# ha => 'hausa-ne', |
179
|
|
|
|
|
|
|
# ha => 'hausa-niger', |
180
|
|
|
|
|
|
|
he => 'hebrew', |
181
|
|
|
|
|
|
|
hi => 'hindi', |
182
|
|
|
|
|
|
|
hr => 'croatian', |
183
|
|
|
|
|
|
|
hsb => 'uppersorbian', |
184
|
|
|
|
|
|
|
# hsb => 'usorbian', |
185
|
|
|
|
|
|
|
hu => 'hungarian', |
186
|
|
|
|
|
|
|
# hu => 'magyar', |
187
|
|
|
|
|
|
|
hy => 'armenian', |
188
|
|
|
|
|
|
|
ia => 'interlingua', |
189
|
|
|
|
|
|
|
id => 'indonesian', |
190
|
|
|
|
|
|
|
ig => 'igbo', |
191
|
|
|
|
|
|
|
ii => 'sichuanyi', |
192
|
|
|
|
|
|
|
is => 'icelandic', |
193
|
|
|
|
|
|
|
it => 'italian', |
194
|
|
|
|
|
|
|
ja => 'japanese', |
195
|
|
|
|
|
|
|
jgo => 'ngomba', |
196
|
|
|
|
|
|
|
jmc => 'machame', |
197
|
|
|
|
|
|
|
kab => 'kabyle', |
198
|
|
|
|
|
|
|
kam => 'kamba', |
199
|
|
|
|
|
|
|
ka => 'georgian', |
200
|
|
|
|
|
|
|
kde => 'makonde', |
201
|
|
|
|
|
|
|
kea => 'kabuverdianu', |
202
|
|
|
|
|
|
|
khq => 'koyrachiini', |
203
|
|
|
|
|
|
|
ki => 'kikuyu', |
204
|
|
|
|
|
|
|
kkj => 'kako', |
205
|
|
|
|
|
|
|
kk => 'kazakh', |
206
|
|
|
|
|
|
|
kln => 'kalenjin', |
207
|
|
|
|
|
|
|
kl => 'kalaallisut', |
208
|
|
|
|
|
|
|
kmr => 'kurmanji', |
209
|
|
|
|
|
|
|
# kmr => 'northernkurdish', |
210
|
|
|
|
|
|
|
# kmr => 'northernkurdish-arab', |
211
|
|
|
|
|
|
|
# kmr => 'northernkurdish-arabic', |
212
|
|
|
|
|
|
|
km => 'khmer', |
213
|
|
|
|
|
|
|
kn => 'kannada', |
214
|
|
|
|
|
|
|
kok => 'konkani', |
215
|
|
|
|
|
|
|
ko => 'korean', |
216
|
|
|
|
|
|
|
# ko => 'korean-han', |
217
|
|
|
|
|
|
|
# ko => 'korean-hani', |
218
|
|
|
|
|
|
|
ksb => 'shambala', |
219
|
|
|
|
|
|
|
ksf => 'bafia', |
220
|
|
|
|
|
|
|
ksh => 'colognian', |
221
|
|
|
|
|
|
|
ks => 'kashmiri', |
222
|
|
|
|
|
|
|
kw => 'cornish', |
223
|
|
|
|
|
|
|
ky => 'kyrgyz', |
224
|
|
|
|
|
|
|
lag => 'langi', |
225
|
|
|
|
|
|
|
# la => 'classiclatin', |
226
|
|
|
|
|
|
|
# la => 'ecclesiasticlatin', |
227
|
|
|
|
|
|
|
la => 'latin', |
228
|
|
|
|
|
|
|
# la => 'medievallatin', |
229
|
|
|
|
|
|
|
lb => 'luxembourgish', |
230
|
|
|
|
|
|
|
lg => 'ganda', |
231
|
|
|
|
|
|
|
lkt => 'lakota', |
232
|
|
|
|
|
|
|
ln => 'lingala', |
233
|
|
|
|
|
|
|
lo => 'lao', |
234
|
|
|
|
|
|
|
lrc => 'northernluri', |
235
|
|
|
|
|
|
|
lt => 'lithuanian', |
236
|
|
|
|
|
|
|
luo => 'luo', |
237
|
|
|
|
|
|
|
luy => 'luyia', |
238
|
|
|
|
|
|
|
lu => 'lubakatanga', |
239
|
|
|
|
|
|
|
lv => 'latvian', |
240
|
|
|
|
|
|
|
mas => 'masai', |
241
|
|
|
|
|
|
|
mer => 'meru', |
242
|
|
|
|
|
|
|
mfe => 'morisyen', |
243
|
|
|
|
|
|
|
mgh => 'makhuwameetto', |
244
|
|
|
|
|
|
|
mgo => 'meta', |
245
|
|
|
|
|
|
|
mg => 'malagasy', |
246
|
|
|
|
|
|
|
mk => 'macedonian', |
247
|
|
|
|
|
|
|
ml => 'malayalam', |
248
|
|
|
|
|
|
|
mn => 'mongolian', |
249
|
|
|
|
|
|
|
mr => 'marathi', |
250
|
|
|
|
|
|
|
ms => 'malay', |
251
|
|
|
|
|
|
|
# ms => 'malay-bn', |
252
|
|
|
|
|
|
|
# ms => 'malay-brunei', |
253
|
|
|
|
|
|
|
# ms => 'malay-sg', |
254
|
|
|
|
|
|
|
# ms => 'malay-singapore', |
255
|
|
|
|
|
|
|
mt => 'maltese', |
256
|
|
|
|
|
|
|
mua => 'mundang', |
257
|
|
|
|
|
|
|
my => 'burmese', |
258
|
|
|
|
|
|
|
mzn => 'mazanderani', |
259
|
|
|
|
|
|
|
naq => 'nama', |
260
|
|
|
|
|
|
|
nb => 'norwegianbokmal', |
261
|
|
|
|
|
|
|
nd => 'northndebele', |
262
|
|
|
|
|
|
|
ne => 'nepali', |
263
|
|
|
|
|
|
|
nl => 'dutch', |
264
|
|
|
|
|
|
|
nmg => 'kwasio', |
265
|
|
|
|
|
|
|
nnh => 'ngiemboon', |
266
|
|
|
|
|
|
|
# nn => 'norwegiannynorsk', |
267
|
|
|
|
|
|
|
nn => 'nynorsk', |
268
|
|
|
|
|
|
|
no => 'norsk', |
269
|
|
|
|
|
|
|
# no => 'norwegian', |
270
|
|
|
|
|
|
|
nus => 'nuer', |
271
|
|
|
|
|
|
|
nyn => 'nyankole', |
272
|
|
|
|
|
|
|
oc => 'occitan', |
273
|
|
|
|
|
|
|
om => 'oromo', |
274
|
|
|
|
|
|
|
or => 'oriya', |
275
|
|
|
|
|
|
|
os => 'ossetic', |
276
|
|
|
|
|
|
|
pa => 'punjabi', |
277
|
|
|
|
|
|
|
# pa => 'punjabi-arab', |
278
|
|
|
|
|
|
|
# pa => 'punjabi-arabic', |
279
|
|
|
|
|
|
|
# pa => 'punjabi-gurmukhi', |
280
|
|
|
|
|
|
|
# pa => 'punjabi-guru', |
281
|
|
|
|
|
|
|
pl => 'polish', |
282
|
|
|
|
|
|
|
pms => 'piedmontese', |
283
|
|
|
|
|
|
|
ps => 'pashto', |
284
|
|
|
|
|
|
|
# pt => 'brazilian', |
285
|
|
|
|
|
|
|
pt => 'portuguese', |
286
|
|
|
|
|
|
|
# pt => 'portuguese-br', |
287
|
|
|
|
|
|
|
# pt => 'portuguese-brazil', |
288
|
|
|
|
|
|
|
# pt => 'portuguese-portugal', |
289
|
|
|
|
|
|
|
# pt => 'portuguese-pt', |
290
|
|
|
|
|
|
|
qu => 'quechua', |
291
|
|
|
|
|
|
|
rm => 'romansh', |
292
|
|
|
|
|
|
|
rn => 'rundi', |
293
|
|
|
|
|
|
|
rof => 'rombo', |
294
|
|
|
|
|
|
|
ro => 'romanian', |
295
|
|
|
|
|
|
|
ru => 'russian', |
296
|
|
|
|
|
|
|
rwk => 'rwa', |
297
|
|
|
|
|
|
|
rw => 'kinyarwanda', |
298
|
|
|
|
|
|
|
sah => 'sakha', |
299
|
|
|
|
|
|
|
saq => 'samburu', |
300
|
|
|
|
|
|
|
sa => 'sanskrit', |
301
|
|
|
|
|
|
|
# sa => 'sanskrit-beng', |
302
|
|
|
|
|
|
|
# sa => 'sanskrit-bengali', |
303
|
|
|
|
|
|
|
# sa => 'sanskrit-deva', |
304
|
|
|
|
|
|
|
# sa => 'sanskrit-devanagari', |
305
|
|
|
|
|
|
|
# sa => 'sanskrit-gujarati', |
306
|
|
|
|
|
|
|
# sa => 'sanskrit-gujr', |
307
|
|
|
|
|
|
|
# sa => 'sanskrit-kannada', |
308
|
|
|
|
|
|
|
# sa => 'sanskrit-knda', |
309
|
|
|
|
|
|
|
# sa => 'sanskrit-malayalam', |
310
|
|
|
|
|
|
|
# sa => 'sanskrit-mlym', |
311
|
|
|
|
|
|
|
# sa => 'sanskrit-telu', |
312
|
|
|
|
|
|
|
# sa => 'sanskrit-telugu', |
313
|
|
|
|
|
|
|
sbp => 'sangu', |
314
|
|
|
|
|
|
|
seh => 'sena', |
315
|
|
|
|
|
|
|
ses => 'koyraborosenni', |
316
|
|
|
|
|
|
|
se => 'northernsami', |
317
|
|
|
|
|
|
|
# se => 'samin', |
318
|
|
|
|
|
|
|
sg => 'sango', |
319
|
|
|
|
|
|
|
shi => 'tachelhit', |
320
|
|
|
|
|
|
|
# shi => 'tachelhit-latin', |
321
|
|
|
|
|
|
|
# shi => 'tachelhit-latn', |
322
|
|
|
|
|
|
|
# shi => 'tachelhit-tfng', |
323
|
|
|
|
|
|
|
# shi => 'tachelhit-tifinagh', |
324
|
|
|
|
|
|
|
si => 'sinhala', |
325
|
|
|
|
|
|
|
sk => 'slovak', |
326
|
|
|
|
|
|
|
# sl => 'slovene', |
327
|
|
|
|
|
|
|
sl => 'slovenian', |
328
|
|
|
|
|
|
|
smn => 'inarisami', |
329
|
|
|
|
|
|
|
sn => 'shona', |
330
|
|
|
|
|
|
|
so => 'somali', |
331
|
|
|
|
|
|
|
sq => 'albanian', |
332
|
|
|
|
|
|
|
# sr => 'serbian', |
333
|
|
|
|
|
|
|
# sr => 'serbian-cyrillic', |
334
|
|
|
|
|
|
|
# sr => 'serbian-cyrillic-bosniaherzegovina', |
335
|
|
|
|
|
|
|
# sr => 'serbian-cyrillic-kosovo', |
336
|
|
|
|
|
|
|
# sr => 'serbian-cyrillic-montenegro', |
337
|
|
|
|
|
|
|
# sr => 'serbian-cyrl', |
338
|
|
|
|
|
|
|
# sr => 'serbian-cyrl-ba', |
339
|
|
|
|
|
|
|
# sr => 'serbian-cyrl-me', |
340
|
|
|
|
|
|
|
# sr => 'serbian-cyrl-xk', |
341
|
|
|
|
|
|
|
sr => 'serbian', |
342
|
|
|
|
|
|
|
# sr => 'serbian-latin-bosniaherzegovina', |
343
|
|
|
|
|
|
|
# sr => 'serbian-latin-kosovo', |
344
|
|
|
|
|
|
|
# sr => 'serbian-latin-montenegro', |
345
|
|
|
|
|
|
|
# sr => 'serbian-latn', |
346
|
|
|
|
|
|
|
# sr => 'serbian-latn-ba', |
347
|
|
|
|
|
|
|
# sr => 'serbian-latn-me', |
348
|
|
|
|
|
|
|
# sr => 'serbian-latn-xk', |
349
|
|
|
|
|
|
|
sv => 'swedish', |
350
|
|
|
|
|
|
|
sw => 'swahili', |
351
|
|
|
|
|
|
|
syr => 'syriac', |
352
|
|
|
|
|
|
|
ta => 'tamil', |
353
|
|
|
|
|
|
|
teo => 'teso', |
354
|
|
|
|
|
|
|
te => 'telugu', |
355
|
|
|
|
|
|
|
th => 'thai', |
356
|
|
|
|
|
|
|
ti => 'tigrinya', |
357
|
|
|
|
|
|
|
tk => 'turkmen', |
358
|
|
|
|
|
|
|
to => 'tongan', |
359
|
|
|
|
|
|
|
tr => 'turkish', |
360
|
|
|
|
|
|
|
twq => 'tasawaq', |
361
|
|
|
|
|
|
|
tzm => 'centralatlastamazight', |
362
|
|
|
|
|
|
|
ug => 'uyghur', |
363
|
|
|
|
|
|
|
uk => 'ukrainian', |
364
|
|
|
|
|
|
|
ur => 'urdu', |
365
|
|
|
|
|
|
|
uz => 'uzbek', |
366
|
|
|
|
|
|
|
# uz => 'uzbek-arab', |
367
|
|
|
|
|
|
|
# uz => 'uzbek-arabic', |
368
|
|
|
|
|
|
|
# uz => 'uzbek-cyrillic', |
369
|
|
|
|
|
|
|
# uz => 'uzbek-cyrl', |
370
|
|
|
|
|
|
|
# uz => 'uzbek-latin', |
371
|
|
|
|
|
|
|
# uz => 'uzbek-latn', |
372
|
|
|
|
|
|
|
vai => 'vai', |
373
|
|
|
|
|
|
|
# vai => 'vai-latin', |
374
|
|
|
|
|
|
|
# vai => 'vai-latn', |
375
|
|
|
|
|
|
|
# vai => 'vai-vai', |
376
|
|
|
|
|
|
|
# vai => 'vai-vaii', |
377
|
|
|
|
|
|
|
vi => 'vietnam', |
378
|
|
|
|
|
|
|
vi => 'vietnamese', |
379
|
|
|
|
|
|
|
vun => 'vunjo', |
380
|
|
|
|
|
|
|
wae => 'walser', |
381
|
|
|
|
|
|
|
xog => 'soga', |
382
|
|
|
|
|
|
|
yav => 'yangben', |
383
|
|
|
|
|
|
|
yi => 'yiddish', |
384
|
|
|
|
|
|
|
yo => 'yoruba', |
385
|
|
|
|
|
|
|
yue => 'cantonese', |
386
|
|
|
|
|
|
|
zgh => 'standardmoroccantamazight', |
387
|
|
|
|
|
|
|
# zh => 'chinese', |
388
|
|
|
|
|
|
|
# zh => 'chinese-hans', |
389
|
|
|
|
|
|
|
# zh => 'chinese-hans-hk', |
390
|
|
|
|
|
|
|
# zh => 'chinese-hans-mo', |
391
|
|
|
|
|
|
|
# zh => 'chinese-hans-sg', |
392
|
|
|
|
|
|
|
# zh => 'chinese-hant', |
393
|
|
|
|
|
|
|
# zh => 'chinese-hant-hk', |
394
|
|
|
|
|
|
|
# zh => 'chinese-hant-mo', |
395
|
|
|
|
|
|
|
zh => 'chinese', |
396
|
|
|
|
|
|
|
# zh => 'chinese-simplified-hongkongsarchina', |
397
|
|
|
|
|
|
|
# zh => 'chinese-simplified-macausarchina', |
398
|
|
|
|
|
|
|
# zh => 'chinese-simplified-singapore', |
399
|
|
|
|
|
|
|
# zh => 'chinese-traditional', |
400
|
|
|
|
|
|
|
# zh => 'chinese-traditional-hongkongsarchina', |
401
|
|
|
|
|
|
|
# zh => 'chinese-traditional-macausarchina', |
402
|
|
|
|
|
|
|
zu => 'zulu', |
403
|
|
|
|
|
|
|
|
404
|
|
|
|
|
|
|
# aliases, see below. cebuano and tagalog |
405
|
|
|
|
|
|
|
ceb => 'filipino', |
406
|
|
|
|
|
|
|
tl => 'filipino', |
407
|
|
|
|
|
|
|
}; |
408
|
|
|
|
|
|
|
} |
409
|
|
|
|
|
|
|
|
410
|
|
|
|
|
|
|
# and this from the documentation, 2022-01-29 |
411
|
|
|
|
|
|
|
|
412
|
|
|
|
|
|
|
sub has_babel_ldf { |
413
|
5
|
|
|
5
|
1
|
694
|
my $lang = shift; |
414
|
5
|
|
|
|
|
104
|
my %langs = ( |
415
|
|
|
|
|
|
|
afrikaans => 1, |
416
|
|
|
|
|
|
|
azerbaijani => 1, |
417
|
|
|
|
|
|
|
basque => 1, |
418
|
|
|
|
|
|
|
breton => 1, |
419
|
|
|
|
|
|
|
bulgarian => 1, |
420
|
|
|
|
|
|
|
catalan => 1, |
421
|
|
|
|
|
|
|
croatian => 1, |
422
|
|
|
|
|
|
|
czech => 1, |
423
|
|
|
|
|
|
|
danish => 1, |
424
|
|
|
|
|
|
|
dutch => 1, |
425
|
|
|
|
|
|
|
english => 1, |
426
|
|
|
|
|
|
|
USenglish => 1, |
427
|
|
|
|
|
|
|
american => 1, |
428
|
|
|
|
|
|
|
UKenglish => 1, |
429
|
|
|
|
|
|
|
british => 1, |
430
|
|
|
|
|
|
|
canadian => 1, |
431
|
|
|
|
|
|
|
australian => 1, |
432
|
|
|
|
|
|
|
newzealand => 1, |
433
|
|
|
|
|
|
|
esperanto => 1, |
434
|
|
|
|
|
|
|
estonian => 1, |
435
|
|
|
|
|
|
|
finnish => 1, |
436
|
|
|
|
|
|
|
french => 1, |
437
|
|
|
|
|
|
|
francais => 1, |
438
|
|
|
|
|
|
|
canadien => 1, |
439
|
|
|
|
|
|
|
acadian => 1, |
440
|
|
|
|
|
|
|
galician => 1, |
441
|
|
|
|
|
|
|
austrian => 1, |
442
|
|
|
|
|
|
|
german => 1, |
443
|
|
|
|
|
|
|
germanb => 1, |
444
|
|
|
|
|
|
|
ngerman => 1, |
445
|
|
|
|
|
|
|
naustrian => 1, |
446
|
|
|
|
|
|
|
# greek => 1, |
447
|
|
|
|
|
|
|
polutonikogreek => 1, |
448
|
|
|
|
|
|
|
hebrew => 1, |
449
|
|
|
|
|
|
|
icelandic => 1, |
450
|
|
|
|
|
|
|
indonesian => 1, |
451
|
|
|
|
|
|
|
bahasa => 1, |
452
|
|
|
|
|
|
|
indon => 1, |
453
|
|
|
|
|
|
|
bahasai => 1, |
454
|
|
|
|
|
|
|
interlingua => 1, |
455
|
|
|
|
|
|
|
irish => 1, |
456
|
|
|
|
|
|
|
italian => 1, |
457
|
|
|
|
|
|
|
latin => 1, |
458
|
|
|
|
|
|
|
lowersorbian => 1, |
459
|
|
|
|
|
|
|
malay => 1, |
460
|
|
|
|
|
|
|
melayu => 1, |
461
|
|
|
|
|
|
|
bahasam => 1, |
462
|
|
|
|
|
|
|
samin => 1, |
463
|
|
|
|
|
|
|
norsk => 1, |
464
|
|
|
|
|
|
|
polish => 1, |
465
|
|
|
|
|
|
|
portuguese => 1, |
466
|
|
|
|
|
|
|
brazilian => 1, |
467
|
|
|
|
|
|
|
romanian => 1, |
468
|
|
|
|
|
|
|
russian => 1, |
469
|
|
|
|
|
|
|
scottish => 1, |
470
|
|
|
|
|
|
|
spanish => 1, |
471
|
|
|
|
|
|
|
slovak => 1, |
472
|
|
|
|
|
|
|
slovene => 1, |
473
|
|
|
|
|
|
|
swedish => 1, |
474
|
|
|
|
|
|
|
serbian => 1, |
475
|
|
|
|
|
|
|
turkish => 1, |
476
|
|
|
|
|
|
|
ukrainian => 1, |
477
|
|
|
|
|
|
|
uppersorbian => 1, |
478
|
|
|
|
|
|
|
welsh => 1, |
479
|
|
|
|
|
|
|
); |
480
|
5
|
100
|
|
|
|
14
|
if (exists $langs{$lang}) { |
|
|
100
|
|
|
|
|
|
481
|
2
|
|
|
|
|
16
|
return $langs{$lang}; |
482
|
|
|
|
|
|
|
} |
483
|
|
|
|
|
|
|
elsif (my $alias = language_mapping()->{$lang}) { |
484
|
2
|
100
|
|
|
|
7
|
if (exists $langs{$alias}) { |
485
|
1
|
|
|
|
|
26
|
return $langs{$alias}; |
486
|
|
|
|
|
|
|
} |
487
|
|
|
|
|
|
|
} |
488
|
2
|
|
|
|
|
46
|
return 0; |
489
|
|
|
|
|
|
|
} |
490
|
|
|
|
|
|
|
|
491
|
|
|
|
|
|
|
sub get_latex_lang { |
492
|
11
|
|
50
|
11
|
1
|
39
|
my $lang = shift || 'en'; |
493
|
11
|
|
50
|
|
|
25
|
return language_mapping()->{$lang} || 'english'; |
494
|
|
|
|
|
|
|
} |
495
|
|
|
|
|
|
|
|
496
|
|
|
|
|
|
|
sub lang_code_is_rtl { |
497
|
42
|
|
50
|
42
|
1
|
114
|
my $lang = shift || 'en'; |
498
|
42
|
|
|
|
|
144
|
my %rtl = ( |
499
|
|
|
|
|
|
|
ar => 1, |
500
|
|
|
|
|
|
|
he => 1, |
501
|
|
|
|
|
|
|
fa => 1, |
502
|
|
|
|
|
|
|
); |
503
|
42
|
|
|
|
|
245
|
return $rtl{$lang}; |
504
|
|
|
|
|
|
|
} |
505
|
|
|
|
|
|
|
|
506
|
|
|
|
|
|
|
sub language_code_locale_captions { |
507
|
0
|
|
|
0
|
1
|
|
my $code = shift; |
508
|
|
|
|
|
|
|
# usually we need only the doc |
509
|
0
|
|
|
|
|
|
my %aliases = ( |
510
|
|
|
|
|
|
|
ceb => { |
511
|
|
|
|
|
|
|
_base_ => "filipino", # not used for the moment. |
512
|
|
|
|
|
|
|
contents => "Talaan sa mga Sulod", |
513
|
|
|
|
|
|
|
}, |
514
|
|
|
|
|
|
|
tl => { |
515
|
|
|
|
|
|
|
_base_ => "filipino", |
516
|
|
|
|
|
|
|
contents => "Talaan ng mga nilalaman", |
517
|
|
|
|
|
|
|
}, |
518
|
|
|
|
|
|
|
); |
519
|
0
|
|
0
|
|
|
|
return $aliases{$code || ''}; |
520
|
|
|
|
|
|
|
} |
521
|
|
|
|
|
|
|
|
522
|
|
|
|
|
|
|
1; |