Marcus' Homepage

How to translate FuzzyTime

FuzzyTime had a successful launch and I’ve already received a lot of messages from users who would like to contribute with their own translations, which makes me really happy! To make things easier for everyone, I’m making this blog post to explain how to translate, how to test it on your computer and where to submit them so I can include them in the next update.

Translating

Translations in FuzzyTime are, like in its predecessor Fuzzy Clock, stored as text files inside the application bundle. Begin by navigating to your Applications folder in Finder. Right click on FuzzyTime and select “Show Package Contents”, then navigate to Contents › Resources.

In this folder, create a new Folder (N) and give it a name followed by .lproj. Use a name that only contains letters from A to Z (don’t worry, we will give it a display name later). You will be asked for your administrator password since FuzzyTime was downloaded from the App Store. Now, open the folder named English.lproj and copy the file Localizable.strings into your new folder.

Here comes the hard part

Open the file you just copied in your favorite editor, TextEdit that comes with your Mac is fine. You will see a bunch on lines with text, some of them are left overs from Fuzzy Clock that we won’t need. Focus on the these lines instead:

"shortly after %@" = "shortly after %@";
"shortly after ref" = "current";
"five past %@" = "five past %@";
"five past ref" = "current";
"ten past %@" = "ten past %@";
"ten past ref" = "current";
"quarter past %@" = "quarter past %@";
"quarter past ref" = "current";
"twenty past %@" = "twenty past %@";
"twenty past ref" = "current";
"twentyfive past %@" = "twentyfive past %@";
"twentyfive past ref" = "current";
"half past %@" = "half past %@";
"half past ref" = "current";
"twentyfive to %@" = "twentyfive to %@";
"twentyfive to ref" = "next";
"twenty to %@" = "twenty to %@";
"twenty to ref" = "next";
"quarter to %@" = "quarter to %@";
"quarter to ref" = "next";
"ten to %@" = "ten to %@";
"ten to ref" = "next";
"five to %@" = "five to %@";
"five to ref" = "next";
"nearly %@" = "nearly %@";
"nearly ref" = "next";

/* hour names */
"twelve" = "twelve";
"one" = "one";
"two" = "two";
"three" = "three";
"four" = "four";
"five" = "five";
"six" = "six";
"seven" = "seven";
"eight" = "eight";
"nine" = "nine";
"ten" = "ten";
"eleven" = "eleven";

/* special strings */
"%@ o'clock" = "%@ o’clock";
"midnight" = "Midnight";

/* Workarounds */
"one o'clock" = "one";

These lines are known as key-value pairs which are in this case separated by an equals-sign, and both the key and the value is surrounded by quote marks. To the left we have the key, which is the original text FuzzyTime is generating in its code. You should leave these as they are. To the right you see the value, which in this case will (with some exceptions) contain your translations.

The first section is probably the most complicated one, as it contains how minutes should be displayed which can vary a lot between different languages. To explain how this works, let’s look at an example:

"half past %@" = "half past %@";
"half past ref" = "current";

The first line here is the text itself that will be translated. The %@ will be replaced by an hour name, so 1:30 would be half past one.

The line that comes after decides which hour this translation will be referencing to, either the current one or the next. For example, in Swedish you wouldn’t say “half past one”, instead you’d say “half two”. The translation for this would look like this:

"half past %@" = "halv %@";
"half past ref" = "next";

The rest of the texts, like hour names, should be pretty straight forward to translate.

Adding to FuzzyTime for testing

When you’re done with your translation you probably want to try your fantastic creation. This is fairly simple, navigate back to the Resources folder and open the file LocalizationNames.strings.

In the bottom of this file, add your own key-value pair where the key is the name of the folder you created earlier (but without the .lproj), and the value is the display name you want in FuzzyTime. For example:

"Cat" = "Cat-language";

Now if you restart FuzzyTime and take a look in the preferences, you should be able to find and use your language. By the way, remember to backup your translations as I’m not sure if it gets removed when App Store installs updates.

Submitting your translation

If you want to submit your translations so I can include it in a future update, send me a mail with your Localizable.strings file. In the mail, include the following information as well:

To make things easier, I’ve prepared a button you can click below that will open a template in your mail application:

Submit by e-mail

Thanks for reading, and thanks in advance if you decide to send your translation to me!