GNU bug report logs - #19856
Bad month translation printed with date command in Greek locale

Previous Next

Package: coreutils;

Reported by: "Nick & John" <levelwol <at> gmail.com>

Date: Fri, 13 Feb 2015 17:13:01 UTC

Severity: normal

Done: Paul Eggert <eggert <at> cs.ucla.edu>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 19856 in the body.
You can then email your comments to 19856 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-coreutils <at> gnu.org:
bug#19856; Package coreutils. (Fri, 13 Feb 2015 17:13:01 GMT) Full text and rfc822 format available.

Acknowledgement sent to "Nick & John" <levelwol <at> gmail.com>:
New bug report received and forwarded. Copy sent to bug-coreutils <at> gnu.org. (Fri, 13 Feb 2015 17:13:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: "Nick & John" <levelwol <at> gmail.com>
To: bug-coreutils <at> gnu.org
Subject: Bad month translation printed with date command in Greek locale
Date: Fri, 13 Feb 2015 15:46:48 +0200
Hello we are Nick Barkas and Ioannis Barkas from Greece. There is an
annoying error in the date command for quite some time when using
Greek locale.
If date is instructed to print month and day of month, the translation
is wrong and looks funny...
 You have to be able to write Greek in order to understand it and
since the bug exists we assume no one from coreutils developers knows
Greek.
 As a result we will explain every month in detail as it will be Greek
to you. Remove "LC_TIME=el_GR.UTF-8" from the commands to get the date
in English.

This is what you get with "B Y" (month year), which is correct:
$ LC_TIME=el_GR.UTF-8 date +"%B %Y" -d "2015-01-01"
Ιανουάριος 2015
$ LC_TIME=el_GR.UTF-8 date +"%B %Y" -d "2015-02-01"
Φεβρουάριος 2015
$ LC_TIME=el_GR.UTF-8 date +"%B %Y" -d "2015-03-01"
Μάρτιος 2015
$ LC_TIME=el_GR.UTF-8 date +"%B %Y" -d "2015-04-01"
Απρίλιος 2015
$ LC_TIME=el_GR.UTF-8 date +"%B %Y" -d "2015-05-01"
Μάιος 2015
$ LC_TIME=el_GR.UTF-8 date +"%B %Y" -d "2015-06-01"
Ιούνιος 2015
$ LC_TIME=el_GR.UTF-8 date +"%B %Y" -d "2015-07-01"
Ιούλιος 2015
$ LC_TIME=el_GR.UTF-8 date +"%B %Y" -d "2015-08-01"
Αύγουστος 2015
$ LC_TIME=el_GR.UTF-8 date +"%B %Y" -d "2015-09-01"
Σεπτέμβριος 2015
$ LC_TIME=el_GR.UTF-8 date +"%B %Y" -d "2015-10-01"
Οκτώβριος 2015
$ LC_TIME=el_GR.UTF-8 date +"%B %Y" -d "2015-11-01"
Νοέμβριος 2015
$ LC_TIME=el_GR.UTF-8 date +"%B %Y" -d "2015-12-01"
Δεκέμβριος 2015

This is what you get with "d B Y" (month year), which is wrong:
$ LC_TIME=el_GR.UTF-8 date +"%d %B %Y" -d "2015-01-01"
01 Ιανουάριος 2015
damn <at> rsee:~$ LC_TIME=el_GR.UTF-8 date +"%d %B %Y" -d "2015-02-01"
01 Φεβρουάριος 2015
damn <at> rsee:~$ LC_TIME=el_GR.UTF-8 date +"%d %B %Y" -d "2015-03-01"
01 Μάρτιος 2015
damn <at> rsee:~$ LC_TIME=el_GR.UTF-8 date +"%d %B %Y" -d "2015-04-01"
01 Απρίλιος 2015
damn <at> rsee:~$ LC_TIME=el_GR.UTF-8 date +"%d %B %Y" -d "2015-05-01"
01 Μάιος 2015
damn <at> rsee:~$ LC_TIME=el_GR.UTF-8 date +"%d %B %Y" -d "2015-06-01"
01 Ιούνιος 2015
damn <at> rsee:~$ LC_TIME=el_GR.UTF-8 date +"%d %B %Y" -d "2015-07-01"
01 Ιούλιος 2015
damn <at> rsee:~$ LC_TIME=el_GR.UTF-8 date +"%d %B %Y" -d "2015-08-01"
01 Αύγουστος 2015
damn <at> rsee:~$ LC_TIME=el_GR.UTF-8 date +"%d %B %Y" -d "2015-09-01"
01 Σεπτέμβριος 2015
damn <at> rsee:~$ LC_TIME=el_GR.UTF-8 date +"%d %B %Y" -d "2015-10-01"
01 Οκτώβριος 2015
damn <at> rsee:~$ LC_TIME=el_GR.UTF-8 date +"%d %B %Y" -d "2015-11-01"
01 Νοέμβριος 2015
damn <at> rsee:~$ LC_TIME=el_GR.UTF-8 date +"%d %B %Y" -d "2015-12-01"
01 Δεκέμβριος 2015

Here is what the date command should print with "d B Y" (month year),
in el_GR.UTF-8 locale:
$ LC_TIME=el_GR.UTF-8 date +"%d %B %Y" -d "2015-01-01"
01 Ιανουαρίου 2015
$ LC_TIME=el_GR.UTF-8 date +"%d %B %Y" -d "2015-02-01"
01 Φεβρουαρίου 2015
$ LC_TIME=el_GR.UTF-8 date +"%d %B %Y" -d "2015-03-01"
01 Μαρτίου 2015
$ LC_TIME=el_GR.UTF-8 date +"%d %B %Y" -d "2015-04-01"
01 Απριλίου 2015
$ LC_TIME=el_GR.UTF-8 date +"%d %B %Y" -d "2015-05-01"
01 Μαίου 2015
$ LC_TIME=el_GR.UTF-8 date +"%d %B %Y" -d "2015-06-01"
01 Ιουνίου 2015
$ LC_TIME=el_GR.UTF-8 date +"%d %B %Y" -d "2015-07-01"
01 Ιουλίου 2015
$ LC_TIME=el_GR.UTF-8 date +"%d %B %Y" -d "2015-08-01"
01 Αυγούστου 2015
$ LC_TIME=el_GR.UTF-8 date +"%d %B %Y" -d "2015-09-01"
01 Σεπτεμβρίου 2015
$ LC_TIME=el_GR.UTF-8 date +"%d %B %Y" -d "2015-10-01"
01 Οκτωβρίου 2015
$ LC_TIME=el_GR.UTF-8 date +"%d %B %Y" -d "2015-11-01"
01 Νοεμβρίου 2015
$ LC_TIME=el_GR.UTF-8 date +"%d %B %Y" -d "2015-12-01"
01 Δεκεμβρίου 2015

In Greek language things are different and complex compared to
English. We have accents (τόνους) for most words and words are not
fixed but can dynamically change depending on context.
When the month is accompanied by a day of month the accent (Greek
tonos/τόνος) changes and ...ος becomes ...ου. To fix this, use the
correct translations for months, if and only if %B
 and %d are used together. If the month is called with no day (%d)
using "%B" or if the month is called with "%d %b" or "%b" leave the
translations as they are.
Since there are many computer-science oriented Greek universities and
so many Greeks around the world, we are amazed that no one fixed it so
far.
We must also inform you that this silly bug of yours has been seen in webpages.




Information forwarded to bug-coreutils <at> gnu.org:
bug#19856; Package coreutils. (Fri, 13 Feb 2015 17:49:02 GMT) Full text and rfc822 format available.

Message #8 received at 19856 <at> debbugs.gnu.org (full text, mbox):

From: Paul Eggert <eggert <at> cs.ucla.edu>
To: Nick & John <levelwol <at> gmail.com>, 19856 <at> debbugs.gnu.org
Subject: Re: bug#19856: Bad month translation printed with date command in
 Greek locale
Date: Fri, 13 Feb 2015 09:48:17 -0800
If I understand correctly, it doesn't appear that this is a bug that coreutils 
can fix, as POSIX implies (and many programs expect) that formats like %d and %B 
and %Y act independently of context.

If it's any consolation, the default output of 'date' in the C locale:

Thu Jun 28 15:10:00 PDT 2014

is bogus for me too, as Americans by and large neither write 'Jun' as an 
abbreviation for 'June' nor use 24-hour timestamps.




Information forwarded to bug-coreutils <at> gnu.org:
bug#19856; Package coreutils. (Fri, 13 Feb 2015 17:57:02 GMT) Full text and rfc822 format available.

Message #11 received at 19856 <at> debbugs.gnu.org (full text, mbox):

From: Eric Blake <eblake <at> redhat.com>
To: Nick & John <levelwol <at> gmail.com>, 19856 <at> debbugs.gnu.org,
 Austin Group <austin-group-l <at> opengroup.org>
Subject: Re: bug#19856: Bad month translation printed with date command in
 Greek locale
Date: Fri, 13 Feb 2015 10:56:34 -0700
[Message part 1 (text/plain, inline)]
[adding the Austin Group, as this is a POSIX question]

On 02/13/2015 06:46 AM, Nick & John wrote:
> Hello we are Nick Barkas and Ioannis Barkas from Greece. There is an
> annoying error in the date command for quite some time when using
> Greek locale.

Thanks for the report.

> If date is instructed to print month and day of month, the translation
> is wrong and looks funny...
>  You have to be able to write Greek in order to understand it and
> since the bug exists we assume no one from coreutils developers knows
> Greek.
>  As a result we will explain every month in detail as it will be Greek
> to you.

I don't know if you intended that to be funny, but it makes a rather
nice play on a typical English idiom :)

