| Java >
Guidelines Home Page > Java Look and Feel Design Guidelines >
Part II: Fundamental Java Application Design >
3: Design Considerations >
Planning for Internationalization and Localization
In software development, internationalization is the process of writing an application that is suitable for the global marketplace, taking into account variations in regions, languages, and cultures. A related term, localization, refers to the process of customizing an application for a particular language or region. The language, meaning, or format of the following types of data can vary with locale:
Figure 18 shows a notification dialog box in both English and Japanese. Much of the localization of this dialog box involves the translation of text. The Japanese dialog box is bigger than the English dialog box because some text strings are longer. Note the differences in the way that mnemonics are displayed. In English, the mnemonic for the Sound File text field is S. In Japanese, the same mnemonic ( S) is placed at the end of the label.
Click here to view the corresponding code for Figure 18 (also available on the book's companion CD-ROM).Figure 18 English and Japanese Notification Dialog Boxes
The main benefit of designing an application for the global marketplace is more customers. Many countries require that companies purchase applications that support their language and culture. Global planning ensures that your application is easier to translate and maintain. A well-designed application functions the same way in all locales.
You can incorporate support for localization into your design by using JFC-supplied layout managers and resource bundles. In addition, you should take into account that differences exist around the world in reading order, word order, mnemonics, graphics, formats, sorting orders, and fonts.
Internationalization guidelines are identified throughout the book by this symbol. For a list of additional reading, see Design for Internationalization.
You can use a layout manager to control the size and location of the components in your application. For example, Figure 18 shows that the Sound File label becomes longer when it is translated from English to Japanese. The spacing between the Sound File label and its text field, however, is the same in both dialog boxes. For more information on layout managers, see The Java Tutorial at
You should use resource bundles to store locale-specific data, such as text, colors, graphics, fonts, and mnemonics. A resource bundle makes your application easier to localize by isolating locale-specific data so that it can be translated without changing the application source code.
If your application has a Cancel button, for example, the resource bundles in English, German, and Chinese would include the text shown in Figure 19.
Click here to view the corresponding code for Figure 19 (also available on the book's companion CD-ROM).Figure 19 Cancel Buttons in English, German, and Chinese
For translations of interface elements and concepts used in Java look and feel applications into selected European and Asian languages, see Appendix C. For more information on creating resource bundles, see The Java Tutorial. ( The Java Tutorial is described in Java.)
When you lay out your application, place the components according to your users' reading order. This order will help users understand the components quickly as they read through them. Reading order varies among locales. The reading order in English, for example, is left to right and top to bottom. The reading order in Middle Eastern languages, on the other hand, is from right to left and top to bottom.
In this book, you will find standards such as "put labels before the component they describe." The term "before" is determined by the reading order of the user's language. For example, in English, labels appear to the left of the component they describe.
In the JFC, component orientation features can be used to adapt your application to different reading orders.
In the Java 2 SDK, the layout managers
BorderLayout are sensitive to the reading order of the locale.
Keep in mind that word order varies among languages, as shown in the following figure. A noneditable combo box that appears in the middle of an English sentence does not translate properly in French, where the adjective should come after the noun. (The correct French sentence is "Utilisez une Flèche Rouge.")Figure 20 Incorrect Adaptation of English Word Order into French
Figure 21 Correct Adaptation of English Word Order into French
You must be careful when choosing mnemonics, which might change in different languages. Store mnemonics in resource bundles with the rest of your application's text. In addition, make sure that the characters you choose for your mnemonics are available on keyboards in the target countries for your application.
You can make localization easier by using globally understood graphics whenever possible. Many graphics that are easily understood in one locale are puzzling in another locale. For example, using a mailbox to represent an email application is problematic because the shape and size of mailboxes vary by locale. Graphics that represent everyday objects, holidays, and seasons are difficult to localize, as are graphics that include text.
You can use the formatting classes provided in the Java 2 SDK to format numbers, currencies, dates, and times automatically for a specific locale. For example, in English, a date might appear as July 26, 1987, and the time as 3:17 p.m. In German, the same date is written as 26. Juli 1987 and the time is 15:17 Uhr.
For numbers and currencies, the class is
NumberFormat; for dates and times, the class is
DateFormat; and for strings that contain variable data, the class is
MessageFormat. The formatting classes are part of the
You can use the collator classes provided in the Java 2 SDK to enable the sorting of strings by locale. For example, in Roman languages, sorting is commonly based on alphabetical order (which might vary from one language to another). In other languages, sorting might be based on phonetics, character radicals, the number of character strokes, and so on.
Collator class in the
java.text package enables locale-sensitive string sorting.
The size of fonts is also an important consideration for users with visual limitations (that is, anyone over the age of thirty). Be sure to provide user control over font size in your application.
Two kinds of studies done early in the design process can show you how well your application works in the global marketplace. First, you can send draft designs of your application to your translators. Second, you can try out your application with users from the locales you are targeting (for example, test a Japanese version of the application with Japanese users). This research will help you to determine whether users understand how to use the product, if they perceive the graphics and colors as you intended them, and if there is anything offensive in the product.
|Java Look and Feel Design Guidelines, second edition.
Copyright 2001. Sun Microsystems, Inc. All Rights Reserved.