On 2014-03-01 07:32, Wolfgang Schuster wrote:
Am 27.02.2014 um 05:08 schrieb Rik Kabel
:
{useful information on TL2013 and starttexdefinition skipped}
BTW: It’s better to follow contexts rules and use start/stop for environments, this way you can make use of the buffer mechanism to store text.
\unexpanded\def\startTranslation {\begingroup \dosingleempty\dostartTranslation}
\def\dostartTranslation[#1]% {\iffirstargument \getrawparameters[Translation][setups=,language=en,#1]% \fi \grabbufferdata[Translation][startTranslation][stopTranslation]}
\def\stopTranslation {\language[\Translationlanguage]% \Translationsetups (\,\getbufferdata[Translation]\removeunwantedspaces\,)% \endgroup}
\starttext
\startTranslation[language=nl] It betrays a slow-witted mentality to pursue the streams, but not to see the sources of things. \stopTranslation
\stoptext
Thank you for the excellent example. The only problem I see is that it fails if no optional argument is present (in which case the keyval settings \TranslationXXX never get defined). This is easily remedied by removing the \iffirstargument and \fi wrapping the \getrawparameters. -- Rik