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 794686 - Date (except weekday) displayed in English
Date (except weekday) displayed in English
Status: RESOLVED FIXED
Product: glib
Classification: Platform
Component: datetime
2.56.x
Other Linux
: Normal minor
: ---
Assigned To: gtkdev
gtkdev
Depends on:
Blocks:
 
 
Reported: 2018-03-26 02:53 UTC by miguelgcoias
Modified: 2018-04-10 10:47 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Spell Portuguese month and weekday names in lowercase (2.43 KB, patch)
2018-03-26 23:38 UTC, Piotr Drąg
committed Details | Review

Description miguelgcoias 2018-03-26 02:53:12 UTC
In gdm and after logging into GNOME, the month is always displayed in English in the top bar even though I'm using portuguese for formats. I'm not sure if this is happening for any other formats. It happened first after doing a full system upgrade on Antergos, which upgraded GNOME and all associated packages to 3.28 (I was using 3.26.x).

I doubt this is a gnome-session bug, but I'm not quite sure where to place it. I noticed this because in portuguese, the month is always displayed in lower case letters, and "mar" (for Março) started to appear as "Mar" (for March).
Comment 1 Piotr Drąg 2018-03-26 23:38:24 UTC
Created attachment 370168 [details] [review]
Spell Portuguese month and weekday names in lowercase

I’m pretty sure the issue is incorrect translation of month names in Portuguese. This patch converts month and weekday names to lowercase, which matches glibc and CLDR.

Could you try changing the time to e.g. somewhere in April and see if the month name is correct then?
Comment 2 Rafal Luzynski 2018-03-27 00:00:01 UTC
Is this really just an upper/lowercase issue? Does the English name of a month appear only in the top bar or just everywhere?

Please provide more details:

- version of glibc,
- version of glib2,
- version of gtk3,
- is it pt_BR or pt_PT, or other?
- is it likely that the builder machine which has built the glib2 binary which you are using had a different version of glibc than the one which your machine has?

I have checked an equivalent software in Fedora 28 (pre-release) but I can't see the issue. More, I can't see the month name displayed in the top bar, just a weekday + hour so probably our configurations are not really equivalent.
Comment 3 Piotr Drąg 2018-03-27 00:12:38 UTC
My thinking was that Antergos probably has older glibc and GNOME after the update to 3.28 started using translations from glib, which in Portuguese are partly (and incorrectly) upper case. Note that “Mar” is the abbreviated March for both pt_PT and en_US right now, which explains the idea that English names are used. My patch is correct and should be committed anyway, I believe.

(You can enable displaying date on the top bar in Tweaks.)

Of course, answering the questions Rafal asked will greatly help us diagnose the issue!
Comment 4 miguelgcoias 2018-03-27 04:20:26 UTC
I've updated Antergos to 3.28 to try answering your questions and I don't think it's just the lower case thing. I changed the system date to April and the date shows up in the top bar as "ter Apr 27". "ter" is correct, "Apr" is not, it should show up as "abr" and it correctly does so in 3.26. The week days are correct though. In the calendar the date appears as 27 March 2018, and the week day also appears correctly.

Answering Rafal's questions:
- glibc version is 2.26-11,
- glib2 version is 2.56.0+7+g66948ae23-1 (not sure if the last digits matter),
- gtk3 version is 3.22.29+4+gb485cf91b5-1 (same as above),
- I have formats set as Portugal in Settings, so I'm pretty sure it's pt_PT,
- I don't know how to answer this question.

