After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 87977 - First day of week should not be Sunday
First day of week should not be Sunday
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: Widget: Other
unspecified
Other All
: Normal normal
: future
Assigned To: gtk-bugs
gtk-bugs
: 98888 103014 114198 123447 127045 130076 137144 150567 156373 315942 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2002-07-12 00:15 UTC by Christian Rose
Modified: 2005-09-11 00:28 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
patch (1.28 KB, patch)
2003-05-11 23:05 UTC, Matthias Clasen
none Details | Review
ignore-the-option approach (4.70 KB, patch)
2003-07-19 19:38 UTC, Matthias Clasen
committed Details | Review

Description Christian Rose 2002-07-12 00:15:08 UTC
The calendar widget currently displays Sunday as first day of week by
default. This is wrong for some locales like "sv" where Monday is always
used as first day of week
(http://www.se.gnome.org/sv/lokal/datum_och_tid/index.en.html). The first
day of week default should depend on the locale used.
Comment 1 Owen Taylor 2002-07-23 02:37:23 UTC
Since the starting day of the week is currently exported in the
API, changing this would be a (fairly minor) incompatible API
change.
Comment 2 Vincent Untz 2002-11-19 20:06:39 UTC
*** Bug 98888 has been marked as a duplicate of this bug. ***
Comment 3 Dmitry G. Mastrukov 2002-12-22 09:56:04 UTC
"ru" locale has Monday as starting day of week too.
Comment 4 Yanko Kaneti 2002-12-22 11:19:50 UTC
same for Bulgarian

also it seems this information is present in the glibc 2.2.x and above
locales  (albeit not allways correct, as with the sv locale)
Comment 5 Mark McLoughlin 2003-01-12 03:46:12 UTC
*** Bug 103014 has been marked as a duplicate of this bug. ***
Comment 6 Matthias Clasen 2003-05-11 23:05:22 UTC
Here is a patch which makes the default week-start-day locale-dependent.
Since getting this information from nl_langinfo() is a glibc
extension, I decided to not use nl_langinfo(), but the "magic
translated string" technique. 
Comment 7 Matthias Clasen 2003-05-11 23:05:58 UTC
Created attachment 16439 [details] [review]
patch
Comment 8 Owen Taylor 2003-07-18 22:01:22 UTC
- Braces misplaced

- We should describe "GTK_CALENDAR_WEEK_START_MONDAY" and
  the property as deprecated in the docs, though we can't really 
  deprecatean enumeration value using the #ifndef GTK_DISABLE_DEPRECATED 
  very well.

- I don't think having a property's default value correspond
  depend on the locale works. One of the ideas of the default
  value is that when serializing an interface, you can omit
  properties that are equal to the default.

  I think we probably should go with the blah_set convention
  like GtkTextTag, where if the property isn't explicitely
  set then we use the value from the locale. See 
  gtk_toolbar_unset_style() for an example of something
  like this in the C API.

  The much simpler alternative is to simply ignore 
  GTK_CALENDAR_WEEK_START_MONDAY entirely and use the value
  from the locale; I don't know if we can get away with
  that. Searching cvs.gnome.org/lxr for uses might 
  tell you something.


Comment 9 Matthias Clasen 2003-07-19 19:20:14 UTC
Hmm, using the "blah_set" approach doesn't really work here, since
there is no explicit setter for week_start_monday, just a
set_display_options(). So setting any display option would end up
marking week_start_monday as explictly set, to either true or false.

I'll code up the "ignore the setting approach". lxr does what it
always does to me, it doesn't work. Can't even find WEEK_START_MONDAY
in gtk...
  
Comment 10 Matthias Clasen 2003-07-19 19:38:57 UTC
Created attachment 18444 [details] [review]
ignore-the-option approach
Comment 11 Matthias Clasen 2003-08-08 22:44:57 UTC
The last patch got committed after some cleanups.
Comment 12 Mark McLoughlin 2003-09-19 10:55:21 UTC
*** Bug 114198 has been marked as a duplicate of this bug. ***
Comment 13 Vincent Untz 2003-09-29 23:18:35 UTC
*** Bug 123447 has been marked as a duplicate of this bug. ***
Comment 14 Vincent Untz 2003-11-17 16:46:01 UTC
*** Bug 127045 has been marked as a duplicate of this bug. ***
Comment 15 Vincent Untz 2004-01-06 21:54:47 UTC
*** Bug 130076 has been marked as a duplicate of this bug. ***
Comment 16 Guille -bisho- 2004-02-04 00:13:12 UTC
I have a problem with this patch.
I have:
LANG=en
LC_ALL=es_ES

That's because I want to read the strings of the programs in its
original english, but I want other formats (Numeric, monetary, time)
set to spanish.

The days of the week are shown correctly in spanish, but the week
starts on Sunday, as opposed to spanish time format, that begins on
monday.

A friend told me that you are not using nl_langinfo() to discover the
time properties, because is not portable, and using instead a strings
translation method.

I think it could be solved using the strings translation method, but
using as LANG the language set in LC_TIME, in spite of the original
LANG setting of the user.

In that way, one could use LANG=en and LC_TIME=es without problems.
Comment 17 Guille -bisho- 2004-02-04 00:20:04 UTC
Bug #102416 is also affected.

I see also the date wrong:
   miércoles, febrero 04 2004
Instead of:
   miércoles 04 febrero 2004

The weekday is translated, but the order is taken from the LANG setting.
Comment 18 Carlos Perelló Marín 2004-02-04 00:22:08 UTC
First, you are using incorrectly the variables.

LC_ALL is a macro to set all LC_* vars to the same value.

You should use instead:

LANG=es_ES
LC_MESSAGES=en

That way is more correct.

About this bug report... Your proposal have a problem, you need a call
to setlocale to change the locale where you get the strings from and
that function is not thread safe.
Comment 19 Guille -bisho- 2004-02-06 02:16:34 UTC
And there is no way of making a call to gettext specifying a distinct
locale?

Any idea?
Comment 20 Guille -bisho- 2004-02-06 02:43:26 UTC
Hi carlos. I was testing you suggestion of the locale settings:
LANG=es_ES
LC_MESSAGES=en

And now I get the "date" output in english:
$ export
declare -x LANG="es_ES"
declare -x LC_MESSAGES="en"
$ date
Fri Feb  6 03:27:42 CET 2004

Even after setting:
$ export LC_TIME="es_ES"
$ date
Fri Feb  6 03:29:40 CET 2004

Is the LC_TIME set to the same value of the LC_MESSAGES?
I can't set time in spanish and strings in english with your suggested
LC/LANG settings.
Comment 21 Carlos Perelló Marín 2004-02-06 10:46:51 UTC
There is a way to choose a different locale, but it's new and it's not
available in all systems (you need latest glibc, same problem that
nl_langinfo).

Also, what's the problem with the data output?

The problem you are having with date it's just that you don't have the
needed locale support.

look at /etc/locale.gen and add the needed locales.

Remember that es_ES != es_ES@euro you need the full locale string.

You should add also the en_EN locale and use it instead of "en"
Comment 22 Guille -bisho- 2004-02-06 14:14:24 UTC
Maybe we can put ifdefs for the glibc way of work, or set an option on
gconf to override. I think this is not a common setup, so I don't mind
to tweak the setting in the gconf-editor.

I tried both es_ES and es_ES@euro with same results:
$ export
declare -x LANG="es_ES@euro"
declare -x LC_MESSAGES="en"
$ date
Fri Feb  6 15:10:21 CET 2004
$ export LC_TIME=es_ES@euro
$ date
Fri Feb  6 15:11:03 CET 2004

Only with:
$ export LC_ALL=es_ES@euro
$ date
vie feb  6 15:11:43 CET 2004

(perhaps is a problem of my distro)
Comment 23 Carlos Perelló Marín 2004-02-06 16:34:04 UTC
The problem is with "en", you must use a valid locale string, just add
the en_EN locale to your locale.gen file and rebuild the locale database.

This is an offtopic problem, please, send any future comment directly
to me.

About the #ifdefs... I'm looking at something like that for other
library. If I get something interesting I will try to expand it to any
other module that needs it.
Comment 24 Vincent Untz 2004-03-14 12:40:08 UTC
*** Bug 137144 has been marked as a duplicate of this bug. ***
Comment 25 Matthias Clasen 2004-06-25 04:05:50 UTC
I'm closing this bug now, since the original problem was fixed. If you feel
strongly about the mixed locale use cases, please file a separate bug and attach
a patch to optionally use nl_langinfo() if it is available.
Comment 26 Vincent Untz 2004-10-29 11:01:04 UTC
*** Bug 150567 has been marked as a duplicate of this bug. ***
Comment 27 Vincent Untz 2004-10-29 11:02:58 UTC
*** Bug 156373 has been marked as a duplicate of this bug. ***
Comment 28 Pierre Ossman 2005-06-17 20:31:40 UTC
People should check bug 163842 which implements this in a more correct way (on
most platforms atleast).
Comment 29 Allison Karlitskaya (desrt) 2005-09-11 00:28:51 UTC
*** Bug 315942 has been marked as a duplicate of this bug. ***