Internationalization is the process of designing a software application so that it can be adapted to various languages and regions without engineering changes. Localization, in turn, is the cultural and linguistic adaptation of an internationalized application to two or more culturally distinct markets. Internationalization and localization can be seen, then, as complementary activities.
Cocoa provides a rich architecture for internationalizing applications. The primary feature is that you can refer to resources by name. In your program, you ask for a resource by name rather than loading it from—for example—a hard-coded location on the file system. At runtime, Cocoa looks for the representation of a named resource that best matches the user’s current language preferences.
This principle of naming resources applies to almost everything that you want to localize in your application. It applies, for example, to:
Nib files, for storing the layout of user interfaces (such as windows and controls), text that is embedded in user interface elements, and some data formatter elements
Strings that the user sees but that are not contained in nib files
Icons and graphics, especially those containing culture-specific images
Sound files that contain spoken language
Just as internationalization can be seen as referring to resources by name in Cocoa, localization consists of putting the localized representation of those names into locale-specific directories. You store localized resources for your application in special directories whose name is the name of a locale with a
.lproj extension (for example,
fr.lproj for French). You add to the appropriate
.lproj directory representations of these resources that are customized for people of the specified locale.