< Previous PageNext Page > Hide TOC

Notes For Localizers

This task provides some assistance for localizers of strings files and nib files.


Localizing Strings Files
Localizing Nib Files

Localizing Strings Files

Strings files generated by genstrings have content that looks like this:

/* Comment */
"key" = "key";

That is, the value string is the same as the key string.

Translators should type the localized version of the key string in place of the second string. Use the comment, if necessary, to understand the context in which the string is displayed to the user:

/* Comment */
"key" = "French version of the key";

If a string contains multiple variable arguments, you can change the order of the arguments by using the “$” modifier plus the argument number

/* Message in alert panel when something fails */
"Oh %@! %@ failed!" = "%2$@ blah blah, %1$@ oh!";

Just as in C, some characters must be prefixed with a backslash to be included in the string properly. These characters include double-quote, backslash, and carriage return. You can also specify carriage returns with “\n”:

"File \"%@\" cannot be opened" = " ... ";
"Type \"OK\" when done" = " ... ";

Strings can include arbitrary Unicode characters with “\U” followed by up to four hexadecimal digits denoting the Unicode character; for instance, space, which is hexadecimal 20, is represented as “\U0020”. This option is useful if strings must include Unicode characters which cannot be typed for some reason.

Strings files are best saved in Unicode format. This allows them to be encoding-independent, and simplifies the encoding to use when an application loads strings files. The TextEdit application can save in Unicode format. The encoding can be selected either from the Save panel, or as a general preference in TextEdit's Preferences panel.

For more information about strings files, see “Strings Files.”

Localizing Nib Files

You use Interface Builder to create nib files, and you should use Interface Builder to localize nib files. Typically you open all of the nib files in a language.lproj directory, localize all the strings, change the sizes of UI elements if necessary, and save the nib files. There are a few things to watch out for:

< Previous PageNext Page > Hide TOC

© 2003, 2009 Apple Inc. All Rights Reserved. (Last updated: 2009-01-06)

Did this document help you?
Yes: Tell us what works for you.
It’s good, but: Report typos, inaccuracies, and so forth.
It wasn’t helpful: Tell us what would have helped.