![]() | The Java Developer's Guide to Eclipse |
Chapter 31, Internationalization and Accessibility, demonstrated that the Eclipse internationalization enablement process is relatively straightforward. This is fortunate, since providing a software product solely in English is no longer acceptable from a usability, quality, marketing, and in some cases, legal standpoint. Enabling your product for the global market simply makes economic sense.
To begin, import the plug-in project com.ibm.jdg2e.nls.example.helloworld
and its fragment project com.ibm.jdg2e.nls.example.helloworld.nl1
from the CD-ROM (see the readme for details).
en_US), you will see the menu choice below.

The menu items and dialog were displayed in English
despite the presence of the German-language com.ibm.jdg2e.nls.example.helloworld.nl1
fragment because the default locale for the launch configuration specifies
"-nl en_US." Close the runtime Workbench.

de_DE). Apply
the settings and then select Run. The message text contributed
by the national language (NL) fragment are now recognized.

This example demonstrates how to internationalize your
plug-in using fragments, so the code itself is of secondary importance.
The property files of this example are shown below, where blue are those
in English and the yellow highlighted files ending in _de are German.
Notice how the corresponding .properties files appear in the same relative
location for each language.
The fragment's library, nl1.jar, is "merged" with those
found on the classpath of the parent plug-in,
com.ibm.jdg2e.nls.example.helloworld. The
additional language-specific .properties files are also found by the
classloader using the same mechanism.
© Copyright International Business Machines Corporation, 2003, 2004, 2006. All Rights Reserved.
Code or samples provided herein are provided without warranty of any kind.