bug-coreutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

output of 'date' is not properly localized


From: Benno Schulenberg
Subject: output of 'date' is not properly localized
Date: Sun, 31 Aug 2008 13:50:24 +0200
User-agent: KMail/1.9.9

Hi,

On http://www.opengroup.org/onlinepubs/000095399/utilities/date.html 
it says under the examples:

$ LANG=da_DK.iso_8859-1 date
ons 02 okt 1991 15:03:32 CET

But when coreutils' current date is used (with LC_TIME and LC_ALL 
unset):

$ LANG=da_DK.utf8 src/date
søn aug 31 13:21:21 CEST 2008

The day and month are reversed and the year is at the end instead of 
after the month.  For Dutch the same misformat is used: an American 
format with only the abbreviations translated to Dutch.

date uses 'nl_langinfo (_DATE_FMT)', but the manpage for nl_langinfo 
does not mention _DATE_FMT; it only lists D_T_FMT, D_FMT and T_FMT.

After applying the attached first patch (changing _DATE_FMT to 
D_T_FMT) things are correct (using libc-2.7):

$ LANG=da_DK.utf8 date
søn 31 aug 2008 13:24:32 CEST


The second patch removes a comment that seems mistaken, because it 
doesn't take into account that LC_TIME could be for example da_DK.  
Alternatively, it could let translators specify a fallback format 
by doing something like this:

  setlocale (LC_MESSAGES, getlocale (LC_TIME));
  format = _("%a %b %e %H:%M:%S %Z %Y");
  setlocale (LC_ALL, "");

Benno

Attachment: 0017-date-call-nl_langinfo-with-proper-argument.patch
Description: Text Data

Attachment: 0018-date-correct-a-non-localization-comment.patch
Description: Text Data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]