Next | Prev | Up | Top | Contents | Index

Internationalizing Your Application: The Basic Steps

To internationalize your icon, follow these steps:

  1. Call setlocale() as soon as possible to put the process into the desired locale. See "Setting the Current Locale" for instructions.

  2. Make your application 8-bit clean. (An application is 8-bit clean if it does not use the high bit of any data byte to convey special information.) See "Eight-Bit Cleanliness" for instructions.

  3. If you're writing a multilingual application, you must do one of two things:

  4. Use wide character (WC) or multibyte (MB) characters and strings to allow for more than one byte per character (this is needed for Asian languages, which often require two or even four bytes per character). See "Character Representation" for more information.

  5. Do not rely on ASCII and English sorting rules. Locale-specific collation should be performed with strcoll() and strxfm(). (These are table-driven functions; the tables are supplied as part of locale support.) See "Collating Strings" for more information.

  6. Use the localeconv() function to find out about general details of numeric formatting. Use strfmon() to format currency amounts in particular. See "Specifying Numbers and Money" for more information.

  7. Use strftime() to format dates and times (strftime() gives a host of options for displaying locale-specific dates and times.) See "Formatting Dates and Times" for more information.

  8. Avoid arithmetic on character values. Use the macros in ctype.h to get information about a given character. (These macros are table-driven and locale-sensitive.) If you prefer, you can use the functions that correspond to these macros instead. "Character Classification and ctype" provides more detailed information on these macros and functions.

  9. If you do your own regular expression parsing and matching, use the XPG/4 extensions to traditional regular expression syntax for internationalized software. See "Regular Expressions" for more information.

  10. Where possible, use the XPG/4, rather than the MNLS interface in order to maximize portability. See "Strings and Message Catalogs" for more information.

  11. Provide a catalog for your locale. See "SVR4 MNLS Message Catalogs" for more information.

  12. The File Typing Rule (FTR) strings that are used to customize the Indigo Magic desktop can be Internationalized. See "Internationalizing File Typing Rule Strings With MNLS" for more information.

  13. Use message catalogs for printf() format strings that take linguistic parameters, and allow localizers to localize the format strings as well as text strings. See "Variably Ordered Referencing of printf() Arguments" for more information.

  14. If you're using Xlib, initialize Xlib's internationalization state after calling setlocale(). See "Initialization for Xlib Programming" for more information.

  15. Specify a default fontset suitable for the default locale. Make sure that the application accepts localized fontset specifications via resources (or message catalogs) or command-line options. See "Fontsets" for more information.

  16. Use X11R5 and X11R6 text rendering routines that understand multibyte and wide character strings, not the X11R4 text rendering routines XDrawText(), XDrawString(), and XDrawImageString(). See "Text Rendering Routines" for more information.

  17. Use X11R5 and X11R6 MB and WC versions of width and extents interrogation routines. See "New Text Extents Functions" for more information.

  18. If you are writing a toolkit text object, or if you can't use a toolkit to manage event processing for you, then you have to deal with input methods. Follow the instructions in "User Input".

  19. Use resources to label any object that employs some sort of text label. Your application's app-defaults file should specify every reasonable string resource. See "X Resources for Strings" for more information.

  20. Use dynamic layout objects that calculate layout depending on the natural (localized) size of the objects involved. Some IRIS IM widgets providing these services are XmForm, XmPanedWindow, and XmRowColumn. See "Dynamic Layout" for more information. If you can't use dynamic layout objects, refer to "Layout" for instructions.

  21. Make sure that all icons and other pictographic representations used by your application are localizable. See "Icons" for more information.

Next | Prev | Up | Top | Contents | Index