Hi,

When printing a date in French, I would like to convert the "1" to
"1\ier", but it does not work as I expect:

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

How could I get "1\ier\ novembre 2023" please?

TIA for any help,
-- 
           Peter
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki     : https://wiki.contextgarden.net
___________________________________________________________________________________

Reply via email to