GUI Localisation

Home Features Release Notes Localisation

We'll start with the ACSLogo menus. Copy MainMenu.nib from English.lproj into your new .lproj folder. Double-click on the file to open it up. As long as you've installed the developer tools correctly, thisŐll start up the Interface Builder program.

A number of windows will open up. This is the main one:

It shows the objects in the nib file. Double-click the MainMenu instance Ń this will open the MainMenu object (if itŐs not already open) and allow you to edit it. Click on each menu to show the menu items under it.

To change the text, just double-click on it, and type in your translation:

Just do this to the strings in all the menus.

It's important to change the text and nothing else. Each of the menu items is connected to an action in a program object. If you duplicate or cut and paste menu items, you will mess up these connections.

The other interface object that's in this nib file is the Prefs dialog window. It's called Prefs in the main window. Double-click on it to open it up.

As for the menus, you can double-click on the strings to edit them. You will probably find that the size of the string has changed after translation, so you may need to resize the string or move it to keep it aligned with other objects. If you select the string by clicking on it, you can drag it or pull the handles to resize it.

To change the title of the window, choose Show Info from the tools window. This shows the Info window:

With the Attributes panel chosen, you can edit the Window Title text field.

Save the nib file. You can now try out the program, and you should see that the menu and window strings have changed.

If you have a look in the Window menu, you'll see that some of the menu items that you translated are still in English:

This is because these items are set dynamically Ń the menu items have to change as windows are shown or hidden. There are a number of dynamic menu titles and other strings throughout the program. This problem is addressed using a file called Localizable.strings.

Localizable.strings

You can find the Localizable.strings file in any folders which have had some localization done. Here it is in French.lproj:

You can open this file in a text editor, although it has to be one that supports unicode. I've found that Xcode has corrupted the file on occasion, so I tend to use Project Builder, which is found in the /Developer/Applications directory.

When you open the file, make sure that a unicode encoding is selected:

A look in the file shows this sort of thing:

A number of lines of the form English string = translated string. So for instance, the translation for Show Info is Afficher Info. To create your own translation, copy this file into your .lproj folder and translate each string in the file.

Once you've saved the file, that's the interface translation finished. You can leave it there, or you can carry on localising with Logo Command Localisation.