> Remove "LC_TIME=el_GR.UTF-8" from the commands to get the date
> in English.
> 
> This is what you get with "B Y" (month year), which is correct:
> $ LC_TIME=el_GR.UTF-8 date +"%B %Y" -d "2015-01-01"
> Ιανουάριος 2015

> 
> This is what you get with "d B Y" (month year), which is wrong:
> $ LC_TIME=el_GR.UTF-8 date +"%d %B %Y" -d "2015-01-01"
> 01 Ιανουάριος 2015

> 
> Here is what the date command should print with "d B Y" (month year),
> in el_GR.UTF-8 locale:
> $ LC_TIME=el_GR.UTF-8 date +"%d %B %Y" -d "2015-01-01"
> 01 Ιανουαρίου 2015

> 
> In Greek language things are different and complex compared to
> English. We have accents (τόνους) for most words and words are not
> fixed but can dynamically change depending on context.
> When the month is accompanied by a day of month the accent (Greek
> tonos/τόνος) changes and ...ος becomes ...ου. To fix this, use the
> correct translations for months, if and only if %B
>  and %d are used together. If the month is called with no day (%d)
> using "%B" or if the month is called with "%d %b" or "%b" leave the
> translations as they are.

What should REALLY happen is that libc's strftime(3) (which is what
date(1) uses under the hood - the % modifiers are the same) should
support something like %OB to trigger a locale's alternative
representation, as the %O modifier is already used for other locales
that have different displays.

