GNOME Bugzilla – Bug 145549
gdm should use LC_TIME to choose its default clock format
Last modified: 2006-02-17 12:53:44 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
*** Bug 161178 has been marked as a duplicate of this bug. ***
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.
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
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.
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.
Yes, supporting three options (12/24/locale) sounds the best to me. Making the default "locale" also seems reasonable.
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).
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
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.
Then let's rephrase the proposal: change time format display to 12/24/auto with auto as default
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.
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.
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)
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.
This change has release team approval.
Closing since approval was given.
*** Bug 331532 has been marked as a duplicate of this bug. ***