Java >
Guidelines Home Page >  Java Look and Feel Design Guidelines
>
Part II: Fundamental Java Application Design
>
3: Design Considerations
>
Planning for Internationalization and Localization
  Previous Next Contents/Index/Search


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:

  • Colors
  • Currency formats
  • Date and time formats
  • Graphics
  • Icons
  • Labels
  • Messages
  • Number formats
  • Online help
  • Page layouts
  • Personal titles
  • Phone numbers
  • Postal addresses
  • Reading order
  • Sounds
  • Units of measurement

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

 

English and Japanese Dialog Boxes

Benefits of Global Planning

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.

Global Design

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.

Layout Managers

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 here .

Resource Bundles

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

 

English, German, and Chinese Cancel Buttons

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.)

Reading Order

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 FlowLayout and BorderLayout are sensitive to the reading order of the locale.

Word Order

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

 

Incorrect Word Order Adaptation

The following figure corrects the problem by using a label before the noneditable combo box. This format works well in both English and French.

Figure 21   Correct Adaptation of English Word Order into French

 

Correct Word Order Adaptation

Mnemonics

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.

Graphics

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.

Avoid using graphics that might be offensive in some locales, including:

  • Images that contain text. For example, if an image contains English text, the text (and graphic) must be localized for each locale.
  • Images that contain numbers. Numbers have different connotations in different locales. For example, just as the number 13 has an unlucky connotation in the United States, the number 4 connotes death in both Japan and Hong Kong.
  • Images containing hand gestures. A gesture that is appropriate or meaningful in one locale can be offensive or meaningless in another locale.
  • Images that represent a play on words. For instance, puns don't translate well.
  • Images of animals. Just as the image of a dog to represent food would be unsettling to most people in the United States, the image of a cow in the same context can offend people in India.
  • Images of people or faces. Depictions of certain facial expressions, nontraditional gender dynamics, and uncovered skin can be offensive to users in some locales.

An example of a symbol that works well in all cultures is the use of an airplane to denote an airport.

Like text, you can place graphics in resource bundles so that translators can change them without changing the application source code.

Test your graphics by showing them to users in the target locales. A low-cost way to test graphics is to solicit feedback on the proposed icons from salespeople in different locales.

Formats

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 java.text package.

Sort Order

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.

  The Collator class in the java.text package enables locale-sensitive string sorting.

Fonts

You can place fonts in resource bundles so that they can be changed by the localizers. With the Java 2 SDK, the Lucida font (a cross-platform font) is available for use in your applications.

  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.

Usability Studies

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.
Previous Next Contents/Index/Search
Left Curve
Java SDKs and Tools
Right Curve
Left Curve
Java Resources
Right Curve
JavaOne Banner Java 8 banner (182)