Skip to main content.

Localisation Instructions

One of the many benefits of programming in Cocoa is the ease in whic applications may be translated into multiple languages. To translate ClamXav and ClamXav Sentry into your own language, you simply need to follow these instructions, however, please contact me first as it's entirely possible that someone else is already working on the same translation.

^ TOP

What You Need To Get Started & What Needs To Be Translated

There are two files each for ClamXav and ClamXav Sentry which need to be translated: Localizable.strings and MainMenu.nib.

Those for ClamXav can be found inside ClamXav.app/Contents/Resources/English.lproj
and those for ClamXav Sentry can be found at ClamXav.app/Contents/Resources/ClamXavSentry.app/Contents/Resources/English.lproj

To get to those files, you'll need to right click on each application and select "Show Package Contents".

Assuming your target language (the one you're translating ClamXav into) does not already exist, create a new folder beside English.lproj and name it yourLocale.lproj

If, for example, I wanted to translate into Afrikaans, I would create a new folder and call it af.lproj

Consult this list if you are unsure of the two letter code to use as the name for your folder.

Copy the Localizable.strings file from English.lproj into your new folder, open it in TextEdit and translate the text on the right hand side of the = (equals) sign only. Make sure your new text is enclosed in quotation marks "" and has a semicolon ; at the end.

^ TOP

Translating the Interface

Translating the actual interface is a little more involved. Before you start, make sure you've downloaded the script I mentioned above.

Place this script in your home folder and give it execute permissions by running chmod a+x ~/TranslateNib.sh in the terminal.

Now, still in the terminal, call the script and have it create (or update if your language already exists) the necessary MainMenu.nib file.

This puts the strings to be translated from the InterfaceBuilder file into a temporary file, opens it with TextEdit to allow you to translate them. It also launches InterfaceBuilder to let you see the original nib file (do not modify this InterfaceBuilder file!). Now you need to translate the temporary file which opened in TextEdit and save it (it is already in the right location). Then you invoke the script again with the same arguments as before, except that the operation name is now end.

This copies the original interface file (or updates a pre-existing one) into your language folder (af.lproj), replaces the strings with the ones you translated, and opens the new interface file within InterfaceBuilder to let you resize/move any elements which no longer fit with the new language.