Bug 1319594

Summary: [CJK] when use "ls -lh", the date/time format is incorrect.
Product: [Fedora] Fedora Reporter: Peng Wu <pwu>
Component: coreutilsAssignee: Ondrej Vasik <ovasik>
Status: CLOSED UPSTREAM QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 24CC: admiller, kdudka, kzak, ooprala, ovasik, p, twaugh
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-03-24 07:29:25 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

Description Peng Wu 2016-03-21 07:35:59 UTC
Description of problem:

When use "ls -lh" in English locale, the output is:
$ ls -lh
total 168K
-rw-rw-r--. 1 guest guest 165K Mar 21 14:27 coreutils.po

When use "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


Version-Release number of selected component (if applicable):
coreutils-8.25-5.fc24.x86_64

How reproducible:
run "ls -lh" in English and Simplified Chinese locale.

Steps to Reproduce:
1. log-in with Simplified Chinese locale;
2. run "ls -lh";

Actual results:
总用量 168K
-rw-rw-r--. 1 guest guest 165K 3月  21 14:27 coreutils.po


Expected results:
总用量 168K
-rw-rw-r--. 1 guest guest 165K 3月21日 14:27 coreutils.po


Additional info:
For Simplified Chinese users, the expected data/time is:
3月21日 14:27

Comment 1 Ondrej Vasik 2016-03-22 08:15:20 UTC
Thanks for report. 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.
However, I see e.g. date command uses nl_langinfo() and it gets the date string format expected by you.

You can adjust the ls output to what you expect with --time-style option - as it supports +format style. (e.g.  LC_ALL=zh_CN ./ls -lh --time-style="+%b %e日 %H:%M" ). 

As this is upstream behaviour, we can ask there whether it is expected or not and if it could be changed.

Comment 2 Peng Wu 2016-03-22 08:47:08 UTC
Maybe "%b%e日 %H:%M" is better for Simplified Chinese.

Please ask the upstream, Thanks!

Comment 3 Ondrej Vasik 2016-03-22 14:17:54 UTC
For upstream, we need to come up with generic solution, not just something for zh_CN ... therefore this time-style can't be hardcoded ;).

Comment 4 Ondrej Vasik 2016-03-23 08:22:40 UTC
Upstream suggested to contact translation project. As on the http://translationproject.org/domain/coreutils.html I can see quite a lot of missing translations for Simplified Chinese, I'm quite sure this is not the only issue. We can't fix this downstream - having patches for every single message string and locale doesn't scale, we rely on the translations from translationproject.org. Based on this, I tend to close this issue on Fedora bugzilla side - probably WONTFIX. Are you going to contact translation project contact for Simplified Chinese yourself or would you prefer me to send him an email, informing him about this bugzilla and asking about his plans?

Comment 5 Peng Wu 2016-03-24 05:08:17 UTC
Okay, I will contact Aron Xu.

Comment 6 Peng Wu 2016-03-24 06:55:38 UTC
Email sent.

Comment 7 Ondrej Vasik 2016-03-24 07:29:25 UTC
Thanks, I'll close this one UPSTREAM on Fedora side, as both coreutils and coreutils translationproject.org were notified about this gap and I'm not going to solve this with downstream patch. It will get fixed once new version of coreutils is released upstream when translation string is adjusted.

Comment 8 Jens Petersen 2016-03-25 06:35:15 UTC
This also affects Japanese and I believe Korean too.