But right now, POSIX says %OB is undefined behavior (look for the
section on Modified Conversion Specifiers):
http://pubs.opengroup.org/onlinepubs/9699919799/functions/strftime.html

and on glibc, it does nothing:

$ LC_TIME=el_GR.UTF-8 date +"%d %OB %Y" -d "2015-12-01"
01 %OB 2015

I guess what it boils down to is that when defining a locale, the
existing 'era', 'era_d_format', 'era_t_format', and 'era_d_t_format'
affect existing %E uses, and 'alt_digits' affects existing %O uses
http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap07.html#tag_07_03_05

and the ideal solution would be adding a new locale file entry for
'alt_months' that would then let %OB provide the locale's alternate
month names.  Then you could write your string as "%d %OB %Y" to get the
grammatically correct output.

> Since there are many computer-science oriented Greek universities and
> so many Greeks around the world, we are amazed that no one fixed it so
> far.
> We must also inform you that this silly bug of yours has been seen in webpages.

Coreutils will automatically pick up any fixes in glibc, you'll need to
get it fixed there first.  It would be nice to get POSIX to standardize
%OB, but that would be easier if you could first get glibc to implement
the solution to show that it makes sense.

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

[signature.asc (application/pgp-signature, attachment)]

Information forwarded to bug-coreutils <at> gnu.org:
bug#19856; Package coreutils. (Fri, 13 Feb 2015 20:30:06 GMT) Full text and rfc822 format available.

Message #14 received at 19856 <at> debbugs.gnu.org (full text, mbox):

From: Garrett Wollman <wollman <at> csail.mit.edu>
To: Eric Blake <eblake <at> redhat.com>
Cc: 19856 <at> debbugs.gnu.org, Nick & John <levelwol <at> gmail.com>,
 Austin Group <austin-group-l <at> opengroup.org>
