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 715158 - telepathyClient: Use locale format for timestamps
telepathyClient: Use locale format for timestamps
Status: RESOLVED FIXED
Product: gnome-shell
Classification: Core
Component: message-tray
unspecified
Other All
: Normal normal
: ---
Assigned To: gnome-shell-maint
gnome-shell-maint
Depends on:
Blocks:
 
 
Reported: 2013-11-25 13:51 UTC by Carlos Soriano
Modified: 2014-02-18 10:28 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
telepathyClient: Use locale format for timestamps (5.96 KB, patch)
2013-11-25 13:51 UTC, Carlos Soriano
reviewed Details | Review
telepathyClient: Use locale format for timestamps (2.95 KB, patch)
2013-11-25 19:08 UTC, Carlos Soriano
rejected Details | Review
telepathyClient: Use locale format for timestamps (6.00 KB, patch)
2014-02-18 10:19 UTC, Carlos Soriano
committed Details | Review

Description Carlos Soriano 2013-11-25 13:51:05 UTC
see patch
Comment 1 Carlos Soriano 2013-11-25 13:51:07 UTC
Created attachment 261433 [details] [review]
 telepathyClient: Use locale format for timestamps

 Currently timestamp of telepathyClient are using
 24h format.
 Fix that and use the clock-format gsetting to know
 which time format is the user using and use that
 instead.
Comment 2 Florian Müllner 2013-11-25 16:55:45 UTC
Review of attachment 261433 [details] [review]:

::: js/ui/components/telepathyClient.js
@@ +934,3 @@
+
+        switch (clockFormat) {
+            case '24h':

GnomeWallClock also covers the case where clock-format is '12h' and the locale doesn't have a notion of AM/PM. Maybe we should just use something like:

let clock = new GnomeDesktop.WallClock({ time_only: true });
let format = _("<b>%%A</b", <b>%s</b>".format(clock.clock));

Scanning through the existing translations, no one appears to split up the time format in odd way, so this looks like a cheap way to ensure a consistent time format ...
Comment 3 Carlos Soriano 2013-11-25 19:00:34 UTC
(In reply to comment #2)
> Review of attachment 261433 [details] [review]:
> 
> ::: js/ui/components/telepathyClient.js
> @@ +934,3 @@
> +
> +        switch (clockFormat) {
> +            case '24h':
> 
> GnomeWallClock also covers the case where clock-format is '12h' and the locale
> doesn't have a notion of AM/PM. Maybe we should just use something like:
> 
> let clock = new GnomeDesktop.WallClock({ time_only: true });
> let format = _("<b>%%A</b", <b>%s</b>".format(clock.clock));
> 
> Scanning through the existing translations, no one appears to split up the time
> format in odd way, so this looks like a cheap way to ensure a consistent time
> format ...
Meh, as always with your solutions, working like a charm =) thanks Florian.
Comment 4 Carlos Soriano 2013-11-25 19:08:31 UTC
Created attachment 261477 [details] [review]
telepathyClient: Use locale format for timestamps

Currently, the timestamps of telepathyClient are using 24h format.
Fix that and use the GnomeDesktop.WallClock to format instead.
Comment 5 Florian Müllner 2013-11-29 17:19:26 UTC
Review of attachment 261477 [details] [review]:

Sorry, thinko on my part. GnomeDesktopWallClock:clock contains a string representing the current time, so this does not at all work for timestamps in the past.
(Also even if it worked, I'd still worry about mixing unescaped printf-like format specifiers and escaped strftime-like format specifiers ("%%A %s"), which is fairly confusing for non-coders)
Comment 6 Carlos Soriano 2013-11-29 17:36:03 UTC
(In reply to comment #5)
> Review of attachment 261477 [details] [review]:
> 
> Sorry, thinko on my part. GnomeDesktopWallClock:clock contains a string
> representing the current time, so this does not at all work for timestamps in
> the past.
> (Also even if it worked, I'd still worry about mixing unescaped printf-like
> format specifiers and escaped strftime-like format specifiers ("%%A %s"), which
> is fairly confusing for non-coders)
Not sure how it affects tougth.

So is the first patch (which I marked not obsolete just rigth now) ok?

Also I'll change the ':' for the unicode character instead before pushing.
Comment 7 Carlos Soriano 2014-02-18 10:19:51 UTC
Created attachment 269525 [details] [review]
telepathyClient: Use locale format for timestamps

Since now the timestamps were using 24h format.
Check gsetting clock-format to know when
the user is using 12h format or 24h format and
make the timestamp acordingly.
Comment 8 Florian Müllner 2014-02-18 10:23:01 UTC
Review of attachment 269525 [details] [review]:

OK
Comment 9 Carlos Soriano 2014-02-18 10:28:33 UTC
Attachment 269525 [details] pushed as 58191ea - telepathyClient: Use locale format for timestamps