Localized Character Strings

One very common resource type is a strings file. Strings files are used for character strings that must be localized. They are essentially dictionaries that map a string in the development language to the localized version of the string. The key is not required to be the development language version of the string, but this convention is usually used.

Because strings files are used so frequently, CFBundle includes special macros for working with them. As an added convenience, Apple provides genstrings, a command-line development tool that searches your source code for occurrences of these macros and generates a strings file automatically. This strings file can then be translated and included in the appropriate .lproj folder.

The localized string API knows how to locate and load the strings file (like any other resource) and then look up the string you want all in one step. It also provides caching so multiple lookups from the same table do not require relocating and reloading the strings file. See Working With Localized Strings for details.


© 2000 Apple Computer, Inc. (Last Updated 30 June 2000)