From e4c575ea1e6cb242b3b8441eb4febc0e469412f2 Mon Sep 17 00:00:00 2001 From: Hans Hagen Date: Mon, 10 Mar 2008 23:20:00 +0100 Subject: stable 2008.03.10 23:20 --- tex/context/base/mult-ini.mkiv | 41 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 tex/context/base/mult-ini.mkiv (limited to 'tex/context/base/mult-ini.mkiv') diff --git a/tex/context/base/mult-ini.mkiv b/tex/context/base/mult-ini.mkiv new file mode 100644 index 000000000..e785624f5 --- /dev/null +++ b/tex/context/base/mult-ini.mkiv @@ -0,0 +1,41 @@ +%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 -- cgit v1.2.3