GNOME Bugzilla – Bug 715158
telepathyClient: Use locale format for timestamps
Last modified: 2014-02-18 10:28:38 UTC
see patch
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.
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 ...
(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.
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.
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)
(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.
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.
Review of attachment 269525 [details] [review]: OK
Attachment 269525 [details] pushed as 58191ea - telepathyClient: Use locale format for timestamps