![](https://secure.gravatar.com/avatar/74d41c3215dcdd377343cdc47311757c.jpg?s=120&d=mm&r=g)
Peter Münster schrieb am 30.05.2024 um 23:22:
On Thu, May 30 2024, Wolfgang Schuster wrote:
The \date mechanism can only use conversions which are defined on the Lua side
Ok. How please?
This does not work:
--8<---------------cut here---------------start------------->8--- \startluacode -- from https://wiki.contextgarden.net/Command/defineconversion: interfaces.implement { name = "FRdate", public = true, arguments = "string", actions = function(s) local n = tonumber(s) if n == 1 then context"1\\ier" else context(s) end end } \stopluacode \def\ier{\highordinalstr{er}} \mainlanguage[fr] \defineconversion[frd][\FRdate] \setuplanguage[fr][date={day:frd,\ ,month,\ ,year}] \starttext Conversion: \convertnumber{frd}{1}, \convertnumber{frd}{2} (OK)\\ Dates: \date[d=1], \date[d=2] (not OK) \stoptext --8<---------------cut here---------------end--------------->8---
\startluacode function converters.peter(n) return "X-" .. converters.romannumerals(n) end \stopluacode \starttext \date[d=1][X-,day:romannumerals] \date[d=1][day:peter] \stoptext Wolfgang