Thyme

I just released an OS X application called Thyme, which allows you to time your tasks in an unobtrusive way, while remembering every time you use it.

Thyme

It’s a pretty simple project and I did it to fulfill the need I had for such an application. I hope more people find it as useful as I do.

It’s released under the GPLv3 and you can access its source code at its github project page.

DJWG #13

Duarte & João's Wallpaper Giveaway

Half of us was in New York City, and it wasn’t me!

Standard: 2048×15361280×9601024×768
Wide: 1920×12001440×9001280×800

DJWG #12

Duarte & João's Wallpaper Giveaway

Wow. It’s been a long time. Sorry!

Duarte visited me in Zürich last week and it was awesome. Needless to say, we’re packed full of new photos for more wallpaper deliciousness. Hope you like it.

Standard: 2048×15361280×9601024×768
Wide: 1920×12001440×9001280×800

DJWG #11

Duarte & João's Wallpaper Giveaway

Merry Christmas and a Happy New Year everyone!

Standard: 2048×15361280×9601024×768
Wide: 1920×12001440×9001280×800

Incremental localization on XCode-based projects

Motivation

When I first started out localizing my first iPhone application, I went bananas. Unlike most of the developer resources available for programming on an Apple infrastructure, this feature seemed so confused in documentation and poorly understood by the community. All I wanted was to have multiple languages on my application, relative to the user’s preferences, just by using NSLocalizedString, and editing the translation files.

Please note that there is a whole lot more to localization beyond having different languages on your application. I’m not going to cover that on this post. I’m also not going to talk about localizing XIB files.

Goal

This guide will help you localize strings included in your code (using NSLocalizedString) as well as making the translation process incremental (without ever losing the previous translations made).

Problem

I’m going to talk about the surprise I had when I started localizing my application: the Localizable.strings files that gets generated using Apple’s tool – genstrings – overwrites the previous translations, instead of properly merging them with the new changes. Since I needed to translate as I was developing the application, this meant that I had to merge the files by hand at every step of the translation process (always being careful not to lose the previous translations). This just wouldn’t work.

Solution

And so, I’ve made a Python script that does just what we need: it generates new translation files, merges them with the previous translations and keeps copies of all those steps, just in case anything goes wrong.

Step by Step

Here’s how it works:

  1. go into your XCode project folder and create xx.lproj folders inside, one for each language you would like (using ISO 639-1 and ISO 639-2 codes). For example, to have your application in English, French and German, you would create three folders: en.lproj, fr.lproj and de.lproj;
  2. put my script localize.py inside the XCode project folder (it is being hosted on my github repository);
  3. simply run ./localize.py on the Terminal, from the XCode project folder and your files will be created on the first run, and merged on subsequent runs.
  4. after running the script for the first time you should have your Localizable.strings files inside each language folder. To make them work with your application, just add them to your XCode project.

Notes

The script always leaves two files behind, per language: Localizable.strings.old and Localizable.strings.new. These are the two files that got merged to create the brand new Localizable.strings file. They might come in handy for some troubleshooting. By not adding them into the XCode project and (if applicable) by adding them onto your favourite revision control program’s ignore list, they cause no trouble at all.

I hope this helps someone, just like it has been helping me ever since I created it.

If you have any comments, questions, bug reports, please let me know in the comments section.

SongSketch

SongSketch

I’ve just released something that I’ve been working on the past few months. It started out as a way to learn iPhone development but then the idea got stuck in my head as something that might just be useful to a lot of people, so I’ve decided to complete the project and release it as a paid app on the App Store.

The name is SongSketch and it’s supposed to help you catalog all those songs you create, if you’re a guitar/piano/etc. player. For more information, refer to the official website: http://songsketch.joaomoreno.com/.

Please note that all the application and web design was done by Nuno Coelho. Give him a visit, he’s an awesome designer.

DJWG #10

Duarte & João's Wallpaper Giveaway

Cool, breezy, clear winter skies right onto your desktop.

Standard: 2048×15361280×9601024×768
Wide: 1920×12001440×9001280×800

Baixa do FCTenses

Atenção a todos os FCTenses que usam o agregador http://fct.enses.org/: o projecto vai ser abandonado da minha parte. Se alguém quiser pegar nele, que fale comigo e eu disponibilizo o que for necessário para manter o projecto a funcionar como está. Caso contrário, o site deverá ir abaixo durante o mês de Novembro.

Um pedido de desculpas àqueles que o usam tanto como uma maneira de publicar melhor os seus blogs e àqueles que o usam como fonte de leitura no dia-a-dia. Foi bom enquanto durou. :)

DJWG #9

Duarte & João's Wallpaper Giveaway

Grey like Swiss weather and pierced like Portuguese economy.

Or is it grey like Portuguese economy and pierced like Swiss cheese?

Standard: 2048×15361280×9601024×768
Wide: 1920×12001440×9001280×800

Arduino RGB Lamp

After seeing several homemade RGB lamp projects online and experimenting with one live (made by my friend Cloud), I decided to build my own (click the image for more photos).

Green Lamp

The only thing it does yet is cycle through the whole hue range very slowly, so it gives a nice smoothly changing environment to the room. It draws its power from a standard wall socket, although I left the USB cable dangling in order to just my laptop whenever and reprogram it at will.

Assembly

The assembly is fairly simple, all you need is:

  • Arduino (I’m using the Diecimila);
  • RGB LED (I bought this one);
  • some 100 Ohm resistors (I bought these, although if you know a bit something about LEDs you know that different LED colors require different voltages, as such, in order to get better results you could use different resistors);
  • Arduino compatible wall socket;
  • one IKEA lamp!

All you need to do is connect each color of the LED to an analog out pin on the Arduino, and do some code!

If someone has any good ideas on what else to do with the lamp, please let me know!