Jyrki Ruuskanen wrote:
> Ok, the module is read in cont-sys.rme with \usemodule[jtex]. It 
> initializes the lists inside protect / unprotect pair with 
> \newtoks\usedAbbreviations and \newtoks\usedReferences along with 
> macro definitions.
first of all, here is an alternative to setting your texts; instead of doing 
the check-next-char stuff yourself ...

%%% handle multilingual texts (and uppercase)
% usage: \setText[lang]{key}{value}
\def\setText{\futurelet\testchar\maybeLangSetText}
\def\maybeLangSetText%
        {\ifx[\testchar \let\next\langSetText
        \else \let\next\defaultSetText \fi \next}
[EMAIL PROTECTED]@[EMAIL PROTECTED]
        \expandafter\def\csname \name \endcsname{#3}
        \expandafter\def\csname \bigname \endcsname{\uppercase{#3}}}
\def\defaultSetText#1#2{\langSetText[\currentmainlanguage]{#1}{#2}}

% usage: \getText{key}
[EMAIL PROTECTED]
        \expandafter\ifx\csname \name \endcsname\relax
        \name missing!\else\csname \name \endcsname\fi}
[EMAIL PROTECTED]
        \expandafter\ifx\csname \name \endcsname\relax
        \langGetText[\currentmainlanguage]{#1}
        \else\langGetText[\currentlanguage]{#1}\fi}


... you can use the built in functionality: 

\let\dowithText\firstofoneargument

\def\setText
  {\dosingleempty\dosetText}

\def\dosetText[#1]#2#3%
  {\setvalue{\iffirstargument#1\else\currentmainlanguage\fi @[EMAIL PROTECTED]

\def\getText
  {\let\dowithText\firstofoneargument
   \dosingleempty\dogetText}

\def\dogetText[#1]#2%
  {\executeifdefined{\iffirstargument#1\else\currentlanguage\fi @[EMAIL 
PROTECTED]
     {\executeifdefined{\iffirstargument#1\else\currentmainlanguage\fi @[EMAIL 
PROTECTED]
        {missing #2}}}

\def\getUppercaseText
  {\let\dowithText\WORD
   \dosingleempty\dogetText}


\starttext

\setText{oeps}{whatever}
\setText[de]{oeps}{de-whatever}

\getText{oeps}
\getText[de]{oeps}
\getUppercaseText{oeps}
\getUppercaseText[de]{oeps}

\stoptext

but, when possible, use: 

\setuplabeltext[oeps=whatever]
\setuplabeltext[de][oeps=de-whatever]

{\labeltext{oeps} \mainlanguage[de] \labeltext{oeps} \LABELTEXT{oeps}}

because that is kind of integrated 

Hans 


-----------------------------------------------------------------
                                          Hans Hagen | PRAGMA ADE
              Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
     tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com
                                             | www.pragma-pod.nl
-----------------------------------------------------------------

_______________________________________________
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context

Reply via email to