Opened 6 years ago

Last modified 3 years ago

#57746 new defect

coreutils date: localized output keeps C locale order — at Version 1

Reported by: ednl (Ewoud Dronkert) Owned by:
Priority: Normal Milestone:
Component: ports Version: 2.5.4
Keywords: Cc:
Port: coreutils

Description (last modified by ednl (Ewoud Dronkert))

Concerning: macOS 10.14.2, MacPorts 2.5.4, coreutils 8.30, GNU date. I use the nl_NL.UTF-8 locale on my Mac:

$ locale
LANG="nl_NL.UTF-8"
LC_COLLATE="nl_NL.UTF-8"
LC_CTYPE="nl_NL.UTF-8"
LC_MESSAGES="nl_NL.UTF-8"
LC_MONETARY="nl_NL.UTF-8"
LC_NUMERIC="nl_NL.UTF-8"
LC_TIME="nl_NL.UTF-8"
LC_ALL=

The localized output of `date' does translate the day and month names (but not the timezone, which is expected maybe) but keeps the C-locale order:

$ LC_ALL=C /opt/local/bin/date
Sat Dec  8 11:32:02 CET 2018
$ LC_ALL=nl_NL.UTF-8 /opt/local/bin/date
za dec  8 11:32:24 CET 2018

That order is the same for any other locale. However, the order for my locale should be "%a %e %b %Y %X %Z" as found in the macOS locale definition:

$ /bin/date
za  8 dec 2018 11:54:44 CET
$ cat /usr/share/locale/nl_NL.ISO8859-1/LC_TIME | grep %Z
%a %e %b %Y %X %Z

(There is no separate UTF-8 definition for LC_TIME.) Or on my Debian system, which is (effectively) the same:

$ cat /usr/share/i18n/locales/nl_NL | grep -A2 date_fmt
date_fmt       "<U0025><U0061><U0020><U0025><U0065><U0020><U0025><U0062>/
<U0020><U0025><U0059><U0020><U0025><U006B><U003A><U0025><U004D><U003A>/
<U0025><U0053><U0020><U0025><U005A>"

There is no /opt/local/share/i18n/ directory on my MacPorts installation. Is that the problem? Or should the definitions from /usr/share/locale/ be used? It definitely seems wrong that the names are localized but the order isn't.

Change History (1)

comment:1 Changed 6 years ago by ednl (Ewoud Dronkert)

Description: modified (diff)
Note: See TracTickets for help on using tickets.