I am not totally new to open source contributions. Luckily enough, I have both some spare time to contribute to the communities I like and a Company that wants me to support some open source projects (see UbuntuCore and ModemManager). However, I have never written anything about that. I’d like to, but usually my patches provide improvements that a “normal user” can hardly see (like udev rules management, or better support for 3G/4G modems), so that it is hard to explain the delta provided.

This time though, my contribution to GNOME Calendar is more visible, so I’d like to show it :)

I’m an Ubuntu user since Feisty Fawn (2007), and a GNOME user since. I think I’ve tried every DE flavour (KDE, Elementary’s Pantheon, LXDE, even Enlightenment 17), but I’ve always returned to GNOME. Then, during the transition from GNOME2 to GNOME3, I learnt to love Unity instead1. Finally, the end of Unity makes me look at GNOME again and since I wanted to give back something to the communities of both Ubuntu and GNOME, I started looking at the Newcomers Guide.

The Newcomers Guide is for developers who want to participate in coding GNOME’s apps

Two projects were (and are) interesting to me, Polari and Calendar, but I am not very familiar with javascript, yet, and I have always preferred using my calendars from a desktop application than from the “famous-web-based-one”, so I chose the latter.

The first newcomers Calendar bug I saw was this one2:

Show weekday instead of date in the create event popover when creating new event within a week

I took this one for the following reasons:

  1. I though “Ok, it’s for newcomers, it shouldn’t be that hard” and I was kind of wrong :D
  2. I had enough search keywords to look into the code and find the right spot to work in. I was right, here :)

The real challenge wasn’t really the feature itself, but the fact that the displayed text should be easily translated. Ideally, developers should reduce repetition as much as possible (DRY principle, right?), but translators need context to do their job.

Let’s make a simple example. To generate a messages like this one:

“New event from next Monday to next Tuesday”

I would have provided a template like “New event from next %s to next %s” and using some calendar function to automatically replace the strings with the right weekday name. I learned instead that in some languages (Polish, I’m talking to you!) the translation of the word “next” might have different form for different days of the week. So, in general, I should keep some context around the constant strings I wanted to use.

I was amazed by this little intricacies, but at the same time I’ve never worked with translation before (gettext was only a dependency I always forgot to install before building some projects), so I really appreciated the support given by maintainers and translators, both on the bug and on IRC, that encouraged me to progress into the development.

So, cutting a long story short, after 8 patch versions :D, this is the outcome. It is a matter of taste, but I hope you like it, because it is in master now :D

Footnotes

  1. Not love at first sight, but it became the first and last DE I didn’t need to heavily hack soon after fresh install. It was just right ;([↩].
  2. Well not really, first there was a little fix in it’s json file, but it is not really much[↩].