Bug 225864 - malformed dates with current Catalan timedef files
Summary: malformed dates with current Catalan timedef files
Status: In Progress
Alias: None
Product: Base System
Classification: Unclassified
Component: standards (show other bugs)
Version: CURRENT
Hardware: Any Any
: --- Affects Many People
Assignee: freebsd-standards (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-02-13 13:42 UTC by Robert Buj Gelonch
Modified: 2020-12-08 07:49 UTC (History)
2 users (show)

See Also:


Attachments
Timedef settings for Catalan (1.42 KB, patch)
2018-02-18 05:37 UTC, Robert Buj Gelonch
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Robert Buj Gelonch 2018-02-13 13:42:43 UTC
We get malformed dates with current Catalan timedef files.

1. date_fmt should be "%A, %e %B de %Y, %X %Z", and not "%A, %e de %B de %Y, %X %Z".

2. "Long month names (without case ending)" it should not be equal to "Long month names (as in a date)". "Long month names (without case ending)" is used with %E* %O* (see man strftime).

------------

Desired output after modifying /usr/src/share/timedef/ca_IT.UTF-8.src (also applicable to ca_IT.ISO8859-15.src)

# cd /usr/src/share/timedef && make && make install
# python3.6
Python 3.6.4 (default, Jan  2 2018, 01:25:35) 
[GCC 4.2.1 Compatible FreeBSD Clang 4.0.0 (tags/RELEASE_400/final 297347)] on freebsd11
Type "help", "copyright", "credits" or "license" for more information.
>>> from time import gmtime, strftime, mktime
>>> import locale
>>> locale.setlocale(locale.LC_TIME, "ca_ES.UTF-8")
'ca_ES.UTF-8'
>>> strftime("%A, %d %B del %Y a les %H:%M:%S")
'dimarts, 13 de febrer del 2018 a les 15:21:12'
>>> strftime("%OB")
'febrer'
>>> strftime("%B")
'de febrer'
>>>                           

# LANG=ca_ES.UTF-8 date
dimarts, 13 de febrer de 2018, 15:33:20 CET

# cat /usr/src/share/timedef/ca_IT.UTF-8.src 
# Warning: Do not edit. This file is automatically generated from the
# tools in /usr/src/tools/tools/locale. The data is obtained from the
# CLDR project, obtained from http://cldr.unicode.org/
# -----------------------------------------------------------------------------
#
# Short month names
gen.
febr.
març
abr.
maig
juny
jul.
ag.
set.
oct.
nov.
des.
#
# Long month names (as in a date)
de gener
de febrer
de març
d’abril
de maig
de juny
de juliol
d’agost
de setembre
d’octubre
de novembre
de desembre
#
# Short weekday names
dg.
dl.
dt.
dc.
dj.
dv.
ds.
#
# Long weekday names
diumenge
dilluns
dimarts
dimecres
dijous
divendres
dissabte
#
# X_fmt
%H:%M:%S
#
# x_fmt
%d/%m/%Y
#
# c_fmt
%a %e %b %X %Y
#
# AM/PM
a. m.
p. m.
#
# date_fmt
%A, %e %B de %Y, %X %Z
#
# Long month names (without case ending)
gener
febrer
març
abril
maig
juny
juliol
agost
setembre
octubre
novembre
desembre
#
# md_order
dm
#
# ampm_fmt
%I:%M:%S %p
# EOF
Comment 1 Robert Buj Gelonch 2018-02-18 05:37:25 UTC
Created attachment 190742 [details]
Timedef settings for Catalan
Comment 2 Yuri Pankov freebsd_committer freebsd_triage 2018-10-28 01:22:59 UTC
I'm not sure if we should use GNU extensions (%-*) in format strings.

Robert, would it be correct to use the format strings and months names from pre-CLDR versions of the data:

https://svnweb.freebsd.org/base/head/share/timedef/ca_ES.ISO8859-1.src?revision=174990&view=markup&pathrev=289260

https://svnweb.freebsd.org/base/head/share/timedef/ca_ES.UTF-8.src?revision=174990&view=markup&pathrev=289260
Comment 3 Yuri Pankov freebsd_committer freebsd_triage 2018-10-28 01:36:11 UTC
And, if possible, please submit a change request for the CLDR data: http://cldr.unicode.org/index/bug-reports.
Comment 4 Robert Buj Gelonch 2018-10-28 07:22:49 UTC
(In reply to Yuri Pankov from comment #3)
CLDR is up to date http://st.unicode.org/cldr-apps/v#/ca/Gregorian/9aa3b64aaf1346b
Comment 5 Robert Buj Gelonch 2018-10-28 08:18:22 UTC
(In reply to Yuri Pankov from comment #2)
No.

The date format improvements for Catalan are already collected in last CLDR, the genitive form of a month name in a date is obligatory in Catalan (e.g. 1 de gener de 2019) and word sequences such as d'abril, d'agost i d'octubre are shortened (e.g. 28 d'octubre de 2019). Other changes: short month names, short day names, am/pm,

(example: fedora 28+gnome+glibc) Correct date formats in Czech, Catalan, Greek, and Lithuanian
http://lingonborough.com/fedora-28-updates-for-czech-catalan-greek-and-lithuanian-users/
Comment 6 Yuri Pankov freebsd_committer freebsd_triage 2018-10-28 12:16:26 UTC
Thanks for the pointers.  I have created review D17737 updating timedef for Catalan from latest CLDR data (34.0).  Could you please take a look at it to make sure it's correct?
Comment 7 Robert Buj Gelonch 2018-10-28 17:13:13 UTC
1. You should remove leading zeros in day and month numbers; change %e with %-e; %d with %-d; %m with %-m:

# c_fmt
%A, %-e %B de %Y a les %H:%M:%S

# date_fmt (EEEE, d MMMM 'de' y 'a' 'les' H:mm:ss zzzz)
%A, %-e %B de %Y a les %H:%M:%S %Z

# x_fmt (d/M/yy)
%-d/%-m/%y

2. You should change Long month names (without case ending) which are not equal to Long month names (as in a date):

# Long month names (without case ending)
gener
febrer
març
abril
maig
juny
juliol
agost
setembre
octubre
novembre
desembre
Comment 8 Robert Buj Gelonch 2018-10-29 02:55:06 UTC
(In reply to Yuri Pankov from comment #6)

1. You should remove leading zeros in day and month numbers; change %e with %-e; %d with %-d; %m with %-m:

# c_fmt
%A, %-e %B de %Y a les %H:%M:%S

# date_fmt (EEEE, d MMMM 'de' y 'a' 'les' H:mm:ss zzzz)
%A, %-e %B de %Y a les %H:%M:%S %Z

# x_fmt (d/M/yy)
%-d/%-m/%y

2. You should change Long month names (without case ending) which are not equal to Long month names (as in a date):

# Long month names (without case ending)
gener
febrer
març
abril
maig
juny
juliol
agost
setembre
octubre
novembre
desembre