Bug 2388

Summary: [PATCH] week-ndays;week-1stday;week-1stweek data for some locales
Product: glibc Reporter: Michal Marek <mmarek>
Component: localedataAssignee: GNU C Library Locale Maintainers <libc-locales>
Status: RESOLVED FIXED    
Severity: minor CC: carlos, dsegan, glibc-bugs, samuel.thibault, sbrabec
Priority: P2 Flags: fweimer: security-
Version: unspecified   
Target Milestone: ---   
Host: Target:
Build: Last reconfirmed:
Attachments: glibc-2.3.90-locale-weekstart.diff

Description Michal Marek 2006-02-23 12:16:03 UTC
Attached patch adds the 'week' keyword to some locales which do not have it yet.
It is based on translations of Gtk+ calendar (the old way of determining week
start in Gtk+ calendar). It needs some review, I can only test whether the
calendar works the same way with old Gtk+ (not using glibc localedata for week
starts) and new Gtk+ (using glibc localedata for week starts).

See also:
https://bugzilla.novell.com/show_bug.cgi?id=104417
https://bugzilla.novell.com/show_bug.cgi?id=130787
http://bugzilla.gnome.org/show_bug.cgi?id=314473
Comment 1 Michal Marek 2006-02-23 12:17:15 UTC
Created attachment 891 [details]
glibc-2.3.90-locale-weekstart.diff
Comment 2 Dwayne Grant McConnell 2006-02-27 16:14:15 UTC
I was looking at bug 181 last week and it is related in that it deals with
first_weekday and first_workday. Is "week" something that has been standardized?
what do the three numeric fields mean in "week    7;19971130;7"? Your change
affects a lot of localdata files but what about the C code which relies on them?
I see locale/categories.def and locale/programs/ld-time.c refer to first_weekday
and first_workday. Should these be changed as well?
Comment 3 Stanislav Brabec 2006-02-28 21:08:48 UTC
Code is OK. The problem is, that current localedata seems to be buggy and
contain nonsenses (see referenced bug reports). The buggy behavior has never
been experience before, because no package was using it (except locale binary).
(Michal verified all packages of SuSE Linux 10.1.)

But now gtk2 started to use it (gtk calendar in gtk+-2.8.x and later; util-linux
has the related cal code commented out) and gtk calendar shows nonsenses in many
locales.

The numbers has following meaning: how many days has a week ; when week system
started ; how many days must have first week in the year
Comment 4 Stanislav Brabec 2006-02-28 21:14:47 UTC
Related for hu_HU locale: bug 1429
Comment 5 Denis Barbier 2006-03-08 22:05:59 UTC
Other informations are also available at
  https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=80212
Anyway locale writers are still in the dark because it is
unclear whether GNU libc is going to follow this ISO 14652
technical report or not.

In Debian, only first_weekday is taken into account, the week
keyword is ignored for now until GTK is fixed.
Michal, you may have a look at
 
http://svn.debian.org/wsvn/pkg-glibc/glibc-package/trunk/debian/patches/localedata/first_weekday.diff?op=file
our patch differs from yours for many locales.  One reason
may be that your patch is derived from a PO file and is thus
language-based whereas this feature is really country-based,
consider fr_CA for instance.
Comment 6 Ulrich Drepper 2006-04-10 18:19:15 UTC
I added a couple of changes to cvs but only those which we think we know are right.

I'm not going to apply a general patch like any of those proposed.  I require
need buy-in from the locale author.  If there are none listed of if contacting
them fails find some piece of evidence only to support the change.

What I don't want is changing something just to later get complaints that the
change is bad.
Comment 7 Stanislav Brabec 2006-04-11 09:38:49 UTC
OK. But current week start data are broken for sure, too.

Please let me know, whether glibc will plan to use "week_start" or ISO 14652
"week" lines. I will try to contact translators and ask them for confirmation
(actually I have more issues to collect from them - preferred setup of LANGUAGE
variable, missing transliteration support in locales,...).

---

We searched over all our distribution, and it seems, that no package actually
uses it: util-linux's cal has this part commented out (because it gave bad
results), upstream gtk+ uses glibc week start, but most distributions patch gtk+
to not use these data (and use po filess fallbacks) or patch glibc to fix these
data (because they got complains).

Our based on gtk+ fallbacks in po files are better (and provided by native
speakers), but still not correct, because they are language based, not
language+country based. I am not sure, what is the source of Debian patch, but
we can start by comparing them.
Comment 8 keld@dkuug.dk 2006-04-11 20:56:06 UTC
Subject: Re:  [PATCH] week-ndays;week-1stday;week-1stweek data for some locales

On Tue, Apr 11, 2006 at 09:38:49AM -0000, sbrabec at suse dot cz wrote:
> 
> ------- Additional Comments From sbrabec at suse dot cz  2006-04-11 09:38 -------
> OK. But current week start data are broken for sure, too.
> 
> Please let me know, whether glibc will plan to use "week_start" or ISO 14652
> "week" lines. I will try to contact translators and ask them for confirmation
> (actually I have more issues to collect from them - preferred setup of LANGUAGE
> variable, missing transliteration support in locales,...).

I am also interested in tidying up the data. If I can be of help, please
contact me.

> ---
> 
> We searched over all our distribution, and it seems, that no package actually
> uses it: util-linux's cal has this part commented out (because it gave bad
> results), upstream gtk+ uses glibc week start, but most distributions patch gtk+
> to not use these data (and use po filess fallbacks) or patch glibc to fix these
> data (because they got complains).
> 
> Our based on gtk+ fallbacks in po files are better (and provided by native
> speakers), but still not correct, because they are language based, not
> language+country based. I am not sure, what is the source of Debian patch, but
> we can start by comparing them.

The way forward I think is to have the data in good shape, then the sw
can begin to use it. 

best regards
keld
Comment 9 Ulrich Drepper 2007-10-14 18:05:31 UTC
I'm closing this bug.  Lots of locales have been changed.  Grab bag bugs like
this one are not helpful since every locale must be treated separately.  If you
thinkg there are still problems left open new and *separate* bugs for each locale.