Re: [NTG-context] Ctx & Lua: determination of the language being used

2010-11-26 Thread Taco Hoekwater
On 11/25/2010 04:57 PM, Hans Hagen wrote: however, tex does not privide access to the current language It does: \ctxlua{print(tex.language)} ___ If your question is of interest to others as well, please add an en

Re: [NTG-context] Ctx & Lua: determination of the language being used

2010-11-25 Thread Hans Hagen
On 25-11-2010 4:13, Taco Hoekwater wrote: On 11/25/2010 02:43 PM, Procházka Lukáš Ing. - Pontex s. r. o. wrote: ... And using this in a separate file is also what I'd need. So do I have to do something like: Something like that, yes. But it depends a little on what you want to do: because \cur

Re: [NTG-context] Ctx & Lua: determination of the language being used

2010-11-25 Thread Taco Hoekwater
On 11/25/2010 02:43 PM, Procházka Lukáš Ing. - Pontex s. r. o. wrote: ... And using this in a separate file is also what I'd need. So do I have to do something like: Something like that, yes. But it depends a little on what you want to do: because \currentmainlanguage expands, you will get the

Re: [NTG-context] Ctx & Lua: determination of the language being used

2010-11-25 Thread Procházka Lukáš Ing . - Pontex s . r . o .
On Thu, 25 Nov 2010 14:22:18 +0100, Taco Hoekwater wrote: On 11/25/2010 02:16 PM, Procházka Lukáš Ing. - Pontex s. r. o. wrote: No, nothing as complicated as that: \currentmainlanguage is an expandable macro, so it simply expands to its actual content: cs This also means that my proposed so

Re: [NTG-context] Ctx & Lua: determination of the language being used

2010-11-25 Thread Taco Hoekwater
On 11/25/2010 02:16 PM, Procházka Lukáš Ing. - Pontex s. r. o. wrote: So does it mean that "\" (in the beginning of a string) in Lua for ConTeXt is a "hack" which expands a (Con)TeX(t) internal value (in the case that is not a valid escape char)? No, nothing as complicated as that: \currentma

Re: [NTG-context] Ctx & Lua: determination of the language being used

2010-11-25 Thread Procházka Lukáš Ing . - Pontex s . r . o .
... Thanks to both. So - On Thu, 25 Nov 2010 13:31:36 +0100, Taco Hoekwater wrote: On 11/25/2010 01:13 PM, Wolfgang Schuster wrote: Am 25.11.2010 um 12:49 schrieb Procházka Lukáš Ing. - Pontex s. r. o.: Hello, how to determine the current language being used in Ctx source via Lua? I mean

Re: [NTG-context] Ctx & Lua: determination of the language being used

2010-11-25 Thread Taco Hoekwater
On 11/25/2010 01:13 PM, Wolfgang Schuster wrote: Am 25.11.2010 um 12:49 schrieb Procházka Lukáš Ing. - Pontex s. r. o.: Hello, how to determine the current language being used in Ctx source via Lua? I mean soumething like: --- \mainlanguage[cz] \starttext AAA \startluacode if

Re: [NTG-context] Ctx & Lua: determination of the language being used

2010-11-25 Thread Wolfgang Schuster
Am 25.11.2010 um 12:49 schrieb Procházka Lukáš Ing. - Pontex s. r. o.: > 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"

[NTG-context] Ctx & Lua: determination of the language being used

2010-11-25 Thread Procházka Lukáš Ing . - Pontex s . r . o .
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" th