%D \module %D [ file=mult-ini, %D version=2008.02.15, %D title=\CONTEXT\ Multilingual Macros, %D subtitle=Initialization, %D author=Hans Hagen, %D date=\currentdate, %D copyright={PRAGMA / Hans Hagen \& Ton Otten}] %C %C This module is part of the \CONTEXT\ macro||package and is %C therefore copyrighted by \PRAGMA. See mreadme.pdf for %C details. \unprotect \registerctxluafile{mult-ini}{1.001} \def\startmessages #1 library: #2 % {\bgroup \doifundefined{\m!prefix!#2}{\setgvalue{\m!prefix!#2}{#2}}% \catcode13=\active \doifinsetelse{#1}{\currentresponses,all}\dostartmessages\nostartmessages{#2}} \def\dostartmessages#1#2\stopmessages {\ctxlua{interfaces.setmessage("#1",[[#2]])}% \egroup} \def\nostartmessages#1#2\stopmessages {\egroup} \unexpanded\def\setmessagetext #1#2{\edef\currentmessagetext{\ctxlua{tex.sprint(tex.ctxcatcodes,interfaces.getmessage("#1","#2"))}}} \unexpanded\def\getmessage #1#2{\ctxlua{tex.sprint(tex.ctxcatcodes,interfaces.getmessage("#1","#2"))}} \unexpanded\def\makemessage #1#2#3{\ctxlua{tex.sprint(tex.ctxcatcodes,interfaces.makemessage("#1","#2","#3"))}} \unexpanded\def\showmessage #1#2#3{\ctxlua{interfaces.showmessage("#1","#2","#3")}} %D This way we also have the keywords at the lua end: \def\dowithinterfaceconstant#1#2{\ctxlua{interfaces.setconstant("#1","#2")}} \def\dowithinterfacevariable#1#2{\ctxlua{interfaces.setvariable("#1","#2")}} \protect \endinput