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 664645 - Gnome-shell calendar doesn't allow locale to change non-work days.
Gnome-shell calendar doesn't allow locale to change non-work days.
Status: RESOLVED FIXED
Product: gnome-shell
Classification: Core
Component: calendar
3.2.x
Other Linux
: Normal minor
: ---
Assigned To: David Zeuthen (not reading bugmail)
gnome-shell-maint
: 664908 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2011-11-23 15:04 UTC by Lavi .A
Modified: 2014-11-07 17:22 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Patch for /js/ui/calendar.js (663 bytes, patch)
2011-11-23 15:07 UTC, Lavi .A
reviewed Details | Review
[UP TO DATE] patch /js/ui/calendar.js (703 bytes, patch)
2011-11-23 16:48 UTC, Lavi .A
needs-work Details | Review
calendar: Allow translators to change non-work days (1.13 KB, patch)
2014-11-07 14:39 UTC, Bastien Nocera
committed Details | Review

Description Lavi .A 2011-11-23 15:04:53 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.
Comment 1 Lavi .A 2011-11-23 15:07:17 UTC
Created attachment 202000 [details] [review]
Patch for /js/ui/calendar.js
Comment 2 Jasper St. Pierre (not reading bugmail) 2011-11-23 16:00:18 UTC
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()
Comment 3 Lavi .A 2011-11-23 16:32:54 UTC
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.
Comment 4 Lavi .A 2011-11-23 16:48:37 UTC
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.
Comment 5 Owen Taylor 2012-01-24 20:35:22 UTC
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
Comment 6 Allan Day 2012-10-03 10:07:42 UTC
Hey Lavi, any progress with this? It would be great to be able to include your patch.
Comment 7 Allan Day 2012-10-03 10:08:00 UTC
*** Bug 664908 has been marked as a duplicate of this bug. ***
Comment 8 Bastien Nocera 2014-11-07 14:39:37 UTC
Created attachment 290171 [details] [review]
calendar: Allow translators to change non-work days
Comment 9 Florian Müllner 2014-11-07 14:48:35 UTC
Review of attachment 290171 [details] [review]:

OK
Comment 10 Bastien Nocera 2014-11-07 17:22:08 UTC
Attachment 290171 [details] pushed as 21d11b3 - calendar: Allow translators to change non-work days