Subject: Re: bug#19856: Bad month translation printed with date command in
 Greek locale
Date: Fri, 13 Feb 2015 14:20:58 -0500
<<On Fri, 13 Feb 2015 10:56:34 -0700, Eric Blake <eblake <at> redhat.com> said:

> Coreutils will automatically pick up any fixes in glibc, you'll need to
> get it fixed there first.  It would be nice to get POSIX to standardize
> %OB, but that would be easier if you could first get glibc to implement
> the solution to show that it makes sense.

FreeBSD has long implemented %OB, for Russian IIRC.  It's documented
thus:

           Additionally %OB implemented to represent alternative months names
           (used standalone, without day mentioned).

-GAWollman




Information forwarded to bug-coreutils <at> gnu.org:
bug#19856; Package coreutils. (Fri, 13 Feb 2015 20:30:17 GMT) Full text and rfc822 format available.

Message #17 received at 19856 <at> debbugs.gnu.org (full text, mbox):

From: Jilles Tjoelker <jilles <at> stack.nl>
To: Garrett Wollman <wollman <at> csail.mit.edu>
Cc: 19856 <at> debbugs.gnu.org, Eric Blake <eblake <at> redhat.com>,
 Nick & John <levelwol <at> gmail.com>, Austin Group <austin-group-l <at> opengroup.org>
Subject: Re: bug#19856: Bad month translation printed with date command in
 Greek locale
Date: Fri, 13 Feb 2015 21:17:44 +0100
On Fri, Feb 13, 2015 at 02:20:58PM -0500, Garrett Wollman wrote:
> <<On Fri, 13 Feb 2015 10:56:34 -0700, Eric Blake <eblake <at> redhat.com> said:

> > Coreutils will automatically pick up any fixes in glibc, you'll need to
> > get it fixed there first.  It would be nice to get POSIX to standardize
> > %OB, but that would be easier if you could first get glibc to implement
> > the solution to show that it makes sense.

> FreeBSD has long implemented %OB, for Russian IIRC.  It's documented
> thus:

>            Additionally %OB implemented to represent alternative months names
>            (used standalone, without day mentioned).

This feature was discussed here before, and an interpretation was issued
for issue 8: http://austingroupbugs.net/view.php?id=258

The functionality already works in FreeBSD, for example:

$ LC_TIME=el_GR.UTF-8 date +"%d %B %Y"
13 Φεβρουαρίου 2015
$ LC_TIME=el_GR.UTF-8 date +"%OB %Y"
Φεβρουάριος 2015

It was implemented for Greek in 2001:
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=32120

-- 
Jilles Tjoelker




Information forwarded to bug-coreutils <at> gnu.org:
bug#19856; Package coreutils. (Fri, 13 Feb 2015 22:57:01 GMT) Full text and rfc822 format available.

Message #20 received at 19856 <at> debbugs.gnu.org (full text, mbox):

From: Eric Blake <eblake <at> redhat.com>
To: Jilles Tjoelker <jilles <at> stack.nl>, Garrett Wollman <wollman <at> csail.mit.edu>
Cc: 19856 <at> debbugs.gnu.org, Nick & John <levelwol <at> gmail.com>,
 Austin Group <austin-group-l <at> opengroup.org>
Subject: Re: bug#19856: Bad month translation printed with date command in
 Greek locale
Date: Fri, 13 Feb 2015 15:56:25 -0700
[Message part 1 (text/plain, inline)]
On 02/13/2015 01:17 PM, Jilles Tjoelker wrote:

> The functionality already works in FreeBSD, for example:
> 
> $ LC_TIME=el_GR.UTF-8 date +"%d %B %Y"
> 13 Φεβρουαρίου 2015
> $ LC_TIME=el_GR.UTF-8 date +"%OB %Y"
> Φεβρουάριος 2015
> 
> It was implemented for Greek in 2001:
> https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=32120

Thanks for reminding me of that.  Wow, 5 years where glibc has not
picked it up is a bit long; I've added information to what looks like
the most relevant glibc bug
https://sourceware.org/bugzilla/show_bug.cgi?id=12651 to see if we can
get more eyes on it and hopefully implemented for more than just BSD
systems.  It also looks like the POSIX wording is very specific on which
of the two forms is genitive vs nominative, and that glibc's current
locale is using the wrong form for %B.

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

[signature.asc (application/pgp-signature, attachment)]

