lang-tra.mkiv /size: 2725 b    last modification: 2021-10-28 13:50
1%D \module
2%D   [       file=lang-tra,
3%D        version=2020.10.31,
4%D          title=\CONTEXT\ Language Macros,
5%D       subtitle=Transliteration,
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\writestatus{loading}{ConTeXt Language Macros / Transliteration}
15
16\registerctxluafile{lang-tra}{}
17
18\unprotect
19
20\definesystemattribute[transliteration][public,global]
21
22\installcorenamespace {transliteration}
23
24\unexpanded\def\definetransliteration
25  {\dodoubleempty\lang_transliteration_define}
26
27\unexpanded\def\lang_transliteration_define[#1][#2]%
28  {\clf_definedtransliteration{#1}{#2}}
29
30\unexpanded\def\settransliteration[#1]%
31  {\clf_settransliteration{#1}}
32
33\unexpanded\def\starttransliteration[#1]%
34  {\begingroup
35   \clf_settransliteration{#1}}
36
37\unexpanded\def\stoptransliteration
38  {\endgroup}
39
40\unexpanded\def\resettransliteration
41  {\c_attr_transliteration\attributeunsetvalue}
42
43\appendtoks
44    \resettransliteration
45\to \everyinitializeverbatim
46
47\protect \endinput
48
49% \setupbodyfont[dejavu]
50%
51% \input lang-tra.mkiv
52%
53% \definetransliteration[serbian][serbian to latin]
54%
55% \starttext
56%
57% \settransliteration[serbian to latin]
58%
59% \startchapter[title={АБВ ГДЕ ЖЗИЙ КЛМНОП РСТУ ФХЦЧ ШЩЪЬ ЮЯ}]
60%     АБВ ГДЕ ЖЗИЙ КЛМНОП РСТУ ФХЦЧ ШЩЪЬ ЮЯ
61%     \start
62%         \settransliteration[serbian to latin]
63%         АБВ ГДЕ ЖЗИЙ КЛМНОП РСТУ ФХЦЧ ШЩЪЬ ЮЯ
64%     \stop
65%     АБВ ГДЕ ЖЗИЙ КЛМНОП РСТУ ФХЦЧ ШЩЪЬ ЮЯ
66% \stopchapter
67%
68% \resettransliteration
69%
70% \startchapter[title={АБВ ГДЕ ЖЗИЙ КЛМНОП РСТУ ФХЦЧ ШЩЪЬ ЮЯ}]
71%     АБВ ГДЕ ЖЗИЙ КЛМНОП РСТУ ФХЦЧ ШЩЪЬ ЮЯ
72%     \start
73%         \settransliteration[serbian to latin]
74%         АБВ ГДЕ ЖЗИЙ КЛМНОП РСТУ ФХЦЧ ШЩЪЬ ЮЯ
75%     \stop
76%     АБВ ГДЕ ЖЗИЙ КЛМНОП РСТУ ФХЦЧ ШЩЪЬ ЮЯ
77% \stopchapter
78%
79% \definehead[ChapterA][chapter]
80% \definehead[ChapterB][chapter]
81%
82% \startsetups s-to-l
83%     \settransliteration[serbian to latin]
84%     \red
85% \stopsetups
86%
87% % maybe we need a setups key for this
88% % hm, \definesetups [xxx] [aa,bb,cc]
89%
90% \setuphead[ChapterB][commandbefore=\setups{s-to-l}]
91%
92% \startChapterA[title={АБВ ГДЕ ЖЗИЙ КЛМНОП РСТУ ФХЦЧ ШЩЪЬ ЮЯ}]
93% \stopChapterA
94%
95% \startChapterB[title={АБВ ГДЕ ЖЗИЙ КЛМНОП РСТУ ФХЦЧ ШЩЪЬ ЮЯ}]
96% \stopChapterB
97%
98% \stoptext
99