O'Reilly logo

Learning Cocoa with Objective-C, 2nd Edition by James Duncan Davidson, Apple Computer Inc

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 14. Localization

If an application will be used in more than one part of the world, its resources should be customized, or localized, for the language, country, or cultural region. Cocoa provides a group of conventions and services, known as an internationalization architecture , that are flexible enough to enable multiple localizations of character strings, icons, user interfaces, and even context help packaged into your application. The localized resources appropriate to the user’s preferences are dynamically loaded as needed.

The aim of Cocoa’s localization architecture is to enable multilingual applications to be created without generating any new Objective-C code for each supported locale. Even if you don’t have an immediate need for multilingual support in your application, it is always a good idea to keep the localization abilities of a Cocoa application in mind, so you can enable it when the need arises. With proper design, your application’s source code won’t have to be touched if and when it does need to be localized—minimizing the risk of introducing problems by modifying the code.

In this chapter, we’ll take a look at how Cocoa’s localization system works, how it depends on the user’s language preferences, and how to structure your application’s nib files and use of strings to take advantage of it.

Mac OS X Language Preferences

To see how Mac OS X supports different languages, try the following process:

  1. Open the TextEdit application (/Applications/TextEdit ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required