Bug 525134 - Several en_* locales using ISO date format
Summary: Several en_* locales using ISO date format
Keywords:
Status: CLOSED NEXTRELEASE
Alias: None
Product: Fedora
Classification: Fedora
Component: coreutils
Version: 11
Hardware: All
OS: Linux
low
low
Target Milestone: ---
Assignee: Ondrej Vasik
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2009-09-23 14:05 UTC by Daniel Qarras
Modified: 2010-04-22 15:40 UTC (History)
8 users (show)

Fixed In Version: coreutils-8.4-5.fc13
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2010-04-22 12:07:28 UTC


Attachments (Terms of Use)

Description Daniel Qarras 2009-09-23 14:05:59 UTC
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):
glibc-common-2.10.1-5.i586

How reproducible:
Always

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 14:40:01 UTC
That's just the default if there is no translation for the time style in your locale.

Comment 2 Ondrej Vasik 2009-09-23 15:52:07 UTC
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 18:04:50 UTC
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 19:32:27 UTC
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 05:42:26 UTC
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 06:21:05 UTC
Yep, I'll try to write something today ...

Comment 7 Pádraig Brady 2009-10-06 14:24:31 UTC
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 10:26:28 UTC
Hmm, to me it seems that this is fixed in Fedora 12 Beta + updates.

Comment 9 Ondrej Vasik 2009-10-22 10:52:43 UTC
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 17:21:38 UTC
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
glibc-common-2.10.90-25.i686
coreutils-7.6-5.fc12.i686
localhost:~>

Comment 11 Daniel Qarras 2010-04-21 16:31:59 UTC
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
glibc-common-2.11.90-20.i686
coreutils-8.4-5.fc13.i686
localhost:~>

Comment 12 Ondrej Vasik 2010-04-22 12:07:28 UTC
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 15:19:35 UTC
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 15:35:49 UTC
In coreutils-8.4 tarball in po/en.po is translation for 
#: src/ls.c:733
msgid "%b %e  %Y"
msgstr "%b %e  %Y"
and
#: 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 15:40:04 UTC
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 ).


Note You need to log in before you can comment on or make changes to this bug.