On 2014-03-01 07:32, Wolfgang Schuster wrote:
Am 27.02.2014 um 05:08 schrieb Rik Kabel <cont...@rik.users.panix.com>:

{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
___________________________________________________________________________________
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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

Reply via email to