lang-ini.mkxl /size: 22 Kb    last modification: 2020-07-01 14:35
1
%D \module
2
%D [ file=lang-ini,
3
%D version=1996.01.25,
4
%D title=\CONTEXT\ Language Macros,
5
%D subtitle=Initialization,
6
%D author=Hans Hagen,
7
%D date=\currentdate,
8
%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
9
%C
10
%C This module is part of the \CONTEXT\ macro||package and is
11
%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
12
%C details.
13 14
%D This module needs a further cleanup (real split between ii/iv).
15 16
% \cldcontext{languages.numbers[tex.count.mainlanguagenumber]}
17 18
%D This module implements multi||language support of \CONTEXT, which should not be
19
%D confused with the multi||lingual interface. This support will be extended when
20
%D needed. Properties of languages are defined in \TEX\ files as well as \LUA\
21
%D files.
22 23
\writestatus
{
loading
}{
ConTeXt
Language
Macros
/
Initialization
}
24 25
\registerctxluafile
{
lang
-
ini
}{}
26
\registerctxluafile
{
lang
-
def
}{}
27
\registerctxluafile
{
lang
-
cnt
}{}
28 29
\unprotect
30 31
\ifdefined
\nonfrenchspacing
\else
\let
\nonfrenchspacing
\relax
\fi
32
\ifdefined
\frenchspacing
\else
\let
\frenchspacing
\relax
\fi
33 34
%D When loading hyphenation patterns, \TEX\ assign a number to each loaded table,
35
%D starting with~0. Switching to a specific table is done by assigning the relevant
36
%D number to the predefined \COUNTER\ \type {\language}. However, in \MKIV\ a lot
37
%D of management is delegated to \LUA.
38 39
%D We keep track of the last loaded patterns by means of a pseudo \COUNTER. This
40
%D just one of those situations in which we don't want to spent a real one. Language
41
%D zero has no patterns, first of all because I like to start numbering at one. It
42
%D may come in handy for special purposes as well.
43 44
\normallanguage
\zerocount
\def
\loadedlanguage
{
1
}
45 46
%D \macros
47
%D {currentlanguage, setupcurrentlanguage}
48
%D
49
%D Instead of numbers,we are going to use symbolic names for the languages. The
50
%D current langage is saved in the macro \type {\currentlanguage}. The setup macro
51
%D is mainly used for cosmetic purposes.
52
%D
53
%D \starttyping
54
%D \dorecurse{3}
55
%D {\language[nl]
56
%D \startmode[*en] english \stopmode
57
%D \startmode[*nl] dutch \stopmode
58
%D \language[en]
59
%D \startmode[*en] english \stopmode
60
%D \startmode[*nl] dutch \stopmode}
61
%D \stoptyping
62 63
\let
\currentlanguage
\empty
64
\let
\currentmainlanguage
\empty
65 66
%D \macros
67
%D {defaultlanguage,languageparameter,specificlanguageparameter}
68
%D
69
%D We don't use the commandhandler here (yet) because we have a rather special
70
%D fallback mechanism so quite some compatibility testing is needed.
71 72
\installcorenamespace
{
language
}
73
\installcorenamespace
{
languagelinked
}
74 75
\def
\currentusedlanguage
{
\currentlanguage
}
76 77
\def
\defaultlanguage
#
1
%
78
{
\ifcsname
\??language
#
1
\s!default
\endcsname
79
\expandafter
\defaultlanguage
\lastnamedcs
80
\else
81
#
1
%
82
\fi
}
83 84
\def
\languageparameter
#
1
%
85
{
\ifcsname
\??language
\currentlanguage
#
1
\endcsname
86
\lastnamedcs
87
\orelse\ifcsname
\??language
\currentlanguage
\s!default
\endcsname
88
\expandafter
\specificlanguageparameter
\lastnamedcs
{
#
1
}
%
89
\orelse\ifcsname
\??language\s!default
#
1
\endcsname
90
\lastnamedcs
91
\fi
}
92 93
\def
\specificlanguageparameter
#
1
#
2
%
94
{
\ifcsname
\??language
#
1
#
2
\endcsname
95
\lastnamedcs
96
\orelse\ifcsname
\??language
#
1
\s!default
\endcsname
97
\expandafter
\specificlanguageparameter
\lastnamedcs
{
#
2
}
%
98
\orelse\ifcsname
\??language\s!default
#
2
\endcsname
99
\lastnamedcs
100
\fi
}
101 102
\def
\mainlanguageparameter
#
1
%
103
{
\ifcsname
\??language
\currentmainlanguage
#
1
\endcsname
104
\lastnamedcs
105
\orelse\ifcsname
\??language
\currentmainlanguage
\s!default
\endcsname
106
\expandafter
\specificlanguageparameter
\lastnamedcs
{
#
1
}
%
107
\orelse\ifcsname
\??language\s!default
#
1
\endcsname
108
\lastnamedcs
109
\fi
}
110 111
\let
\usedlanguageparameter
\languageparameter
112 113
\def
\askedlanguageparameter
#
1
% assumes \currentusedlanguage being set
114
{
\ifcsname
\??language
\currentusedlanguage
#
1
\endcsname
115
\lastnamedcs
116
\orelse\ifcsname
\??language
\currentusedlanguage
\s!default
\endcsname
117
\expandafter
\specificlanguageparameter
\lastnamedcs
{
#
1
}
%
118
\orelse\ifcsname
\??language\s!default
#
1
\endcsname
119
\lastnamedcs
120
\fi
}
121 122
\unexpanded
\def
\setusedlanguage
#
1
%
123
{
\edef
\currentusedlanguage
{
\reallanguagetag
{
#
1
}}
%
124
\ifempty
\currentusedlanguage
125
\let
\currentusedlanguage
\currentlanguage
126
\let
\usedlanguageparameter
\languageparameter
127
\orelse\ifx
\currentusedlanguage
\v!global
128
\let
\currentusedlanguage
\currentmainlanguage
129
\let
\usedlanguageparameter
\mainlanguageparameter
130
\orelse\ifx
\currentusedlanguage
\v!local
131
\let
\currentusedlanguage
\currentlanguage
132
\let
\usedlanguageparameter
\languageparameter
133
\else
134
\let
\usedlanguageparameter
\askedlanguageparameter
135
\fi
}
136 137
\unexpanded
\def
\setupcurrentlanguage
[#
1
]
%
138
{
\setcurrentlanguage
\currentmainlanguage
{
#
1
}}
139 140
\unexpanded
\def
\setcurrentlanguage
#
1
#
2
% sets modes: **id (currentmain) *id (current)
141
{
\edef
\xaskedlanguage
{
#
1
}
% otherwise clash with \askedlanguage
142
\ifempty
\xaskedlanguage
\else
143
\ifempty
\currentmainlanguage
\else
\resetsystemmode
{
\systemmodeprefix
\currentmainlanguage
}
\fi
144
\let
\currentmainlanguage
\xaskedlanguage
145
\setsystemmode
{
\systemmodeprefix
\currentmainlanguage
}
%
146
\fi
147
\edef
\xaskedlanguage
{
#
2
}
%
148
\ifempty
\xaskedlanguage
\else
149
\ifempty
\currentlanguage
\else
\resetsystemmode
\currentlanguage
\fi
150
\let
\currentlanguage
\xaskedlanguage
151
\setsystemmode
\currentlanguage
152
\fi
}
153 154
%D The internal macros will be defined later.
155 156
%D \macros
157
%D {installlanguage}
158
%D
159
%D Hyphenation patterns can only be loaded when the format file is prepared. The
160
%D next macro takes care of this loading. A language is specified with
161
%D
162
%D \showsetup{installlanguage}
163
%D
164
%D When \type {state} equals \type {start}, both patterns and additional hyphenation
165
%D specifications are loaded. These files are seached for in the patterns path
166
%D have names like \type {lang-nl.lua}.
167
%D
168
%D The \type {spacing} variable specifies how the spaces after punctuation has to be
169
%D handled. English is by tradition more tolerant to inter||sentence spacing than
170
%D other languages.
171
%D
172
%D This macro also defines \type {\identifier} as a shortcut switch to the language.
173
%D Furthermore the command defined as being language specific, are executed. With
174
%D \type {default} we can default to another language (patterns) at format
175
%D generation time. Patterns are loaded at runtime.
176 177
\newtoks
\everysetuplanguage
178 179
\def
\installedlanguages
{
\clf_installedlanguages
}
180 181
\unexpanded
\def
\doifelselanguage
#
1
%
182
{
\ifcsname
\??language
#
1
\c!state
\endcsname
183
\expandafter
\firstoftwoarguments
184
\else
185
\expandafter
\secondoftwoarguments
186
\fi
}
187 188
\let
\doiflanguageelse\doifelselanguage
189 190
\def
\reallanguagetag
#
1
%
191
{
\ifcsname
\??languagelinked
#
1
\endcsname\lastnamedcs\else
#
1
\fi
}
192 193
% \language[#1] gave unwanted side effect of loading language specifics
194 195
\unexpanded
\def
\installlanguage
196
{
\dodoubleargument
\lang_basics_install
}
197 198
% \def\lang_basics_install[#1][#2]%
199
% {\doifelseassignment{#2}
200
% {\doifelselanguage{#1}
201
% {\getparameters[\??language#1][#2]}
202
% {\setvalue{\??languagelinked#1}{#1}%
203
% \lang_basics_install_indeed{#1}{#1}%
204
% \getparameters[\??language#1][\c!state=\v!start,#2]}%
205
% \edef\currentsetuplanguage{#1}%
206
% \clf_definelanguage{#1}{\specificlanguageparameter{#1}\s!default}%
207
% \the\everysetuplanguage}
208
% {\setvalue{\??languagelinked#1}{#2}%
209
% \clf_setlanguagesynonym{#1}{#2}%
210
% \lang_basics_install_indeed{#1}{#2}}}
211 212
\def
\lang_basics_install
[#
1
][#
2
]
%
213
{
\ifcondition
\validassignment
{
#
2
}
%
214
\doifelselanguage
{
#
1
}
215
{
\getparameters
[
\??language
#
1
][#
2
]
}
216
{
\setvalue
{
\??languagelinked
#
1
}{
#
1
}
%
217
\lang_basics_install_indeed
{
#
1
}{
#
1
}
%
218
\getparameters
[
\??language
#
1
][
\c!state
=
\v!start
,
#
2
]
}
%
219
\edef
\currentsetuplanguage
{
#
1
}
%
220
\clf_definelanguage
{
#
1
}{
\specificlanguageparameter
{
#
1
}
\s!default
}
%
221
\the
\everysetuplanguage
222
\else
223
\setvalue
{
\??languagelinked
#
1
}{
#
2
}
%
224
\clf_setlanguagesynonym
{
#
1
}{
#
2
}
%
225
\lang_basics_install_indeed
{
#
1
}{
#
2
}
%
226
\fi
}
227 228
\def
\lang_basics_install_indeed
#
1
#
2
%
229
{
\ifcsname
#
1
\endcsname\else
\setuvalue
{
#
1
}{
\lang_basics_set_current
[#
2
]
}
\fi
}
230 231
%D When the second argument is a language identifier, a synonym is created. This
232
%D feature is present because we used dutch mnemonics in the dutch version, but
233
%D nowadays conform a standard.
234 235
\unexpanded
\def
\doifelsepatterns
#
1
%
236
{
\begingroup
% will change
237
\lang_basics_set_current
[#
1
]
%
238
\ifnum
\normallanguage
>
\zerocount
239
\endgroup\expandafter
\firstoftwoarguments
240
\else
241
\endgroup\expandafter
\secondoftwoarguments
242
\fi
}
243 244
\let
\doifpatternselse\doifelsepatterns
245 246
%D \macros
247
%D {setuplanguage}
248
%D
249
%D Quick and dirty, but useful:
250
%D
251
%D \showsetup{setuplanguage}
252
%D
253
%D Beware, this command can only be used when a language is installed.
254 255
\unexpanded
\def
\setuplanguage
256
{
\dodoubleempty
\lang_basics_setup
}
257 258
\ifdefined
\lang_basics_synchronize
\else
259
\let
\lang_basics_synchronize
\relax
% be nice for setups till we have one
260
\fi
261 262
\installmacrostack\currentlanguage
263 264
\def
\lang_basics_setup
[#
1
][#
2
]
%
265
{
\ifsecondargument
266
\push_macro_currentlanguage
% can be default
267
\edef
\currentsetuplanguage
{
\reallanguagetag
{
#
1
}}
%
268
\getparameters
[
\??language
\currentsetuplanguage
][#
2
]
%
269
\the
\everysetuplanguage
270
\pop_macro_currentlanguage
271
%\doif\currentsetuplanguage\currentlanguage we can have influenced inheritance (default)
272
\else
273
\let
\currentsetuplanguage
\currentlanguage
274
\getparameters
[
\??language
\currentsetuplanguage
][#
1
]
%
275
\the
\everysetuplanguage
276
\fi
277
\lang_basics_synchronize
}
278 279
\appendtoks
280
\clf_unloadlanguage
{
\currentsetuplanguage
}
%
281
\to
\everysetuplanguage
282 283
\setuplanguage
284
[
\s!default
]
285
[
\s!patterns
=
,
286
\s!lefthyphenmin
=
2
,
287
\s!righthyphenmin
=
2
,
288
\s!lefthyphenchar
=
-
1
,
289
\s!righthyphenchar
=
4
5
,
290
% used in compound i.e. interfaced with c! and can be anything so no numbers
291
\c!lefthyphen
=
,
292
\c!righthyphen
=
-
,
293
\c!hyphen
=
-
,
294
\c!spacing
=
\v!packed
,
295
\c!compoundhyphen
=
\compoundhyphen
,
296
\c!rightcompoundhyphen
=
\compoundhyphen
,
297
\c!leftcompoundhyphen
=
,
298
\c!midsentence
=
---
,
299
\c!leftsentence
=
---
,
300
\c!rightsentence
=
---
,
301
\c!leftsubsentence
=
---
,
302
\c!rightsubsentence
=
---
,
303
\c!leftquote
=
\upperleftsinglesixquote
,
304
\c!rightquote
=
\upperrightsingleninequote
,
305
\c!leftquotation
=
\upperleftdoublesixquote
,
306
\c!rightquotation
=
\upperrightdoubleninequote
,
307
\c!leftspeech
=
\languageparameter
\c!leftquotation
,
308
\c!middlespeech
=
,
309
\c!rightspeech
=
\languageparameter
\c!rightquotation
,
310
\c!limittext
=
\unknown
,
311
\c!time
=
{
h
,
:
,
m
}
,
312
\c!date
=
{
\v!year
,
\
,
\v!month
,
\
,
\v!day
}
,
313
\c!text
=
Ag
,
314
\s!font
=]
% \v!auto : experimental !
315 316
% to be tested:
317
%
318
% \setuplanguage
319
% [\s!default]
320
% [\c!righthyphenchar="AD]
321 322
%D The values \type {leftsentence} and \type {rightsentence} can be (and are) used
323
%D to implement automatic subsentence boundary glyphs, like in {\fr |<|french
324
%D guillemots|>|} or {\de |<|german guillemots|>|} or {\nl |<|dutch dashes|>|} like
325
%D situations. Furthermore \type {leftquotation} and \type {leftquote} come into
326
%D view \quotation {when we quote} or \quote {quote} something.
327 328
%D \macros
329
%D {currentdatespecification, currenttimespecification}
330
%D
331
%D Just to make things easy we can ask for the current date specification by saying:
332 333
\def
\currentdatespecification
{
\languageparameter
\c!date
}
334
\def
\currenttimespecification
{
\languageparameter
\c!time
}
335 336
%D Carefull reading of these macros shows that it's legal to say
337
%D
338
%D \starttyping
339
%D \installlanguage [du] [de]
340
%D \stoptyping
341 342
%D \macros
343
%D {language,mainlanguage}
344
%D
345
%D Switching to another language (actually another hyphenation pattern) is done
346
%D with:
347
%D
348
%D \starttyping
349
%D \language[identifier]
350
%D \stoptyping
351
%D
352
%D or with \type {\identifier}. Just to be compatible with \PLAIN\ \TEX, we still
353
%D support the original meaning, so
354
%D
355
%D \starttyping
356
%D \language=1
357
%D \stoptyping
358
%D
359
%D is a valid operation, where the relation between number and language depends on
360
%D the order in installing languages.
361
%D
362
%D \showsetup{language}
363
%D \showsetup{mainlanguage}
364
%D
365
%D Both commands take a predefined language identifier as argument. We can use \type
366
%D {\mainlanguage[identifier]} for setting the (indeed) main language. This is the
367
%D language used for translating labels like {\em figure} and {\em table}. The main
368
%D language defaults to the current language.
369 370
\newtoks
\everylanguage
371 372
\installcorenamespace
{
languagenumbers
}
373 374
\appendtoks
375
% we need to reassign the number because new patterns can be defined later on
376
% so let's hope not that many \setups happen during a run
377
\expandafter
\glet
\csname
\??languagenumbers
\currentlanguage
\endcsname
\undefined
378
\to
\everysetuplanguage
379 380
\def
\lang_basics_synchronize_yes
381
{
\zerocount
% see below
382
\global\expandafter\chardef\csname
\??languagenumbers
\currentlanguage
\endcsname
383
\clf_languagenumber
384
{
\currentlanguage
}
%
385
{
\defaultlanguage
\currentlanguage
}
%
386
{
\languageparameter
\s!patterns
}
%
387
{
\languageparameter
\c!factor
}
%
388
\relax
389
\normallanguage\csname
\??languagenumbers
\currentlanguage
\endcsname
}
390 391
\let
\lang_basics_synchronize_nop
\zerocount
% not loaded anyway
392 393
\letvalue
{
\??languagenumbers
}
\lang_basics_synchronize_nop
% initime
394 395
\appendtoks
396
\letvalue
{
\??languagenumbers
}
\lang_basics_synchronize_yes
% runtime
397
\to
\everydump
398 399
\def
\lang_basics_synchronize
400
{
\normallanguage\csname
\??languagenumbers
401
\ifcsname
\??languagenumbers
\currentlanguage
\endcsname
402
\currentlanguage
403
\fi
404
\endcsname
405
\relax
406
\the
\everylanguage
407
\relax
}
408 409
\newcount
\hyphenstate
410
\newcount
\hyphenminoffset
411 412
\unexpanded
\def
\lesshyphens
413
{
\advance
\hyphenminoffset
\plusone
414
\lang_basics_synchronize_min_max
}
415 416
\unexpanded
\def
\morehyphens
417
{
\ifcase
\hyphenminoffset
\else
418
\advance
\hyphenminoffset
\minusone
419
\fi
420
\lang_basics_synchronize_min_max
}
421 422
\unexpanded
\def
\nohyphens
% nicer for url's
423
{
\ifx
\dohyphens
\relax
424
\unexpanded
\edef
\dohyphens
425
{
\hyphenminoffset
\the
\hyphenminoffset
\relax
426
\lang_basics_synchronize_min_max
}
%
427
\fi
428
\hyphenminoffset
\plusthousand
429
\lang_basics_synchronize_min_max
}
430 431
\let
\dohyphens
\relax
432 433
\unexpanded
\def
\lang_basics_synchronize_min_max
% maybe store this at the lua end
434
{
% these values are stored along with glyph nodes
435
\lefthyphenmin
\numexpr
0
\languageparameter
\s!lefthyphenmin
+
\hyphenminoffset
\relax
436
\righthyphenmin\numexpr
0
\languageparameter
\s!righthyphenmin
+
\hyphenminoffset
\relax
437
\hyphenationmin\numexpr
0
\languageparameter
\s!hyphenmin
\relax
438
% these values are stored with the language (global!)
439
\prehyphenchar
\languageparameter
\s!righthyphenchar
\relax
440
\posthyphenchar
\languageparameter
\s!lefthyphenchar
\relax
}
441 442
\appendtoks
443
\lang_basics_synchronize_min_max
444
\to
\everylanguage
445 446
\unexpanded
\def
\unhyphenated
447
{
\groupedcommand
{
\lefthyphenmin
\maxdimen
}
\donothing
}
448 449
% \appendtoks
450
% \setups[\languageparameter\c!setups]%
451
% \to \everylanguage
452 453
%D You can setup the default language to reset settings.
454 455
\appendtoks
456
\edef
\currentlanguagesetups
{
\languageparameter
\c!setups
}
%
457
\ifempty
\currentlanguagesetups
\else
458
\setups
[
\currentlanguagesetups
]
%
459
\fi
460
\to
\everylanguage
461 462
% new
463 464
\appendtoks
465
\usebidiparameter
\languageparameter
466
\to
\everylanguage
467 468
% this will move to core-spa !
469 470
\appendtoks
471
\edef
\p_spacing
{
\languageparameter
\c!spacing
}
%
472
\ifx
\p_spacing
\v!broad
473
\nonfrenchspacing
474
\else
475
\frenchspacing
476
\fi
477
\to
\everylanguage
478 479
% \mainlanguage[nl] \setuplanguage[nl][lefthyphen=,righthyphen=?]
480
%
481
% \dorecurse{100}{dit is toch wel een heel\normalhyphendiscretionary lang\normalhyphendiscretionary woord \recurselevel\ }
482
% \dorecurse{100}{dit is toch wel een heellangwoord \recurselevel\ }
483 484
% new experimental feature
485 486
\unexpanded
\def
\setuplanguages
487
{
\setuplanguage
[
\s!default
]
}
488 489
% \setuplanguages[\s!font=\v!auto]
490
% \setuplanguage[\s!default][\s!font=\v!auto]
491
% \setuplanguage[nl][\s!font=\v!auto]
492 493
\appendtoks
494
\edef
\p_language_font
{
\languageparameter
\s!font
}
%
495
\ifempty
\p_language_font
496
\orelse\ifx
\p_language_font
\v!auto
497
\doaddfeature\currentlanguage
498
\else
499
\doaddfeature
\p_language_font
500
\fi
501
\to
\everylanguage
502 503
%D Fast switcher
504 505
\def
\lang_basics_switch_asked
506
{
\ifcsname
\??languagelinked
\askedlanguage
\endcsname
507
\edef
\askedlanguage
{
\lastnamedcs
}
%
508
\ifx
\currentlanguage
\askedlanguage
\else
509
\setcurrentlanguage
\currentmainlanguage
\askedlanguage
510
\lang_basics_synchronize
511
\fi
512
\fi
}
513 514
\unexpanded
\def
\uselanguageparameter
#
1
%
515
{
\edef
\askedlanguage
{
#
1
\c!language
}
%
516
\ifempty
\askedlanguage
\else
\lang_basics_switch_asked
\fi
}
517 518
\unexpanded
\def
\douselanguageparameter
#
1
% fast setter
519
{
\edef
\askedlanguage
{
#
1
}
%
520
\ifempty
\askedlanguage
\else
\lang_basics_switch_asked
\fi
}
521 522
\unexpanded
\def
\lang_basics_set_current
[#
1
]
%
523
{
\edef
\askedlanguage
{
#
1
}
%
524
\ifempty
\askedlanguage
\else
\lang_basics_switch_asked
\fi
}
525 526
\unexpanded
\def\language
527
{
\doifelsenextoptionalcs
\lang_basics_set_current
\normallanguage
}
528 529
\let\setlanguage\language
% we make these synonyms
530 531
\let\patterns
\gobbleoneargument
532 533
\newcount
\mainlanguagenumber
534 535
%D Beware: you might need to use \type {\dontleavehmode} outside and|/|or \type {\par}
536
%D inside the group!
537 538
\unexpanded
\def
\startlanguage
539
{
\begingroup\language
}
540 541
\let
\stoplanguage
\endgroup
542 543
\unexpanded
\def
\mainlanguage
[#
1
]
%
544
{
\edef
\askedlanguage
{
#
1
}
%
545
\ifempty
\askedlanguage
546
\orelse\ifcsname
\??languagelinked
\askedlanguage
\endcsname
547
%\edef\askedlanguage{\csname\??languagelinked\askedlanguage\endcsname}%
548
\edef
\askedlanguage
{
\lastnamedcs
}
%
549
\ifx
\currentlanguage
\askedlanguage
550
\ifx
\currentmainlanguage
\askedlanguage
\else
551
\setcurrentlanguage
\askedlanguage
\askedlanguage
552
\lang_basics_synchronize
553
\fi
554
\else
555
\setcurrentlanguage
\askedlanguage
\askedlanguage
556
\lang_basics_synchronize
557
\fi
558
\fi
559
\mainlanguagenumber
\normallanguage
}
560 561
\appendtoks
562
\normallanguage
\mainlanguagenumber
563
\to
\everybeforepagebody
564 565
%D Used at all?
566 567
\def
\splitsequence
#
1
#
2
%
568
{
\doifelse
{
#
1
}
\v!no
{
#
2
}{
\doifelse
{
#
1
}
\v!yes
{
\languageparameter
\c!limittext
}{
#
1
}}}
569 570
\def
\splitsymbol
#
1
%
571
{
\splitsequence
{
#
1
}{
\languageparameter
\c!limittext
}}
572 573
%D Just like with subsentence boundary symbols, quotes placement depends on the
574
%D current language, therefore we show the defaults here.
575
%D
576
%D \def\ShowLanguageValues [#1] [#2] #3 #4
577
%D {\blank
578
%D \startlinecorrection
579
%D \vbox\bgroup
580
%D \language[#1]
581
%D \midaligned{\bf#2 subsentence symbol and quotes}
582
%D \framed[width=\hsize,frame=off,topframe=on,bottomframe=on,offset=.5ex]
583
%D {\hfil\quotation{#3 #4}\hfil\quote{#2}\hfil
584
%D \startsubsentence\startsubsentence#3\stopsubsentence#4\stopsubsentence\hfil}
585
%D \egroup
586
%D \stoplinecorrection
587
%D \blank}
588
%D
589
%D \ShowLanguageValues [af] [afrikaans] afrikaanse ...
590
%D \ShowLanguageValues [ca] [catalan] catalan ...
591
%D \ShowLanguageValues [cs] [czech] tjechisch tex
592
%D \ShowLanguageValues [cs] [slovak] slowaakse ...
593
%D \ShowLanguageValues [da] [danish] deense ...
594
%D \ShowLanguageValues [de] [german] duitse degelijkheid
595
%D \ShowLanguageValues [en] [english] engelse humor
596
%D \ShowLanguageValues [et] [estonian] ...
597
%D \ShowLanguageValues [fi] [finnish] finse ...
598
%D \ShowLanguageValues [fr] [french] franse slag
599
%D \ShowLanguageValues [it] [italian] italiaanse ...
600
%D \ShowLanguageValues [la] [latin] latijnse missen
601
%D \ShowLanguageValues [nl] [dutch] nederlandse zuinigheid
602
%D \ShowLanguageValues [nb] [bokmal] noorse zalm
603
%D \ShowLanguageValues [nn] [nnynorsk] noorse zalm
604
%D \ShowLanguageValues [pl] [polish] poolse vlag
605
%D \ShowLanguageValues [pt] [portuguese] portugese ...
606
%D \ShowLanguageValues [es] [spanish] spaans benauwd
607
%D \ShowLanguageValues [sv] [swedish] zweedse ...
608
%D \ShowLanguageValues [tr] [turkish] turks fruit
609 610
%D We support a lot of languages. These are specified and loaded in separate files,
611
%D according to their roots. Here we only take care of (postponed) setting of the
612
%D current language.
613
%D
614
%D \unprotect
615
%D \placetable{The germanic languages (\type{lang-ger})}
616
%D \starttable[||||]
617
%D \HL
618
%D \NC \bf mnemonic \NC \bf language \NC \bf group \NC\SR
619
%D \HL
620
%D \NC \s!nl \NC dutch \NC germanic \NC\FR
621
%D \NC \s!en \NC english \NC germanic \NC\MR
622
%D \NC \s!de \NC german \NC germanic \NC\MR
623
%D \NC \s!da \NC danish \NC germanic \NC\MR
624
%D \NC \s!sv \NC swedish \NC germanic \NC\MR
625
%D \NC \s!af \NC afrikaans \NC germanic \NC\MR
626
%D \NC \s!nb \NC bokmal \NC germanic \NC\LR
627
%D \NC \s!nn \NC nynorsk \NC germanic \NC\LR
628
%D \HL
629
%D \stoptable
630
%D \protect
631
%D
632
%D \unprotect
633
%D \placetable{The italic languages (\type{lang-ita})}
634
%D \starttable[||||]
635
%D \HL
636
%D \NC \bf mnemonic \NC \bf language \NC \bf group \NC\SR
637
%D \HL
638
%D \NC \s!fr \NC french \NC italic \NC\FR
639
%D \NC \s!ca \NC catalan \NC italic \NC\MR
640
%D \NC \s!es \NC spanish \NC italic \NC\MR
641
%D \NC \s!it \NC italian \NC italic \NC\MR
642
%D \NC \s!la \NC latin \NC italic \NC\MR
643
%D \NC \s!pt \NC portuguese \NC italic \NC\LR
644
%D \HL
645
%D \stoptable
646
%D \protect
647
%D
648
%D \unprotect
649
%D \placetable{The slavic languages (\type{lang-sla})}
650
%D \starttable[||||]
651
%D \HL
652
%D \NC \bf mnemonic \NC \bf language \NC \bf group \NC\SR
653
%D \HL
654
%D \NC \s!pl \NC polish \NC slavic \NC\FR
655
%D \NC \s!cs \NC czech \NC slavic \NC\MR
656
%D \NC \s!sk \NC slavik \NC slavic \NC\LR
657
%D \HL
658
%D \stoptable
659
%D \protect
660
%D \unprotect
661
%D
662
%D \placetable{The altaic languages (\type{lang-alt})}
663
%D \starttable[||||]
664
%D \HL
665
%D \NC \bf mnemonic \NC \bf language \NC \bf group \NC\SR
666
%D \HL
667
%D \NC \s!tr \NC turkish \NC altaic \NC\SR
668
%D \HL
669
%D \stoptable
670
%D
671
%D \placetable{The uralic languages (\type{lang-ura})}
672
%D \starttable[||||]
673
%D \HL
674
%D \NC \bf mnemonic \NC \bf language \NC \bf group \NC\SR
675
%D \HL
676
%D \NC \s!fi \NC finnish \NC uralic \NC\SR
677
%D \HL
678
%D \stoptable
679
%D \protect
680 681
\unexpanded
\def
\nopatterns
{
\normallanguage
\minusone
}
682 683
%D We default to the language belonging to the interface. This is one of the few
684
%D places outside the interface modules where \type {\startinterface} is used.
685 686
\setupcurrentlanguage
[
\s!en
]
687 688
\unexpanded
\def
\initializemainlanguage
689
{
\mainlanguage
[
\currentlanguage
]
%
690
\showmessage
\m!languages
9
\currentlanguage
}
691 692
%D New:
693 694
\let
\stopexceptions
\relax
695 696
\unexpanded
\def
\startexceptions
697
{
\dosingleempty
\lang_basics_start_exceptions
}
698 699
\def
\lang_basics_start_exceptions
[#
1
]#
2
\stopexceptions
% multilingual or not?
700
{
\begingroup
701
\edef
\askedlanguage
{
\reallanguagetag
{
#
1
}}
%
702
\ifempty
\askedlanguage
703
\let
\askedlanguage
\currentlanguage
704
\fi
705
\clf_setlanguageexceptions
{
\askedlanguage
}{
#
2
}
%
706
\endgroup
}
707 708
\unexpanded
\def\hyphenation
709
{
\clf_setlanguageexceptions
{
\currentlanguage
}}
710 711
%D For the moment here:
712 713
\uchyph
1
% also treat uppercase
714
\exhyphenchar
4
5
% to permit breaking at explicit hyphens
715 716
%D New:
717 718
\unexpanded
\def
\traceddiscretionary
#
1
#
2
#
3
%
719
{
\dontleavehmode
720
\discretionary
{
\darkred
#
1
}{
\darkgreen
#
2
}{
\darkblue
#
3
}}
721 722
\unexpanded
\def
\samplediscretionary
723
{
\traceddiscretionary
724
{
pre
\clf_currentprehyphenchar
}
%
725
{
\clf_currentposthyphenchar
post
}
%
726
{
replace
}}
727 728
% todo: make this configurable
729 730
\protect
\endinput
731