GNOME Bugzilla – Bug 664645
Gnome-shell calendar doesn't allow locale to change non-work days.
Last modified: 2014-11-07 17:22:18 UTC
js/ui/calendar.js sets non-work days as Sunday and Saturday for all locales (in some countries non-work days are different). This mark in grey work days on the calendar and can be confusing and weird. To accelerate the fix of this bug I've created a patch for /js/ui/calendar.js with a string translators can change to set the non-work days correctly to their locale. *I've never fixed a bug for the GNOME project, and so not familiar with the ways things work, if there's something wrong I'd like (if you have the free time to) to get feedback rather than skipped. Thanks, Lavi.
Created attachment 202000 [details] [review] Patch for /js/ui/calendar.js
Review of attachment 202000 [details] [review]: ::: calendar.js @@ +31,2 @@ function _isWorkDay(date) { + //Translators: Enter 0-6 (Sunday-Saturday) for non-work days. Examples: "0" (Sunday) "6" (Saturday) "06" (Sunday and Saturday). Needs line breaks and a space in between "//" and "Translators:". @@ +31,3 @@ function _isWorkDay(date) { + //Translators: Enter 0-6 (Sunday-Saturday) for non-work days. Examples: "0" (Sunday) "6" (Saturday) "06" (Sunday and Saturday). + let days = '6'; You aren't actually translating anything. You need to call C_('calendar', "06"); @@ +32,3 @@ + //Translators: Enter 0-6 (Sunday-Saturday) for non-work days. Examples: "0" (Sunday) "6" (Saturday) "06" (Sunday and Saturday). + let days = '6'; + return days.indexOf(date.getDay()) == -1; date.getDay().toString()
Thank you, this is what I asked for (because of my lack of experience with gnome developing), I simply filed a bug and hoped I could learn of it so once I get how things work here (on gnome project) I hope I could be more useful. I'll certainly take your notes with me, thank you.
Created attachment 202010 [details] [review] [UP TO DATE] patch /js/ui/calendar.js FIXED: *comments are as with spaces and /* $ */ *called C_('calendar-no-work', "06") *added .toString() (although it seemed to work without) -= Thank you for your attention (hope to continue learning about this project). I hope this issue with be solved one way or another.
Review of attachment 202010 [details] [review]: See: https://live.gnome.org/GnomeShell/Development/WorkingWithPatches about how to properly submit a patch - it needs to be in git format-patch format with a proper commit message. Other than that, looks pretty much good: ::: calendar.js @@ +31,3 @@ function _isWorkDay(date) { + /* Translators: Enter 0-6 (Sunday-Saturday) for non-work days. Examples: "0" (Sunday) "6" (Saturday) "06" (Sunday and Saturday). */ + let days = C_('calendar-no-work', "06"); This seems inconsistent with other uses of C_ in our code base... I'd us 'calendar no work days' as the context
Hey Lavi, any progress with this? It would be great to be able to include your patch.
*** Bug 664908 has been marked as a duplicate of this bug. ***
Created attachment 290171 [details] [review] calendar: Allow translators to change non-work days
Review of attachment 290171 [details] [review]: OK
Attachment 290171 [details] pushed as 21d11b3 - calendar: Allow translators to change non-work days