They seem to be the last available packages in the Arch repos.
Comment 5 miguelgcoias 2018-03-27 04:36:27 UTC
After reverting the system update, glibc version stays the same, but glib2 is 2.54.3+2+g94b38beff-1 and gtk3 is 3.22.28-1. That should rule out the possibility of it being a glibc bug, because the date is showing up properly in 3.26.
Comment 6 miguelgcoias 2018-03-27 04:48:23 UTC
Sorry to post a third comment in a row, but I tried to just update glib2 to upstream and the issue is showing up on 3.26. The bug must be in that package.
Comment 7 Rafal Luzynski 2018-03-27 10:49:42 UTC
(In reply to miguelgcoias from comment #4)
> [...] In the calendar the date appears as 27 March 2018,

In English?

> [...]
> Answering Rafal's questions:
> - glibc version is 2.26-11,

Piotr - your guess was correct. Indeed, Miguel, you are using the older version of glibc and glib2 provides its own translations for the month names.

> - glib2 version is 2.56.0+7+g66948ae23-1 (not sure if the last digits
> matter),

Thank you, they do matter usually but as it is 2.56.0 they do not so much.

> - gtk3 version is 3.22.29+4+gb485cf91b5-1 (same as above),
> - I have formats set as Portugal in Settings, so I'm pretty sure it's pt_PT,

Formats - what about messages, or the general language of your GNOME session or of your whole system?

> - I don't know how to answer this question.

You would have to investigate the builders infrastructure of your distribution. But it does not matter so much since you have already explained that your glibc is 2.26. I was worried that maybe your glibc is 2.27 but your glib2 binary was built for glibc 2.26, therefore it would act as for 2.26.

> They seem to be the last available packages in the Arch repos.

Thank you for your test case. I think I have not tested this combination: the most recent GNOME + some older base system.
Comment 8 miguelgcoias 2018-03-27 15:18:48 UTC
I have system language set as English and formats set as Portuguese. On 3.28, using the latest glibc/glib2, the date shows up in Portuguese if I set system language as Portuguese. Maybe this could be intended, I don't know.

I tried testing GNOME 3.28 and an older base system, but I could not even get gdm to boot.
Comment 9 Rafal Luzynski 2018-03-27 18:47:12 UTC
(In reply to miguelgcoias from comment #8)
> I have system language set as English and formats set as Portuguese.

And this is the reason. :-) The month names provided by glib2 are selected based on the LC_MESSAGES or more general language settings.

> On 3.28, using the latest glibc/glib2, the date shows up in Portuguese if I set
> system language as Portuguese.

That's how it is supposed to work.

> Maybe this could be intended, I don't know.

Maybe it is possible to implement the solution where the language of the month and weekday names provided by glib2 is determined by LC_TIME but I don't think it makes sense. This has always been working so, for example on non-Linux systems (Windows) and nobody complained.

I think you need a newer glibc, 2.27. I understand it is not delivered by your distro but once it is everything will start working exactly as you expect.

> I tried testing GNOME 3.28 and an older base system, but I could not even
> get gdm to boot.

This may be a different issue.

I am tempted to mark this as WONTFIX or NOTABUG but Piotr has provided a patch which seems to be good even if it won't fix your issue.
Comment 10 Rafal Luzynski 2018-03-27 18:51:47 UTC
(In reply to Rafal Luzynski from comment #9)
> I am tempted to mark this as WONTFIX or NOTABUG but Piotr has provided a
> patch which seems to be good even if it won't fix your issue.

Oh, it's been committed already. Is there anything else we can do here?
Comment 11 Piotr Drąg 2018-03-27 18:52:20 UTC
Comment on attachment 370168 [details] [review]
Spell Portuguese month and weekday names in lowercase

(In reply to Rafal Luzynski from comment #9)
> I am tempted to mark this as WONTFIX or NOTABUG but Piotr has provided a
> patch which seems to be good even if it won't fix your issue.

master: https://gitlab.gnome.org/GNOME/glib/commit/b143c75b199e0386196e14bfb7e3e4486fac3fbb

glib-2-56: https://gitlab.gnome.org/GNOME/glib/commit/ad11be086a2c1c06e7ce1c57ec7b17f95d8a768e

It can be revisited if needed when/if Portuguese from Portugal has an active maintainer again.
Comment 12 Piotr Drąg 2018-03-27 18:54:39 UTC
(In reply to Rafal Luzynski from comment #10)
> (In reply to Rafal Luzynski from comment #9)
> > I am tempted to mark this as WONTFIX or NOTABUG but Piotr has provided a
> > patch which seems to be good even if it won't fix your issue.
> 
> Oh, it's been committed already. Is there anything else we can do here?

I think we’re good (unless Philip says otherwise :)). Thanks for looking into it.
Comment 13 miguelgcoias 2018-03-27 20:22:58 UTC
Maybe this is not considered a bug, but I don't think I've made myself clear enough. Here's a summary of what happens in every case I've tested:

- With the older glib2, having system language as English and formats as Portuguese, GNOME 3.26 displays the date in the Portuguese format, which would be something like "ter abr 27, 21:12".

- Upgrading glib2 to the upstream version and having the same system language (English) and formats (Portuguese), GNOME 3.26 displays the date as something like "ter Apr 27, 21:12".

- With GNOME 3.28 and the upstream glib2, the same as above happens.

However, setting the system language to Portuguese and keeping Portuguese formats, the date is displayed in Portuguese (in 3.28; I haven't tested this in 3.26), exactly like in the first case.

I don't think this is intended, because it would seem like the formats setting is being somewhat ignored, even though the weekday (ter, qua, qui, sex, etc.) is always displayed correctly. But maybe it is.
Comment 14 Rafal Luzynski 2018-03-27 20:58:09 UTC
True, this is exactly how it works. It's only glib2 version (2.56) which determines the change of the behavior. It's not GNOME (3.26/3.28) although GNOME 3.28 should work with glib2 2.56. I know what you mean: LC_TIME should control all time displays. But it does not, glib2 does not automagically know that some of its localized strings (month names) are used to display time and uses LC_MESSAGE for them. Other time format strings (weekday names) come from glibc and they use LC_TIME correctly.

The older glib2 uses all time strings from glibc. GLib2 2.56 with glibc 2.26 provides some month names which are introduced by glibc 2.27 but are not provided by glibc 2.26. If you make one step further and upgrade glibc (but you will also need an upgraded glib2, the same source code but rebuilt for the new glibc) everything will work correctly again: all date and time format strings again will come from glibc and will respect LC_TIME.
Comment 15 miguelgcoias 2018-03-27 21:09:18 UTC
Oh ok, I realize what's going on now. I'd say to mark it as resolved, since it is fixed in the latest versions of glibc/glib2.