If a bundle is to be used in more than one part of the world,
its resources may need to be customized, or localized, for language,
country, or cultural region. For example, an application may need
to have separate Japanese, English, French, and Swedish versions
of the character strings that label menu commands. An application
may also need to accommodate regional language variation—British
and American English, for example.
Bundles solve this problem by grouping resources together
into directories named for their region and language with the extension
Region-specific resource directories should take their names from
ISO 3166 standard for
country codes, and the
639 standard for language codes (see http://www.iso.ch).
You would place resources specific to the dialect of French spoken
in France in a directory named
whereas you would place resources specific to Canadian French in
a directory named
Localized resources that need not be region specific should be placed
in directories named simply for the language, such as
These localized resource directories are then placed in a directory
Nonlocalized (global) resources are kept in the top level of the
See the section “Anatomy of a Bundle” for an example of a complex bundle’s
file system layout.
The user determines which set of localized resources are actually
used by the bundle at runtime. Bundle-related system routines rely
on the language preferences set by the user in the Preferences application.
Preferences lets users create an ordered list of available regions
so that the most preferred region is first, the second most preferred
region is next, and so on. When a bundle is asked for a resource
file, it returns the file-system location of the resource that best
matches the user’s region preferences. See the section “Search Algorithm” for
details on the exact process Mac OS X uses to locate a bundle resource.
See the section “Localizing File System Names” for
information on localizing bundle names. Also see the chapter “Internationalization” for more
detailed information about the naming of
Last updated: 2003-08-21