[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Dates in coreutils with zh_CN (simplified chinese) locales
From: |
Pádraig Brady |
Subject: |
Re: Dates in coreutils with zh_CN (simplified chinese) locales |
Date: |
Tue, 22 Mar 2016 15:24:33 +0000 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0 |
On 22/03/16 14:28, Ondřej Vašík wrote:
Hi,
as reported in https://bugzilla.redhat.com/show_bug.cgi?id=1319594 , ls
-lh shows unexpected date format in simplified chinese.
When user executes "ls -lh" in Simplified Chinese locale, the output is:
$ ls -lh
总用量 168K
-rw-rw-r--. 1 guest guest 165K 3月 21 14:27 coreutils.po
He expects it to be
Expected results:
总用量 168K
-rw-rw-r--. 1 guest guest 165K 3月21日 14:27 coreutils.po
Command ls uses "%b %e %H:%M" format for dates. %b means locale abbreviated
name of month
, %e means space padded day of month (no locales mentioned there). This may be
the reason,
but I'm not sure what's the upstream position here.
In addition, when using
LC_ALL=zh_CN date , it shows the "month" chinese letter there as expected -
using nl_langinfo().
Yes date(1) picks the higher level date_fmt which hardcodes the desired
character:
$ LC_TIME=zh_CN.utf8 locale date_fmt
%Y年 %m月 %d日 %A %H:%M:%S %Z
What's your opinion? Where should we request such change (if anywhere)?
glibc? Coreutils translation project? Or not really a bug?
ls translates the "%b %e %H:%M" (new files) and "%b %e %Y" (old files),
so it would be supported by providing the appropriate translation
to the zh team at translationproject.org. I can see it's not translated
currently using:
$ LC_MESSAGES=zh_CN.utf8 gettext coreutils "%b %e %H:%M"
%b %e %H:%M
In the mean time one can override the defaults with:
export TIME_STYLE='+%b%e日 %Y
%b%e日 %H:%M'
cheers,
Pádraig.