Localizing Macintosh Programs
Localization is the process of adapting an application to a specific language,
culture, and region. By planning ahead and making localization relatively
painless, you'll ensure that your product is ready for international markets in
the future. This section provides a brief overview of what you need to do to
make it easy to localize your application. For the complete account of writing
software that is compatible with Macintosh computers throughout the world,
you should read the TextEdit section and the Worldwide Software Overview . You should also consult the Worldwide Software Development portion of the section en titled,
The key to easy localization is to store region-dependent information used by
your application as resources (rather than within the application's code). Text
seen by the user can then be translated without modifying the code. In addition,
storing such information in resources means that your application can be
adapted for a different area of the world simply by substituting the
appropriate resources. Make sure that at least the following kinds of
information are stored in resources:
• all text, including special characters and delimiters
• menus and keyboard equivalents for menu commands (if available)
• character, word, phrase, and text translation tables
• address formats, including zip codes and telephone numbers
When you create resources for your applications, remember the following
key points:
• text needs room to grow (up, down, and sideways)
• translated text is often 50 percent larger than the U.S. English text
• diacritical marks, widely used outside the United States, may extend
up to the ascent line
• some system fonts contain characters that extend to both the ascent
and descent lines
• potential grammatical problems may arise from error messages,
"natural" programming language structures, and so forth
• text location within a window should be easy to change
Localizing With the Toolbox
In addition to these general guidelines, you need to be aware of a host of other
localization issues, such as differences in script systems and measurement
systems. The User Interface Toolbox in system 7.0 contains updated
versions of several packages and managers that you can use to facilitate
localization of your applications-
Perhaps the most important localization tool is the Script Manager, which contains routines that allow your application to function correctly with
standard interface that allows installation of different script systems,
maintains global data structures, supports switching keyboards between
different scripts, and provides a central dispatcher that gives your application
access to script systems. It also contains utilities for text processing and
parsing, which are useful for applications that do a lot of text manipulation.
another writing system and to coordinate with the
sorting, currency, measurement systems, and date and time formatting. These
tend to vary in some degree from script to script, language to language, and
region to region, and your application should take advantage of the Macintosh
Operating System's ability to present this information in the correct format
based on the current script. It is important that you use the routines in this
package
rather than the Operating System Utility routines such as
UprString; the Operating System Utility routines do not handle diacritical marks and (because they are used by the File Manager) cannot be localized for different countries.
TextEdit provides routines that handle basic text formatting and editing capabilities, such as inserting new text or scrolling text within a window. The
versions of TextEdit included in system software versions 6.0.4 and later contain new features that allow them to work with different scripts. For
double-byte characters to display scripts (such as Kanji) with improved
accuracy and consistency.
For more information about the enhanced versions of TextEdit, see