
This page explains how you can translate the GUI pieces of your
application and how to test your localization. GUI stands for Graphical User Interface. In Apple applications,
the GUI pieces are called nib files.
Translating Nib Files
Localizing your application consists of translating the application's
localizable strings and editing its GUI content. You need to edit the GUI content in order to make sure that the
application's windows, dialogs, and other GUI pieces have the correct appearance after their text language
content has been translated. An example of a possible problem you may encounter is that a translated string
is longer than its English equivalent causing it to run out of the GUI window that is supposed to contain it. You
can fix such problems by editing the application's GUI with Interface Builder.
The GUI pieces of the application reside in files with the extension
"nib". AppleGlot extracts all the nib files of the application when it does its initial pass. These files
will reside in the your _language.lproj bundle, which is in the _NewLoc directory of your AppleGlot
environment.
You will edit the nib files with Interface Builder. Interface Builder is
installed on your computer using the Mac OS X Developer CD included with every Mac OS X system package.
Documentation for Interface Builder is packaged with the application and more information is available at the
Interface Builder webpage.
The following discussion assumes that you have installed and
can run Interface Builder.
To start editing the nib files, go to the your _language.lproj and
open each nib file in Interface Builder. Figure 1 is a shot of a Romanian Safari bundle containing nib
files.

Figure 1: Romanian Safari bundle
When you double click on a nib, a window like the one in Figure 2 will open.

Figure 2: Opening the Nib File
Double-click on the icon with the "Window" title, and you will obtain the
editable GUI window. You need to edit this window to give it the correct appearance with the new strings it
contains. Interface Builder lets you resize whole windows, text, buttons, and other components within
windows. It also allows you to move text, buttons and other components around in the window. You can also
realign the window's components. Remember to save your editing work for each nib file. Figure 3 is an example
of Safari's advanced preferences panel, localized in Romanian.

Figure 3: Safari's advanced preferences panel, localized in Romanian.
Once you've edited all the nib files you are ready to perform some
runtime tests on the application, to check how the GUI pieces are actually rendered at runtime. Please
proceed to the next section, which talks about how to test your localization.
Testing Your Localization
The first step of testing your localization involves proofreading the .ad
files produced by your final AppleGlot pass. Proofread these files to make sure that your translations are
correct translations for your language.
The second step consists of runtime tests of your localization. To quickly test your localization:
- Copy the your
_language.lproj from the _NewLoc directory into the application's
bundle.
- Go to System Preferences -> International and click the Language tab; then in the Languages column, drag your
language to the very top. This ensures that whenever you open an application, the system will first try to open
it in your language (this succeeds if there is a your
_language.lproj in that application's bundle). In general, if
the system doesn't find such an lproj, it will go down the language list until it does find an lproj it can run. The
default is English.lproj.
- Now open your application. It should open in your language, according to the .lproj
you produced. Test your application and go back to editing strings as well as nib files to fix any problems you
may encounter.
Once you are happy with your localization, package it up and you are done!
Posted: 2006-01-18
|