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 145549 - gdm should use LC_TIME to choose its default clock format
gdm should use LC_TIME to choose its default clock format
Status: RESOLVED FIXED
Product: gdm
Classification: Core
Component: general
2.6.0.x
Other Linux
: Normal normal
: ---
Assigned To: GDM maintainers
GDM maintainers
: 161178 331532 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2004-07-07 07:36 UTC by Nicolas Mailhot
Modified: 2006-02-17 12:53 UTC
See Also:
GNOME target: ---
GNOME version: 2.9/2.10


Attachments
Patch to remove special setting for 24 hour clock and use locale data (8.38 KB, patch)
2005-07-15 07:10 UTC, Tommi Vainikainen
none Details | Review
12/24/auto option for time format (15.16 KB, patch)
2005-07-26 10:06 UTC, Tommi Vainikainen
none Details | Review

Description Nicolas Mailhot 2004-07-07 07:36:11 UTC
Specifying the time format in configuration files is broken because :

1. the system already has a way to specify it (LC_TIME)

2. distributions maintainers do not allow modifications to the gdm configuration
file anymore (seems they are disgusted over past incompatible format changes)

3. Just try to put 24h format in a lab worth of systems and you'll feel the pain

As any correctly localized app gdm should use the system locale by default
Comment 1 Brian Cameron 2005-04-07 18:56:23 UTC
*** Bug 161178 has been marked as a duplicate of this bug. ***
Comment 2 Tommi Vainikainen 2005-07-15 07:10:42 UTC
Created attachment 49209 [details] [review]
Patch to remove special setting for 24 hour clock and use locale data

LC_TIME does _not_ contain way to specify this time format. 't_fmt' field of
locale's LC_TIME contains only time format with seconds included, but GDM
currently uses only hour and minutes. So either it needs to be changed to
contain also seconds (which may not be nice with remote greeters) or LC_TIME
cannot be used.

Reading NEWS file, somewhere around version 2.4 this option was added because
some people with locale using AM/PM markers weren't happy but wanted to use 24
hour format.

So if it is possible to get rid of such madness :-D, I have attached a patch to
use time format according to language (this is LANG, not LC_TIME). This is what
almost every other GNOME application does, so it should not be that bad, but on
the other hand it decreases configurability of GDM.
Comment 3 Nicolas Mailhot 2005-07-18 09:59:47 UTC
You can always use LANG if nothing is specified, and allow format override in
the conf file.

And anyway you'll note that the change was done to accomodate some people that
wanted 24h time, and resulted in everyone getting AM/PM time by default. Which
was not exactly the intended effect
Comment 4 Brian Cameron 2005-07-19 05:14:19 UTC
This patch looks good to me, you can commit it.  I noticed that you updated the
docs so that it no longer mentions anything about the 24Hour format option. 
This is good, but please add an "Environment Variable" section to the
"Configuration" section of gdm.xml explaining how to sysadmins can change the
time format using the new environment variable interfaces.  Thanks.
Comment 5 Tommi Vainikainen 2005-07-25 08:17:59 UTC
After making the patch I've became a bit suspicious about how good idea this
will be. If this patch gets applied, it will be inpossible to have some
configurations because LANG selects also 12/24 clock, and it looks like some
people want English interface and 24 hour clock even the 12 hour clock is more
common.
Thus setting LANG to something selects both language and time format and mixing
those is not possible because LANG can have only one value at time. :-)

Maybe correct patch would make 24hour (or clock format) setting to have three
possible values: locale (default), 12hour, and 24hour. Then it would be possible
to mix between different languages and clock formats.
Comment 6 Brian Cameron 2005-07-25 19:34:29 UTC
Yes, supporting three options (12/24/locale) sounds the best to me.  Making the
default "locale" also seems reasonable.
Comment 7 Danilo Segan 2005-07-26 06:55:30 UTC
As already said, what POSIX locales provide is not sufficient for all
applications.  Any workaround about LC_TIME limits is just that: a workaround.

See the discussion in bug #307121 about introducing a new API and library for
all this.

Because of that, I don't see big value in caring about this now, because the
default "locale" option would still have %S in most cases, which you want to
avoid (and default would end up being almost everywhere).
Comment 8 Nicolas Mailhot 2005-07-26 07:37:07 UTC
Speaking as a stupid user, I'd rather have seconds by default with a manual
override for those stations that are network-accessed, than AM by default which
forces me to reconfigure every single system after a gdm update
Comment 9 Danilo Segan 2005-07-26 07:56:26 UTC
I was talking about 12/24 vs. 12/24/locale. GDM will get a default from
translation with Tommi's patch (i.e. LC_MESSAGES, LANGUAGE, LANG), so all you
need to do is have your translation complete.

I may be missing something, though.
Comment 10 Nicolas Mailhot 2005-07-26 08:04:06 UTC
Then let's rephrase the proposal:

change time format display to 12/24/auto with auto as default
Comment 11 Tommi Vainikainen 2005-07-26 10:06:50 UTC
Created attachment 49766 [details] [review]
12/24/auto option for time format

Here is now 12/24/auto patch. It uses the same Use24Clock setting in [greeter]
but in addition to "true", and "false", it is possible to set as "auto" (or
technically speaking anything which does not start with [tTyY] (true) nor
[fFnN] (false)).

I've also removed this option from gdmsetup, because Simplicity(tm) is good for
you. :-)  So it is only available with $EDITOR <configfile>.  Rationale: I
think that only rarely users want to set this.
Comment 12 Brian Cameron 2005-07-26 19:00:47 UTC
It looks good, except I think more docs are needed in docs/C/gdm.xml.  You
should explain how environment variables are expected to be set when using auto
mode, and
what environment variables GDM depends upon for this to work.  Please update the
docs and commit.
Comment 13 Tommi Vainikainen 2005-07-26 20:27:28 UTC
Committed, but after that I noticed yesterday was start of UI freeze, and as I
explained, this removed 24 format selector from gdmsetup UI. So should gdm be
branched (before this patch) for GNOME 2.12? Also string+UI change announcement
should be made, but can you Brian please decide about branching and also send
string+UI announcement? (See http://live.gnome.org/ReleasePlanning_2fTwoPointEleven)
Comment 14 Brian Cameron 2005-07-27 19:04:46 UTC
I sent an email to release-team@gnome.org to see if we can leave this change in.
 If not, we'll have to backout the change.
Comment 15 Brian Cameron 2005-07-27 20:17:36 UTC
This change has release team approval.
Comment 16 Brian Cameron 2005-07-27 22:19:27 UTC
Closing since approval was given.
Comment 17 Daniel Holbach 2006-02-17 12:53:44 UTC
*** Bug 331532 has been marked as a duplicate of this bug. ***