summaryrefslogtreecommitdiff
path: root/tex/context/base/mult-ini.mkiv
diff options
context:
space:
mode:
authorHans Hagen <pragma@wxs.nl>2008-03-10 23:20:00 +0100
committerHans Hagen <pragma@wxs.nl>2008-03-10 23:20:00 +0100
commite4c575ea1e6cb242b3b8441eb4febc0e469412f2 (patch)
tree5ddbbc41a6aea426dac1386905e1a0953b2ca3b6 /tex/context/base/mult-ini.mkiv
parentf0302311dd47bf250c0e2b5f8be46f21437f43d8 (diff)
downloadcontext-e4c575ea1e6cb242b3b8441eb4febc0e469412f2.tar.gz
stable 2008.03.10 23:20
Diffstat (limited to 'tex/context/base/mult-ini.mkiv')
-rw-r--r--tex/context/base/mult-ini.mkiv41
1 files changed, 41 insertions, 0 deletions
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