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 673721 - I am not getting the AM/PM indicator (12 hr clock) both in top panel and in control-centre.
I am not getting the AM/PM indicator (12 hr clock) both in top panel and in c...
Status: RESOLVED FIXED
Product: gnome-control-center
Classification: Core
Component: Date and Time
3.4.x
Other Linux
: Normal major
: ---
Assigned To: Control-Center Maintainers
Control-Center Maintainers
: 682266 (view as bug list)
Depends on: 687913
Blocks:
 
 
Reported: 2012-04-08 11:43 UTC by Justin
Modified: 2012-11-08 11:34 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Screenshot of control-centre (81.65 KB, image/png)
2012-04-08 11:45 UTC, Justin
  Details
Screenshot of control-centre (73.76 KB, image/png)
2012-04-08 11:47 UTC, Justin
  Details
datetime: Prevent the AM/PM switcher from being blank in certain locales (1.34 KB, patch)
2012-11-06 12:46 UTC, Thomas Wood
none Details | Review
datetime: Do not offer the 12 hr clock in locales without AM/PM (2.66 KB, patch)
2012-11-08 09:17 UTC, Debarshi Ray
none Details | Review
datetime: Do not offer the 12 hr clock in locales without AM/PM (2.65 KB, patch)
2012-11-08 11:06 UTC, Debarshi Ray
none Details | Review
datetime: Do not offer the 12 hr clock in locales without AM/PM (4.15 KB, patch)
2012-11-08 11:30 UTC, Bastien Nocera
committed Details | Review

Description Justin 2012-04-08 11:43:29 UTC
I am using gnome 3.4 (testing repo version in arch).

The 12 hr clock is enabled in control centre. But I do not get the AM/PM indicator. The control centre shows a blank combo box for the AM/PM (screenshot attched). The shell top panel also do not show the AM/PM indicator.
Comment 1 Justin 2012-04-08 11:45:27 UTC
Created attachment 211574 [details]
Screenshot of control-centre
Comment 2 Justin 2012-04-08 11:47:42 UTC
Created attachment 211575 [details]
Screenshot of control-centre
Comment 3 Rui Matos 2012-04-08 16:47:08 UTC
I can reproduce this since I run my system with LC_TIME=pt_PT.UTF-8. Changing it to en_US.UTF-8 "fixes" it.

It seems that when glib is compiled having langinfo.h we're calling nl_langinfo() to get the string but glibc's manual says:

""
AM_STR
PM_STR
    The return values are strings which can be used in the representation of time as an hour from 1 to 12 plus an am/pm specifier.

    Note that in locales which do not use this time representation these strings might be empty, in which case the am/pm format cannot be used at all. 
""

I'm unsure what's the best solution here. Not use nl_langinfo() and rely on glib's translations? But then we're bound to LC_MESSAGES which might not be flexible enough.

