ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Wolfgang Schuster <wolfgang.schuster.lists@gmail.com>
To: mailing list for ConTeXt users <ntg-context@ntg.nl>,
	autumnus <ai2472206007@yeah.net>
Subject: [NTG-context] Re: Weird date output
Date: Sat, 11 Jan 2025 18:17:40 +0100	[thread overview]
Message-ID: <231b160a-cb78-4128-90e6-8b78e7b20b6e@gmail.com> (raw)
In-Reply-To: <173657211217.1763.10893119771823225568@cgl.ntg.nl>

Am 11.01.2025 um 06:08 schrieb autumnus:
> hi,
> 
> When I try to output the Chinese date with the command below,
> I find that it doesn't process the month at all. No matter how
> I try any of the "month,month:cn-a,month:cn-c,month:cn-d" conversions
> Unless I pre-set the labeltext for the Chinese month.
> 
> %%%%
> \definedfont[name:adobesongstdlight]
> \currentdate[year:cn-d,年,month:cn-a,day:cn,号]  %output : 二〇二五年January 十一号
> 
> \setuplabeltext [en][january={一月},]
> \currentdate[year:cn-d,年,month:cn-a,day:cn,号]  %output : 二〇二五年一月 十一号
> %%%%
> 
> If so, then when should I use those conversion method ?
> (At present, the output of "month:cn-d" is only suitable for the year, not the month and day.
>   Its naming is somewhat misleading)
> 
> What's more, there seems to be a strange space here between the month and the day.
> It should output 二〇二五年一月十一号 instead 二〇二五年一月 十一号


1. You can't apply a number conversion for months.

2. You can switch languages to get label texts for chinese.

\starttext

\currentdate[month,day]

\language[cn]
\definedfont[name:adobesongstdlight]
\currentdate[month,day:cn]

\stoptext

3. The space after the month is inserted on purpose to get a space 
between the month and  day as can be seen in the example above. To 
prevent this auto space for chinese a language check can be added to the 
date command.

Wolfgang

___________________________________________________________________________________
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	other threads:[~2025-01-11 17:18 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-01-11  5:08 [NTG-context] " autumnus 
2025-01-11 17:17 ` Wolfgang Schuster [this message]
2025-01-12  5:16   ` [NTG-context] " autumnus 
2025-01-12 11:11     ` Tomáš Hála
2025-01-12 13:27       ` autumnus 
2025-01-12 13:31         ` autumnus 
2025-01-13 16:43     ` Wolfgang Schuster
2025-01-13 18:02       ` Hans Hagen
2025-01-13 19:09         ` Wolfgang Schuster
2025-01-13 20:33           ` Hans Hagen
2025-01-14 12:08             ` autumnus 

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=231b160a-cb78-4128-90e6-8b78e7b20b6e@gmail.com \
    --to=wolfgang.schuster.lists@gmail.com \
    --cc=ai2472206007@yeah.net \
    --cc=ntg-context@ntg.nl \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).