Jyrki Ruuskanen wrote:
Ok, the module is read in cont-sys.rme with \usemodule[jtex]. It initializes the lists inside protect / unprotect pair with \newtoks\usedAbbreviations and \newtoks\usedReferences along with macro definitions. first of all, here is an alternative to setting your texts; instead of doing the check-next-char stuff yourself ...
%%% handle multilingual texts (and uppercase) % usage: \setText[lang]{key}{value} \def\setText{\futurelet\testchar\maybeLangSetText} \def\maybeLangSetText% {\ifx[\testchar \let\next\langSetText \else \let\next\defaultSetText \fi \next} \def\langSetText[#1]#2#3{\def\name{#2@#1}\def\bigname{#2@#1@uppercase} \expandafter\def\csname \name \endcsname{#3} \expandafter\def\csname \bigname \endcsname{\uppercase{#3}}} \def\defaultSetText#1#2{\langSetText[\currentmainlanguage]{#1}{#2}} % usage: \getText{key} \def\langGetText[#1]#2{\def\name{#2@#1}% \expandafter\ifx\csname \name \endcsname\relax \name missing!\else\csname \name \endcsname\fi} \def\getText#1{\def\name{#1@\currentlanguage}% \expandafter\ifx\csname \name \endcsname\relax \langGetText[\currentmainlanguage]{#1} \else\langGetText[\currentlanguage]{#1}\fi} ... you can use the built in functionality: \let\dowithText\firstofoneargument \def\setText {\dosingleempty\dosetText} \def\dosetText[#1]#2#3% {\setvalue{\iffirstargument#1\else\currentmainlanguage\fi @TXT@#2}{\dowithText{#3}}} \def\getText {\let\dowithText\firstofoneargument \dosingleempty\dogetText} \def\dogetText[#1]#2% {\executeifdefined{\iffirstargument#1\else\currentlanguage\fi @TXT@#2}% {\executeifdefined{\iffirstargument#1\else\currentmainlanguage\fi @TXT@#2}% {missing #2}}} \def\getUppercaseText {\let\dowithText\WORD \dosingleempty\dogetText} \starttext \setText{oeps}{whatever} \setText[de]{oeps}{de-whatever} \getText{oeps} \getText[de]{oeps} \getUppercaseText{oeps} \getUppercaseText[de]{oeps} \stoptext but, when possible, use: \setuplabeltext[oeps=whatever] \setuplabeltext[de][oeps=de-whatever] {\labeltext{oeps} \mainlanguage[de] \labeltext{oeps} \LABELTEXT{oeps}} because that is kind of integrated Hans ----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com | www.pragma-pod.nl -----------------------------------------------------------------