Maybe this particular setting should be removed from the Date/Time panel and instead be keyed off of the Formats tab in the Region panel?
Comment 4 Debarshi Ray 2012-04-14 19:06:19 UTC
This is a duplicate of https://bugzilla.gnome.org/657473
Comment 5 Bastien Nocera 2012-04-19 18:06:03 UTC
(In reply to comment #4)
> This is a duplicate of https://bugzilla.gnome.org/657473

It's not. But the patch in the other bug would help. Might moving it here?
Comment 6 Justin 2012-04-19 19:17:48 UTC
The patch on the other bug removes the option for 12 hr clock in locales without AM/PM. That is not an acceptable solution (rather a silly workaround). 

I want the 12 hr clock in UK locale with AM/PM displayed. Why can't I have it? Someone please explain to me?
Comment 7 Bastien Nocera 2012-08-20 14:21:13 UTC
*** Bug 682266 has been marked as a duplicate of this bug. ***
Comment 8 Justin 2012-11-05 04:46:34 UTC
This is working fine now. Closing.
Comment 9 Thomas Wood 2012-11-06 12:33:36 UTC
I don't think this is fixed. Using locales that have empty strings for the translations of "AM" or "PM" still causes the AM/PM switcher widget to become blank.
Comment 10 Thomas Wood 2012-11-06 12:46:37 UTC
Created attachment 228241 [details] [review]
datetime: Prevent the AM/PM switcher from being blank in certain locales

This is a very simple patch to provide a fall back if the locale has empty
strings for the AM/PM translations. This wouldn't fix the lack of AM/PM
indicators in other applications such as gnome-shell, but it does at least
prevent the date and time panel becoming unusable when 12 hour time is selected
and the locale doesn't support it.
Comment 11 Justin 2012-11-06 12:59:00 UTC
I was getting AM/PM in both GCC and shell with English_GB. So I thought it fixed, sorry.
Comment 12 Matthias Clasen 2012-11-07 22:54:41 UTC
I don't think that patch is right.

http://en.wikipedia.org/wiki/12-hour_clock states that 

Outside of English-speaking countries, the terms a.m. and p.m. are seldom used and often unknown.
Comment 13 Justin 2012-11-08 05:26:50 UTC
First, I am not sure how authoritative wikipedia articles are, especially as part of official decision making processes.

Second, even in that page I do not see anything that says the terms AM/PM are seldom used outside of english speaking countries. Within abbreviations section, I see a sentence 'Most other languages lack formal abbreviations for "before noon" and "after noon"...' If anything that tells me those countries might be using AM/PM instead of strings in their local languages.

Third, I am from India, a non-english speaking country. We always use 12 hr clock and AM/PM.
Comment 14 Bastien Nocera 2012-11-08 07:13:12 UTC
(In reply to comment #13)
> Third, I am from India, a non-english speaking country.

Saying that, and then mentioning that Wikipedia isn't authoritative. Funny.
(India is an ex-British colony, and one of the official languages is English, that could be where it comes from...)

The correct fix is to add translations for AM/PM to the locale definition you're using (you never mentioned which one you use btw) because the territory in question does use AM/PM, or change your LC_TIME to use another locale (en_GB as you mentioned above might fit).
Comment 15 Justin 2012-11-08 08:00:45 UTC
(In reply to comment #14)
> Saying that, and then mentioning that Wikipedia isn't authoritative. Funny.

These are two different issues. First the credibility of the citation. Second, the credibility of the source itself. Failure of establishing one, doesn't necessarily invalidate the other.


>change your LC_TIME to use another locale (en_GB as you mentioned above might fit).

I wonder how can we even come up with these solutions. As a project, are we not passed the level or reached the maturity to feel ashamed of proposing these kind of quick fixes as permanent solutions?


> The correct fix is to add translations for AM/PM to the locale definition
> you're using (you never mentioned which one you use btw) because the territory
> in question does use AM/PM, or 

So are you saying that you prefer to present a broken GCC (with a blank combo/selection box - see my original screenshot) to the users than having a fix where it shows AM/PM as a fallback?

Funny, (in the screenshot) just below that blank combo/selection box (because we cannot add an AM/PM) we use AM/PM instead of '12-hr'.
Comment 16 Bastien Nocera 2012-11-08 08:10:55 UTC
(In reply to comment #15)
> (In reply to comment #14)
> > Saying that, and then mentioning that Wikipedia isn't authoritative. Funny.
> 
> These are two different issues. First the credibility of the citation. Second,
> the credibility of the source itself. Failure of establishing one, doesn't
> necessarily invalidate the other.

Don't comment on the authority of online sources when you can't back up your statements with an once of reality.

> >change your LC_TIME to use another locale (en_GB as you mentioned above might fit).
> 
> I wonder how can we even come up with these solutions. As a project, are we not
> passed the level or reached the maturity to feel ashamed of proposing these
> kind of quick fixes as permanent solutions?

Changing the locale translation a quick fix? It's a work-around, for you, so that you can move on.

> > The correct fix is to add translations for AM/PM to the locale definition
> > you're using (you never mentioned which one you use btw) because the territory
> > in question does use AM/PM, or 
> 
> So are you saying that you prefer to present a broken GCC (with a blank
> combo/selection box - see my original screenshot) to the users than having a
> fix where it shows AM/PM as a fallback?

No, we'd disable the button if AM/PM isn't available (as provided in the patch from bug 657473)

You still didn't state which locale you used.
Comment 17 Debarshi Ray 2012-11-08 09:17:26 UTC
Created attachment 228443 [details] [review]
datetime: Do not offer the 12 hr clock in locales without AM/PM

Moving the patch from bug 657473 as suggested.
Comment 18 Debarshi Ray 2012-11-08 09:26:29 UTC
(In reply to comment #13)

You are just trolling now.

> First, I am not sure how authoritative wikipedia articles are, especially as
> part of official decision making processes.
> 
> Second, even in that page I do not see anything that says the terms AM/PM are
> seldom used outside of english speaking countries. Within abbreviations
> section, I see a sentence 'Most other languages lack formal abbreviations for
> "before noon" and "after noon"...' If anything that tells me those countries
> might be using AM/PM instead of strings in their local languages.

See: http://en.wikipedia.org/wiki/12-hour_clock#Use_by_country

> Third, I am from India, a non-english speaking country.

It can be argued that India is an English speaking country. See:
http://en.wikipedia.org/wiki/Languages_of_India#Official_languages

> We always use 12 hr
> clock and AM/PM.

Also wrong. *Both* 12 and 24 hr are widely used. eg., every newspaper I have read  uses the 24 hr format for denoting time.
Comment 19 Justin 2012-11-08 10:07:40 UTC
(In reply to comment #16)
> Don't comment on the authority of online sources when you can't back up your
> statements with an once of reality.

Wikipedia can be edited by anyone (I could add points to support my argument and cite it here). That is the reason none of the academic works accept it as a source in any of the journals/studies/course work etc. (Ask any of your friends in the academic fields) This is fact, I thought considered universal. If you never heard about wikipedia's lack of credibility for any serious work, I don't have anything more to say.

> Changing the locale translation a quick fix? It's a work-around, for you, so
> that you can move on.

You are clearly new here and did not read any of the comments. I get this working with english_GB (and even closed the bug). 

> You still didn't state which locale you used.

(comment #6)
> ......the 12 hr clock in UK locale with AM/PM.....
(comment #11)
> ....getting AM/PM in both GCC and shell with English_GB....


(In reply to comment #18)
> It can be argued that India is an English speaking country. See:

There is a huge difference between english used for official purposes and an english speaking country. How many states have English as official language? (Goa, may be, out of 28)

> Also wrong. *Both* 12 and 24 hr are widely used. eg., every newspaper I have
> read  uses the 24 hr format for denoting time.

You are taking it out of context. The original intention was to point out that we are using AM/PM (when we use 12 hr clock), though we are not english 'speaking' country.

This is going way off-topic now. And some of you do not understand my real intentions. I do not have anything against anyone. Sorry if I sounded rude. I prefer to have an AM/PM available instead of disabling it when local translations are not available. No more comments from me.
Comment 20 Debarshi Ray 2012-11-08 11:06:32 UTC
Created attachment 228460 [details] [review]
datetime: Do not offer the 12 hr clock in locales without AM/PM

Forgot to fix the bug number while moving the patch. Sorry for the noise.
Comment 21 Bastien Nocera 2012-11-08 11:30:03 UTC
Created attachment 228461 [details] [review]
datetime: Do not offer the 12 hr clock in locales without AM/PM
Comment 22 Bastien Nocera 2012-11-08 11:34:20 UTC
When I asked for the locale, I asked for the specific one you used to reproduce this problem.
Try to be a little more helpful and constructive in the future, you're really not helping yourself.

Attachment 228461 [details] pushed as 8afea39 - datetime: Do not offer the 12 hr clock in locales without AM/PM