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 789205 - date in Top Bar don't follow regional format
date in Top Bar don't follow regional format
Status: RESOLVED OBSOLETE
Product: gnome-desktop
Classification: Core
Component: libgnome-desktop
3.26.x
Other Linux
: Normal minor
: ---
Assigned To: Desktop Maintainers
Desktop Maintainers
: 795912 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2017-10-19 15:17 UTC by rockonthemoonfm
Modified: 2018-09-21 16:46 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
screenshot (425.15 KB, image/png)
2017-10-19 15:17 UTC, rockonthemoonfm
  Details
wall-clock: Use LC_TIME for strftime format string translations (3.82 KB, patch)
2017-10-19 17:05 UTC, Florian Müllner
none Details | Review
wall-clock: Use LC_TIME for strftime format string translations (3.91 KB, patch)
2017-10-19 17:20 UTC, Florian Müllner
rejected Details | Review

Description rockonthemoonfm 2017-10-19 15:17:20 UTC
Created attachment 361886 [details]
screenshot

if "Show date" is checked in Tweaks, the date doesn't display with the proper regional format style. It does in the drop-down menu. 
To me today it's Thursday, October 2019. See attached screenshot.
Comment 1 Florian Müllner 2017-10-19 17:05:22 UTC
The top bar clock is using gnome-desktop's WallClock, reassigning.
Comment 2 Florian Müllner 2017-10-19 17:05:53 UTC
Created attachment 361890 [details] [review]
wall-clock: Use LC_TIME for strftime format string translations

In order to handle the clock's various display setting correctly for
different locales, we mark strftime format strings for translation.
However those translations are looked up according to the locale
defined by LC_MESSAGES, while the conversion characters themselves
are resolved according to LC_TIME, with rather odd results when
mixing locales.
The correct solution would be to install translations for format
strings in the LC_TIME catalogue and look them up with dcgettext(),
but we don't have the infrastructure to do that easily. Work around
this by adding a helper method that looks up a string in LC_MESSAGES
using the locale defined by LC_TIME and use that to translate the
format strings, which has the same result.
Comment 3 Florian Müllner 2017-10-19 17:20:47 UTC
Created attachment 361891 [details] [review]
wall-clock: Use LC_TIME for strftime format string translations

- keep marking format strings for translation
 - use the correct domain instead of NULL
Comment 4 Piotr Drąg 2018-05-08 18:28:06 UTC
*** Bug 795912 has been marked as a duplicate of this bug. ***
Comment 5 d900x.maj3rd 2018-05-27 14:00:48 UTC
Is there any way to see the status/scheduling of this bug in terms of it's standing in the stack of tasks you guys are working on?
Comment 6 Michael Catanzaro 2018-09-05 15:02:42 UTC
Review of attachment 361891 [details] [review]:

I mean, the patch was already here, just sitting awaiting review, but nobody watches Bugzilla for gnome-desktop so no review was going to be forthcoming.

Anyway, r- due to the setenv() use. This will cause the desktop to randomly crash if the user is sufficiently unlucky. The possible solutions are the same as I described in https://gitlab.gnome.org/GNOME/gnome-desktop/merge_requests/15#note_294280: either add new API to gettext() if you're brave, or just install a subprocess in libexecdir and launch it for looking up the translation. Obviously the later is much easier and the approach I would expect, but the former is an option. It might seem overkill to have a subprocess to look up a translation, but it's not overkill if it's required for correctness. I don't see any way around it.
Comment 7 Michael Catanzaro 2018-09-05 15:04:17 UTC
(In reply to Michael Catanzaro from comment #6)
> Review of attachment 361891 [details] [review] [review]:
> 
> I mean, the patch was already here, just sitting awaiting review, but nobody
> watches Bugzilla for gnome-desktop so no review was going to be forthcoming.
> 
> Anyway, r- due to the setenv() use.

Sorry, setlocale(), which of course is not safe either.

(Yes, I know the surrounding code does this, but that should be fixed rather than copied.)

(Yes, I know gnome-initial-setup does this too, but I've no clue how to fix that.)
Comment 8 GNOME Infrastructure Team 2018-09-21 16:46:58 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to GNOME's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.gnome.org/GNOME/gnome-desktop/issues/72.