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

[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 then --

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 then -- Do

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 Procházka Lukáš Ing . - Pontex s . r . o .
... Thanks to both. So - On Thu, 25 Nov 2010 13:31:36 +0100, Taco Hoekwater t...@elvenkind.com 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

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 \char (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 char is not a valid escape char)? No, nothing as complicated as that:

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 t...@elvenkind.com 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

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