Extra space in the date when the day of the month is between 1–9
I ran into this while translating gnome-shell
to Esperanto, but the problem occurs equally as much in English. When the day of the month is between 1–9, the number is padded to become e.g. " 4"
. Or, a fuller example, compare:
Thu Oct _4, 12:10
(GitLab markdown doesn't show whitespace in literal quotes?)
Thu Oct 15, 12:10
This leads to a (rather ugly) extra space between Oct and 4 in the top bar. I have attached two screenshots where this is visible. One using en_US, and another using en_GB (in that order).
In the case of en_US (the default), a fix might look like this. In https://gitlab.gnome.org/GNOME/gnome-shell/blob/76117fd3063bcbbc8c8a0287c1ecf351d1a22039/js/ui/dateMenu.js#L74, replace:
%B %e %Y
→ %B %-d %Y
(or %B %-e %Y
)
There are a few more places where this occurs, and I'm not entirely sure how this all fits together. For instance, the linked line says:
/* 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").
*/
let dateFormat = Shell.util_translate_time_string (N_("%B %e %Y"));
This makes no sense, because %B %e %Y
does not equal Tue 9:29 AM
. It ought to equal October _4 2018
. But the former is indeed displayed. I'm assuming that the settings schema somehow changes what exactly is displayed in dateLabel
, but I can't find the correct candidate in the code. I am suspecting that it's createTimeLabel. If it is that function, then formatTime needs its %d
s replaced with %-d
s, I think.
I'm really not sure. But hopefully this is helpful :-)