如何根据上下文修改月份名称

如何根据上下文修改月份名称

我想在上下文中更改月份名称,在 tex 中\month定义月份数,月份名称可以用以下方式重新定义\ifcase 在 \today 命令中更改月份名称

我如何在上下文中执行相同操作(修改使用\date命令出现的月份名称),\month在上下文中显示为不可用。

更新

这里是 MWE

\setuppapersize[A4]
\mainlanguage[arabic]
\setupdirections[bidi=global]
\setupalign[r2l] 

\definefontfeature
  [arabic]
  [mode=node,language=dflt,script=arab,
    init=yes,medi=yes,fina=yes,isol=yes,
    liga=yes,dlig=yes,rlig=yes,tlig=yes,
    calt=yes,trep=yes,clig=yes,
    mark=yes,mkmk=yes,kern=yes,curs=yes]


\starttypescript [serif] [arabic]
  \definefontsynonym [Arabic-Regular] [name:Amiri] [features=arabic]
  \definefontsynonym [Arabic-Bold] [name:Amiri] [features=arabic]
\stoptypescript

\starttypescript [serif] [arabic] [name]
 \usetypescript[serif][fallback]
 \definefontsynonym [Serif]     [Arabic-Regular] [features=arabic]
 \definefontsynonym [SerifBold] [Arabic-Bold]    [features=arabic]
\stoptypescript

\starttypescript [Arabic]
 \definetypeface [Arabic] [rm] [serif] [arabic] [default]
 \definetypeface [Arabic] [mm] [math]  [palatino] [default]
\stoptypescript 

\setuplayout[
  grid=min,
  backspace=20mm, width=170mm,
  topspace=10mm, height=275mm,
  header=10mm,footer=10mm,
  headerdistance=2mm
  ]

\setupbodyfont[Arabic,18pt]
\setupinterlinespace[line=30pt]

\starttext

\date

\stoptext 

答案1

如果您不想更改文档的主要语言(使用\mainlanguage[…],则可以使用以下命令重新定义月份\setuplabeltext

\setuplabeltext
  %% [en]  %% for a language specific setting
  [january=J,
   february=F]

此外,如果您想更改使用的日期格式\date,您可以这样做\setuplanguage

\setuplanguage
  %% [en]  %% for a language specific setting
  [date={year, \thinspace–\thinspace, mm, \thinspace–\thinspace, dd}]

相关内容