Information forwarded to bug-coreutils <at> gnu.org:
bug#19856; Package coreutils. (Sat, 14 Feb 2015 09:54:01 GMT) Full text and rfc822 format available.

Message #23 received at 19856 <at> debbugs.gnu.org (full text, mbox):

From: "Andries E. Brouwer" <Andries.Brouwer <at> cwi.nl>
To: Eric Blake <eblake <at> redhat.com>
Cc: Garrett Wollman <wollman <at> csail.mit.edu>,
 Austin Group <austin-group-l <at> opengroup.org>, 19856 <at> debbugs.gnu.org,
 Nick & John <levelwol <at> gmail.com>, Jilles Tjoelker <jilles <at> stack.nl>
Subject: Re: bug#19856: Bad month translation printed with date command in
 Greek locale
Date: Sat, 14 Feb 2015 10:52:26 +0100
On Fri, Feb 13, 2015 at 03:56:25PM -0700, Eric Blake wrote:

> It also looks like the POSIX wording is very specific on which
> of the two forms is genitive vs nominative

In general such words (like genitive) are not appropriate.
Different languages have different systems of flection,
and the situation is far too complicated for POSIX to describe.

In many languages the day number is an ordinal number, not a cardinal number.
Even for English I don't know whether there is a convenient way
to generate April 1st, April 2nd. Or for French 1er avril, 2 avril.

Andries




Information forwarded to bug-coreutils <at> gnu.org:
bug#19856; Package coreutils. (Tue, 06 Mar 2018 22:48:01 GMT) Full text and rfc822 format available.

Message #26 received at 19856 <at> debbugs.gnu.org (full text, mbox):

From: Rafal Luzynski <digitalfreak <at> lingonborough.com>
To: 19856 <at> debbugs.gnu.org
Subject: bug#19856
Date: Tue, 6 Mar 2018 23:42:12 +0100 (CET)
I think I have good news for you. The roots of this bug are in glibc
project, this bug:

https://sourceware.org/bugzilla/show_bug.cgi?id=10871

It has been fixed now. But coreutils and date command line utility
does not use strftime() from glibc directly. Instead it uses fprintftime()
from Gnulib. Fortunately, the changes from glibc have been also ported
to Gnulib:

http://git.savannah.gnu.org/gitweb/?p=gnulib.git;a=commitdiff;h=4a236f1
http://git.savannah.gnu.org/gitweb/?p=gnulib.git;a=commitdiff;h=b5d3175
http://git.savannah.gnu.org/gitweb/?p=gnulib.git;a=commitdiff;h=703dcf1

(and few more).

So the only thing that needs to be done for coreutils is to bump the
version of Gnulib module used and make sure that the most recent glibc
is used. This makes %B generate the genitive case of the month name
in the languages which need it and introduces %OB (and %Ob) format specifiers
to generate the nominative case on demand. This is the same design as used
in BSD.

Regards,

Rafal




Reply sent to Paul Eggert <eggert <at> cs.ucla.edu>:
You have taken responsibility. (Tue, 06 Mar 2018 23:24:01 GMT) Full text and rfc822 format available.

Notification sent to "Nick & John" <levelwol <at> gmail.com>:
bug acknowledged by developer. (Tue, 06 Mar 2018 23:24:02 GMT) Full text and rfc822 format available.

Message #31 received at 19856-done <at> debbugs.gnu.org (full text, mbox):

From: Paul Eggert <eggert <at> cs.ucla.edu>
To: Rafal Luzynski <digitalfreak <at> lingonborough.com>
Cc: 19856-done <at> debbugs.gnu.org
Subject: Re: bug#19856: Bad month translation printed with date command in
 Greek locale
Date: Tue, 6 Mar 2018 15:23:40 -0800
[Message part 1 (text/plain, inline)]
On 03/06/2018 02:42 PM, Rafal Luzynski wrote:
> So the only thing that needs to be done for coreutils is to bump the
> version of Gnulib module used and make sure that the most recent glibc
> is used.

Thanks for letting us know. I installed the attached into coreutils 
master and marking this bug as done, since this is all that should be 
needed as far as coreutils itself is concerned.

[0001-build-update-gnulib-submodule-to-latest.patch (text/x-patch, attachment)]

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Wed, 04 Apr 2018 11:24:04 GMT) Full text and rfc822 format available.

This bug report was last modified 7 years and 134 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.