Bug 525134

Summary: Several en_* locales using ISO date format
Product: [Fedora] Fedora Reporter: Daniel Qarras <dqarras>
Component: coreutilsAssignee: Ondrej Vasik <ovasik>
Status: CLOSED NEXTRELEASE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: low Docs Contact:
Priority: low    
Version: 11CC: jakub, jim, kdudka, meyering, ovasik, p, schwab, twaugh
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Fixed In Version: coreutils-8.4-5.fc13 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2010-04-22 08:07:28 EDT Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Description Daniel Qarras 2009-09-23 10:05:59 EDT
Description of problem:
localhost:~> LC_ALL=C ls -ld /
drwxr-xr-x. 21 root root 4.0K Sep 23 16:34 /
localhost:~> LC_ALL=en_US ls -ld /
drwxr-xr-x. 21 root root 4.0K 2009-09-23 16:34 /
localhost:~> LC_ALL=en_CA ls -ld /
drwxr-xr-x. 21 root root 4.0K 2009-09-23 16:34 /
localhost:~> LC_ALL=de_DE ls -ld /
drwxr-xr-x. 21 root root 4,0K 23. Sep 16:34 /
localhost:~> LC_ALL=da_DK ls -ld /
drwxr-xr-x. 21 root root 4,0K 23 sep 16:34 /

Correct me if I'm wrong but I expected especially en_US to match C/POSIX date format but it now seems to use the ISO time format. Few releases back this was not the case.

Version-Release number of selected component (if applicable):

How reproducible:

Steps to Reproduce:
1. See the description
Actual results:
Several en_* locales using ISO date format

Expected results:
Applicable en_* locales using native date format

Additional info:
Comment 1 Andreas Schwab 2009-09-23 10:40:01 EDT
That's just the default if there is no translation for the time style in your locale.
Comment 2 Ondrej Vasik 2009-09-23 11:52:07 EDT
Caused by this upstream commit : http://git.savannah.gnu.org/cgit/coreutils.git/commit/?id=6837183d42a0ccdf7b7106794ea693c5b609aea5 . Adding upstream maintainer - as maybe at least en_* (without translation) should be handled differently.
Comment 3 Jim Meyering 2009-09-23 14:04:50 EDT
The problem may be that something is going wrong at install time.
Note that po/Makefile.in.in's install-data-yes rule loops over EXTRA_LOCALE_CATEGORIES, which bootstrap sets to LC_TIME.
That loop is supposed to create many locale-related symlinks.
If some part of that rule is failing for some locales, that could
explain why ls is detecting invalid locale settings and reverting to ISO.
Comment 4 Ondrej Vasik 2009-09-23 15:32:27 EDT
Jim: I don't think that's the case. 

Simply: Default for long_time_format[2] is { N_("%b %e  %Y"),  N_("%b %e %H:%M")
). In ls.c (case locale_time_style)  is dcgettext (NULL, long_time_format[i], LC_TIME); ... that translates the string, but the translation is THE SAME as the default - as the format is the same for en_* locales.

And after that is check:
if (locale_format == long_time_format[i])
    goto case_long_iso_time_style;

That check is coming from the commit mentioned in comment #2 - and causes fallback to long_iso_time_style - and overriding translated time format for english locales. So at least this check should not be performed for en_* locales (but is quite strange to expect that noone will have default time format at all).
Comment 5 Jim Meyering 2009-09-25 01:42:26 EDT
Ah!  I see what you mean.  That does look like an upstream bug.
Do you feel like writing the patch you suggest?
Comment 6 Ondrej Vasik 2009-09-25 02:21:05 EDT
Yep, I'll try to write something today ...
Comment 7 Pádraig Brady 2009-10-06 10:24:31 EDT
Just to update. There are 108 languages on my fedora 11 box with this "issue".
It's been decided to wait for other reports before changing this 4 year old behaviour: http://lists.gnu.org/archive/html/bug-coreutils/2009-09/msg00433.html
Comment 8 Daniel Qarras 2009-10-22 06:26:28 EDT
Hmm, to me it seems that this is fixed in Fedora 12 Beta + updates.
Comment 9 Ondrej Vasik 2009-10-22 06:52:43 EDT
That's strange, because I did no such update - I'm waiting for upstream decision (or better said for another complain).
Comment 10 Daniel Qarras 2009-10-23 13:21:38 EDT
Whoops, please ignore my statement that this would be fixed, still an issue it seems:

localhost:~> LC_ALL=C ls -ld /
dr-xr-xr-x. 21 root root 4.0K Oct 23 19:25 /
localhost:~> LC_ALL=en_US ls -ld /
dr-xr-xr-x. 21 root root 4.0K 2009-10-23 19:25 /
localhost:~> LC_ALL=en_CA ls -ld /
dr-xr-xr-x. 21 root root 4.0K 2009-10-23 19:25 /
localhost:~> LC_ALL=de_DE ls -ld /
dr-xr-xr-x. 21 root root 4,0K 23. Okt 19:25 /
localhost:~> LC_ALL=da_DK ls -ld /
dr-xr-xr-x. 21 root root 4,0K 23 okt 19:25 /
localhost:~> rpm -q glibc-common coreutils
Comment 11 Daniel Qarras 2010-04-21 12:31:59 EDT
I think this works now as expected on F13ß:

localhost:~> unset TIME_STYLE
localhost:~> LC_ALL=C ls -ld /
dr-xr-xr-x. 22 root root 4.0K Apr 21 19:11 /
localhost:~> LC_ALL=en_US ls -ld /
dr-xr-xr-x. 22 root root 4.0K Apr 21 19:11 /
localhost:~> LC_ALL=en_CA ls -ld /
dr-xr-xr-x. 22 root root 4.0K Apr 21 19:11 /
localhost:~> LC_ALL=de_DE ls -ld /
dr-xr-xr-x. 22 root root 4,0K 21. Apr 19:11 /
localhost:~> LC_ALL=da_DK ls -ld /
dr-xr-xr-x. 22 root root 4,0K 21 apr 19:11 /
localhost:~> rpm -q glibc-common coreutils
Comment 12 Ondrej Vasik 2010-04-22 08:07:28 EDT
Thanks, confirmed ... english translation file is now part of coreutils in F-13/rawhide. As I don't plan to fix that in F-11 and F-12, closing that NEXTRELEASE.
Comment 13 Pádraig Brady 2010-04-22 11:19:35 EDT
which rpm has the translation?
This is a fairly large change (people are temperamental about ls format).
If we're making the change, then perhaps we should do it consistently
for all languages with the upstream patch referenced in comment #7
Comment 14 Ondrej Vasik 2010-04-22 11:35:49 EDT
In coreutils-8.4 tarball in po/en.po is translation for 
#: src/ls.c:733
msgid "%b %e  %Y"
msgstr "%b %e  %Y"
#: src/ls.c:746
msgid "%b %e %H:%M"
msgstr "%b %e %H:%M"

Therefore en_* locales are no longer affected. Those languages without translated time/date format message string for ls.c:733/746 will fallback to ISO date format as before... so I think it is still consistent, but english locales now have correct date format instead of the ISO format.
Comment 15 Ondrej Vasik 2010-04-22 11:40:04 EDT
If you are searching for rpms, coreutils-8.4 are in rawhide and F-13 (you could either use its beta repo or http://koji.fedoraproject.org/koji/buildinfo?buildID=155772 ).