GNOME Bugzilla – Bug 658686
allow capitalized weekday on calendar popup
Last modified: 2020-04-24 15:10:21 UTC
in #. Translators: This is the date format to use when the calendar popup is #. * shown - it is shown just below the time in the shell (e.g. "Tue 9:29 AM"). #. #: ../js/ui/dateMenu.js:213 msgid "%A %B %e, %Y" strftime allows %a (abbreviated) %A (full weekday) %^A (full weekday all uppercase), but not full weekdays capitalized. English weekdays are always capitalized, but not in French for example. It seems this is missing from strftime. Suggestion: - allow a new a '*' identifier: "%*A %B %e, %Y" - parse it out - expand the format string - turn the first char to upper case if requested or just: - capitalize the first char of the resulting string
Why not fix strftime instead of working around?
Good question André! :) I am unsure what happened in my brain at that time, I am feeling confused now. Where strftime comes from? Is it glibc?
(In reply to comment #2) > Where strftime comes from? Is it glibc? Yes, but we are not using strftime :-) We us g_date_time_format() (from glib) for both the clock and date strings.
(In reply to comment #3) > (In reply to comment #2) > > Where strftime comes from? Is it glibc? > > Yes, but we are not using strftime :-) > > We us g_date_time_format() (from glib) for both the clock and date strings. Which in turn uses the glibc translations since this commit: http://git.gnome.org/browse/glib/commit/?h=glib-2-30&id=527dc867225ae815356d2d1a72213abe981bd067
Yes, but that's irrelevant for the parsing of the format string (which is done in glib)
OK I open a new report against glib, that blocks this one. Thank You!
btw, Florian, it would be a good thing if there was translator comments to refer to the right format documentation. At least this one makes explicit reference to strftime #. Translators: this is a time format string followed by a date. #. If applicable, replace %X with a strftime format valid for your #. locale, without seconds. Can you handle it, or do you want a separate report?
(In reply to comment #7) > it would be a good thing if there was translator comments to refer to the right > format documentation. At least this one makes explicit reference to strftime > > #. Translators: this is a time format string followed by a date. > #. If applicable, replace %X with a strftime format valid for your > #. locale, without seconds. > > Can you handle it, or do you want a separate report? To be honest, I'm not convinced that this is a good idea. We us the Date.toLocaleFormat[0] Javascript function to format time and date (which is documented to use strftime - the comment was correct at the time of writing); however, mozilla's implementation is buggy when handling unicode characters[1], so we replaced it under the hood with our own implementation (which uses g_date_time_format()). It is by all means an implementation detail, and might change again when mozilla fixes their implementation - having translators rely on a specific implementation sounds a bit scary ;-) If we think that the clock and date should use sentence capitalization (for the record: I think they should), then modifying the returned string from code does not sound too bad ... [0] https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Date/toLocaleFormat [1] https://bugzilla.gnome.org/show_bug.cgi?id=643350
(In reply to comment #8) > If we think that the clock and date should use sentence capitalization (for the > record: I think they should), then modifying the returned string from code does > not sound too bad ... So should this issue continues this way? At [1] Dan Winship suggests to add a string "translate this string to 'yes' if we should capitalize the first letter of the date string" [1] https://bugzilla.gnome.org/show_bug.cgi?id=658807#c3
I think it should be fixed in glib instead, otherwise we'll keep reinventing the wheel (say, in gnome-calendar, Evolution, etc.).
If this is still a valid issue (cannot find that string in gnome-shell git master), then it should be filed as a new ticket against glib: https://gitlab.gnome.org/GNOME/glib/issues/ - thanks a lot!