Am 16.05.2012 um 14:17 schrieb Peter Schorsch:
Hi,
to finish my first module I like to make it also available for non-german users (remove the hardcoded german text). But I could not figure out how in a way that works. So I wrote down a minimal example in pseudo-tex to point out my goal. Can you give me an idea/solution how to implement it in a correct way?
Thanks, P.
--8<------t-welcome.tex------------ \startmodule[welcome] \unprotect
\setupmodule[atPageText=]
%these two lines are properly totally wrong but should show the idea \define[atPageText[en]={Welcome}] \define[atPageText[de]={Willkommen}]
\def\welcome{\moduleparameter{welcome}{atPageText}}
\protect \stopmodule \endinput
--8<-------welcome.tex--------------- %this line is properly totally wrong but should show the idea \usemodule[welcome][atPageText[eo]={Bonvenon},atPageText[de]={Guten Tag}]]
\starttext
\language[en] Should be Welcome: \welcome
\language[de] Should be Guten Tag: \welcome
\language[eo] Should be Bonvenon: \welcome
\stoptext
Method 1 (mkii/mkiv): \def\welcome{\translate[en=Welcome,de=Guten Tag]} \starttext \language[en]Welcome: \welcome \language[de]Welcome: \welcome \stoptext Method 2 (mkiv only): \definelabelclass[testlabel] \setuptestlabeltext[en][welcome=Welcome] \setuptestlabeltext[de][welcome=Willkommen] \starttext \mainlanguage[en]Welcome: \testlabeltext{welcome} \mainlanguage[de]Welcome: \testlabeltext{welcome} \stoptext Wolfgang