< Previous PageNext Page > Hide TOC

Guidelines for Internationalization

The following sections provide recommendations on how to internationalize your software to best take advantage of Mac OS X.

Contents:

Use Canonical Language and Locale IDs
Use Bundles
Support Unicode Text
Guidelines for Adding MultiScript Support
Carefully Consider Translatable Strings


Use Canonical Language and Locale IDs

Mac OS X 10.3 added support for obtaining canonical locale IDs through the functions of CFLocale. In Mac OS X v10.4 and later, support was added for getting canonical language IDs. (Cocoa support was also added in Mac OS X v10.4.) If you get the user's preferred locale ID through the CFBundle functions or NSBundle class, then you should already be receiving a canonical locale ID.

For information about language and locale IDs, see “Language and Locale Designations.” For information on how to get canonical language and locale IDs, see “Getting Canonical Language and Locale IDs.”

Use Bundles

The Mac OS X bundle mechanism simplifies the process of localization by letting you place localized resources in separate directories named for the language or region they support. Both the CFBundle functions and NSBundle class use this collection of resource folders to localize a program based on the current user’s language and region settings. This mechanism makes it possible for a bundled program to display itself in different languages for different users. Organizing resources by directory also makes it easy to add new localizations later.

Support Unicode Text

Applications should use Unicode-based technologies in all situations that involve displaying text to the user. Unicode support is essential for multibyte languages and Mac OS X supports some languages (including Arabic, Thai, Greek, and Hawaiian) only through Unicode. Regardless of whether you localize your software for multibyte languages, you should still support Unicode so that users can enter text data in their native language.

Mac OS X provides extensive support for managing and displaying Unicode text. Technologies such as ATSUI, MLTE, Quartz, and Cocoa Text all leverage Unicode in the display of text. Core Foundation and Cocoa strings also provide a way to store Unicode strings in your application. Use of these technologies makes it possible to support virtually any language.

While Unicode is important for text that is displayed to the user, you do not need to use it everywhere in your application. For example, you might not need to use Unicode for debugging text or internal logging mechanisms, unless you want those messages to be translated and displayed to users.

Guidelines for Adding MultiScript Support

An application that provides multiscript support can accurately display text in various scripts simultaneously. Such an application can accept text input, display text, and print text containing the scripts of different languages in the same document, regardless of a user’s language preferences. If an application were not prepared to offer multiscript support, some of this text would not appear correctly.

Multiscript support is becoming an increasingly important and expected feature not only for operating systems but for third-party applications. With an internationalized operating system such as Mac OS X, some users expect to be able to create a document in one language, change their language preference, and then open the document as they last saved it.

To add multiscript support to an application on Mac OS X, you must use the appropriate Unicode technologies and API. The text classes in the Cocoa framework automatically provide multiscript support. For Carbon and other non-Cocoa applications, you should use the following technologies:

For more information on file encodings in Mac OS X, see “File Encodings and Fonts.”

Carefully Consider Translatable Strings

When writing text for your application, try to think about how that text might be translated. Grammatical differences between languages can make some text difficult to translate, even with the formatting options available in strings files. In particular, strings that require differentiation between singular and plural forms (because of a count variable, for example) may require different strings in different circumstances. Talk to your translation team about ways to eliminate potential translation problems before they occur.

For more information about strings and strings files, see “Strings Files”



< Previous PageNext Page > Hide TOC


© 2003, 2009 Apple Inc. All Rights Reserved. (Last updated: 2009-01-06)


Did this document help you?
Yes: Tell us what works for you.
It’s good, but: Report typos, inaccuracies, and so forth.
It wasn’t helpful: Tell us what would have helped.