Hi, Sounds like a job for the blocks mechanism more so than buffers: \defineblock[entext] \defineblock[nltext] \defineselector [language] [max=2,n=1] \startmode[en] \setupselector[language][n=1] \keepblocks[entext] \stopmode \startmode[nl] \setupselector[language][n=2] \keepblocks[nltext] \stopmode \starttext \startsection[title=\select{language}{English title}{Dutch title}] \beginentext This is English text. \endentext \beginnltext This is Dutch text. \endnltext \stopsection \stoptext Best wishes, Taco
On 4 Sep 2020, at 14:02, Jan Willem Flamma
wrote: Dear list member,
Following up from: https://www.mail-archive.com/ntg-context@ntg.nl/msg94719.html
The below MWE works but how can I avoid having to type \startmode[en] \getbuffer[en] \stopmode \startmode[nl] \getbuffer[nl] \stopmode
after every block of text?
I tried to define a new start/stop pair as follows: \definestartstop[Bufen][ before={\startmode[en] \startbuffer[en]}, after={\stopbuffer \getbuffer[en] \stopmode}]
but that fails.
No doubt a clever solution exists that minimizes the typing.
Kind regards, Jan Willem
=== \setupinteraction[state=start]
%\enablemode[nl] \enablemode[en]
\defineselector [language] [max=2,n=1] \startmode[en] \setupselector[language][n=1] \stopmode \startmode[nl] \setupselector[language][n=2] \stopmode
\starttext
\startsection[title=\select{language}{English title}{Dutch title}]
\startbuffer[en] This is English text. \stopmode \stopbuffer \startbuffer[nl] This is Dutch text. \stopbuffer
\startmode[en] \getbuffer[en] \stopmode \startmode[nl] \getbuffer[nl] \stopmode
\stopsection
\stoptext
___________________________________________________________________________________ If your question is of interest to others as well, please add an entry to the Wiki!
maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___________________________________________________________________________________
Taco Hoekwater Elvenkind BV