ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* Ctx & Lua: determination of the language being used
@ 2010-11-25 11:49 Procházka Lukáš Ing. - Pontex s. r. o.
  2010-11-25 12:13 ` Wolfgang Schuster
  0 siblings, 1 reply; 9+ messages in thread
From: Procházka Lukáš Ing. - Pontex s. r. o. @ 2010-11-25 11:49 UTC (permalink / raw)
  To: ConTeXt

Hello,

how to determine the current language being used in Ctx source via Lua? I mean soumething like:

---
\mainlanguage[cz]

\starttext
   AAA

   \startluacode
     if     context.mainlanguage == "cz" then -- Do something specific
       context("Ahoj!")
     elseif context.mainlanguage == "en" then -- Do something specific
       context("Hello!")
     else
     end
   \stopluacode
\stoptext
---

So is there something like 'context.mainlanguage' or 'context.mainlanguage()' or 'tex.mainlanguage' or ...?

Best regards,

Lukas


-- 
Ing. Lukáš Procházka [mailto:LPr@pontex.cz]
Pontex s. r. o.      [mailto:pontex@pontex.cz] [http://www.pontex.cz]
Bezová 1658
147 14 Praha 4

Tel: +420 244 062 238
Fax: +420 244 461 038

___________________________________________________________________________________
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
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2010-11-26  9:22 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-11-25 11:49 Ctx & Lua: determination of the language being used Procházka Lukáš Ing. - Pontex s. r. o.
2010-11-25 12:13 ` Wolfgang Schuster
2010-11-25 12:31   ` Taco Hoekwater
2010-11-25 13:16     ` Procházka Lukáš Ing. - Pontex s. r. o.
2010-11-25 13:22       ` Taco Hoekwater
2010-11-25 13:43         ` Procházka Lukáš Ing. - Pontex s. r. o.
2010-11-25 15:13           ` Taco Hoekwater
2010-11-25 15:57             ` Hans Hagen
2010-11-26  9:22               ` Taco Hoekwater

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).